/* ============================================
   秦太岁文化收藏馆 - Custom Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
    --color-red: #7A1F1A;
    --color-red-dark: #5A150F;
    --color-black: #2D2B28;
    --color-text: #3D3428;
    --color-muted: #6B6560;
    --color-gold: #C4A265;
    --color-gold-light: #D4B66A;
    --color-warm-bg: #F8F3E8;
    --color-alt-bg: #FFFCF5;
    --color-white: #FFFFFF;
    --font-heading: 'Noto Serif SC', serif;
    --font-body: 'Noto Sans SC', sans-serif;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.8;
    background: var(--color-warm-bg, #F8F3E8);
}

body.content-style-unboxed .site {
    background: var(--color-warm-bg, #F8F3E8);
}

.content-bg {
    background: var(--color-alt-bg, #FFFCF5);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-black);
}

/* --- Header: hide Kadence native header globally, use custom topbar --- */
#masthead {
    display: none !important;
}

/* --- Topbar (global, used on all pages) --- */
.qts-topbar {
    background: var(--color-black, #2D2B28);
    border-bottom: 2px solid var(--color-gold, #C4A265);
}

.qts-topbar__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    min-height: 48px;
}

.qts-topbar__left {
    display: flex;
    align-items: center;
}

.qts-topbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.qts-topbar__icon,
.qts-topbar__account {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    text-decoration: none;
    position: relative;
}

.qts-topbar__account {
    color: var(--color-gold, #C4A265);
}

.qts-topbar__icon:hover,
.qts-topbar__account:hover {
    color: var(--color-white, #fff);
    background: rgba(255, 255, 255, 0.08);
}

.qts-topbar__cart-count {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--color-red, #7A1F1A);
    color: var(--color-white, #fff);
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.qts-topbar__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.qts-topbar__menu > li {
    position: relative;
}

.qts-topbar__menu > li > a {
    display: block;
    padding: 0.75rem 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-heading, 'Noto Serif SC', serif);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.qts-topbar__menu > li > a:hover,
.qts-topbar__menu > li.current-menu-item > a {
    color: var(--color-gold, #C4A265);
}

.qts-topbar__menu > li.menu-item-has-children > a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0.45rem;
    padding: 0.48rem 1rem;
    color: var(--color-black, #2D2B28);
    background: linear-gradient(135deg, #D4B66A 0%, #C4A265 48%, #9A7B45 100%);
    border: 1px solid rgba(212, 182, 106, 0.65);
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 7px 18px rgba(196, 162, 101, 0.28);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.22s ease, box-shadow 0.22s ease, color 0.22s ease, background 0.22s ease;
}

.qts-topbar__menu > li.menu-item-has-children > a::after {
    content: '';
    width: 0.42rem;
    height: 0.42rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.85;
}

.qts-topbar__menu > li.menu-item-has-children:hover > a,
.qts-topbar__menu > li.menu-item-has-children.current-menu-item > a,
.qts-topbar__menu > li.menu-item-has-children.current-menu-ancestor > a {
    color: var(--color-black, #2D2B28);
    background: linear-gradient(135deg, #E0C87A 0%, #C4A265 52%, #8A6B35 100%);
    box-shadow: 0 0 0 1px rgba(224, 200, 122, 0.22), 0 10px 24px rgba(196, 162, 101, 0.38);
    transform: translateY(-1px);
}

.qts-topbar__menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    background: var(--color-black, #2D2B28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--color-red, #7A1F1A);
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.qts-topbar__menu > li:hover > .sub-menu {
    display: block;
}

.qts-topbar__menu .sub-menu a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.qts-topbar__menu .sub-menu a:hover {
    color: var(--color-gold, #C4A265);
    background: rgba(255, 255, 255, 0.05);
    padding-left: 1.5rem;
}

@media (max-width: 768px) {
    .qts-topbar__inner {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .qts-topbar__left {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .qts-topbar__right {
        width: 100%;
        justify-content: center;
    }

    .qts-topbar__menu {
        min-width: max-content;
        flex-wrap: nowrap;
    }

    .qts-topbar__menu > li > a {
        padding: 0.5rem 0.8rem;
        font-size: 0.875rem;
    }
}

/* --- Buttons Global --- */
.wc-block-grid__product,
.products .product {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.wc-block-grid__product:hover,
.products .product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.wc-block-grid__product .wc-block-grid__product-title,
.products .product .woocommerce-loop-product__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-black);
}

.wc-block-grid__product .wc-block-grid__product-price,
.products .product .price {
    color: var(--color-red);
    font-weight: 600;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-black);
    color: rgba(255, 255, 255, 0.7);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--color-gold);
}

.site-footer .footer-widget-area h4,
.site-footer .widget-title {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* --- Buttons Global --- */
.wp-block-button__link,
.button,
.woocommerce a.button {
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

/* --- Gold Accent Utilities --- */
.gold-accent {
    color: var(--color-gold);
}

.gold-border {
    border: 1px solid var(--color-gold);
}

/* --- WooCommerce Overrides --- */

body.content-style-unboxed .content-bg.loop-entry .content-bg:not(.loop-entry) {
    background: var(--color-alt-bg, #FFFCF5);
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background-color: var(--color-warm-bg, #F8F3E8);
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: var(--color-alt-bg, #FFFCF5);
    border-bottom-color: var(--color-alt-bg, #FFFCF5);
}

.woocommerce .sale-flash,
.wc-block-grid__product-onsale {
    background: var(--color-red);
    color: var(--color-white);
}

.woocommerce .button.add_to_cart_button,
.woocommerce .button.product_type_simple {
    background: var(--color-red);
    color: var(--color-white);
    border: none;
}

.woocommerce .button.add_to_cart_button:hover,
.woocommerce .button.product_type_simple:hover {
    background: var(--color-red-dark);
}

/* --- Footer Info Section (global) --- */
.qts-footer-info {
    background: var(--color-black, #2D2B28);
    color: rgba(255, 255, 255, 0.75);
    padding: 3.5rem 2rem 1.5rem;
}

.qts-footer-info__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.qts-footer-info__company {
    font-family: var(--font-heading, 'Noto Serif SC', serif);
    color: var(--color-gold, #C4A265);
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
}

.qts-footer-info__slogan {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

.qts-footer-info h3 {
    color: var(--color-white, #fff);
    font-family: var(--font-heading, 'Noto Serif SC', serif);
    font-size: 1rem;
    margin: 0 0 1rem;
}

.qts-footer-info ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qts-footer-info li {
    margin-bottom: 0.6rem;
    font-size: 0.875rem;
}

.qts-footer-info__label {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 0.5rem;
}

.qts-footer-info__label::after {
    content: '：';
}

.qts-footer-info__address p {
    font-size: 0.875rem;
    margin: 0 0 0.4rem;
}

.qts-footer-info__qr-placeholder {
    width: 100px;
    height: 100px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
}

.qts-footer-info__copyright {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.qts-footer-info__copyright p {
    margin: 0;
}

@media (max-width: 1024px) {
    .qts-footer-info__inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .qts-footer-info__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .qts-footer-info__qr-placeholder {
        margin: 0.5rem auto 0;
    }
}
