/* ============================================
   恒升坊官酱园 · 产品中心样式
   主题：日月恒升（与主站 style.css 同一设计系统）
   色彩：醋黑、陶褐、宣纸白、木匾金、印章红
   说明：本站独立部署，基础样式变量与组件与主站保持一致
   ============================================ */

/* CSS Variables（与主站一致） */
:root {
    --ink-black: #1a1a1a;
    --deep-brown: #2c1810;
    --pottery-brown: #8B5A2B;
    --clay-brown: #A0785A;
    --rice-paper: #F5F0E8;
    --paper-cream: #F8F4ED;
    --plaque-gold: #C9A96E;
    --seal-red: #B22222;
    --seal-dark: #8B1A1A;
    --text-primary: #2c1810;
    --text-secondary: #5a4a3a;
    --text-light: #F5F0E8;
    --text-muted: #8a7a6a;
    --border-gold: rgba(201, 169, 110, 0.3);
    --shadow-soft: 0 4px 20px rgba(44, 24, 16, 0.1);
    --shadow-medium: 0 8px 40px rgba(44, 24, 16, 0.15);
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 17px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--rice-paper);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ============================================
   Navigation（与主站一致）
   ============================================ */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--rice-paper);
    border-bottom: 1px solid var(--border-gold);
    transition: var(--transition);
    padding: 0.6rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 44px;
    width: auto;
    transition: var(--transition);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-primary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--seal-red);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ============================================
   页面横幅（内页小型 Hero）
   ============================================ */
.page-banner {
    position: relative;
    height: 42vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 70px;
}

.page-banner-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.5);
}

.page-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(26, 26, 26, 0.3) 0%,
        rgba(44, 24, 16, 0.25) 50%,
        rgba(26, 26, 26, 0.55) 100%
    );
}

.page-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.page-banner-title {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: 0.15em;
    margin-bottom: 0.8rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.page-banner-subtitle {
    font-size: 1.15rem;
    letter-spacing: 0.2em;
    color: rgba(245, 240, 232, 0.85);
}

/* ============================================
   Section 通用（与主站一致）
   ============================================ */
.section {
    padding: 6rem 2rem;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: var(--seal-red);
    margin-bottom: 1rem;
    position: relative;
}

.section-tag::before,
.section-tag::after {
    content: '◆';
    font-size: 0.5rem;
    margin: 0 0.8rem;
    vertical-align: middle;
    opacity: 0.5;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.section-subtitle {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   产品列表（电商紧凑网格）
   ============================================ */
.products-section {
    padding-top: 3rem;
}

/* 搜索框 */
.product-search {
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

.product-search-input {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    padding: 0.7rem 1.2rem;
    outline: none;
    transition: var(--transition);
}

.product-search-input::placeholder {
    color: var(--text-muted);
}

.product-search-input:focus {
    border-color: var(--seal-red);
    box-shadow: var(--shadow-soft);
}

/* 分类筛选 */
.product-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.product-filter-btn {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    padding: 0.45rem 1.4rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
}

.product-filter-btn:hover {
    color: var(--seal-red);
    border-color: var(--seal-red);
}

.product-filter-btn.active {
    background: var(--seal-red);
    color: var(--text-light);
    border-color: var(--seal-red);
}

/* 产品卡片网格 */
.product-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.product-card {
    background: #fff;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(201, 169, 110, 0.18);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--seal-red);
}

.product-card-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fff;
}

.product-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-cover img {
    transform: scale(1.04);
}

.product-card-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--seal-red);
    color: var(--text-light);
    padding: 0.15rem 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-radius: 2px;
}

.product-card-featured-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--plaque-gold);
    color: var(--deep-brown);
    padding: 0.15rem 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-radius: 2px;
}

.product-card-body {
    padding: 0.7rem 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-title {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.product-card:hover .product-card-title {
    color: var(--seal-red);
}

.product-card-price {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--seal-red);
    letter-spacing: 0.02em;
    margin-top: auto;
}

/* 空状态 / 加载 */
.product-empty,
.product-loading,
.product-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.product-error {
    color: var(--seal-red);
}

/* 分页 */
.product-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-top: 3.5rem;
    flex-wrap: wrap;
}

.product-page-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    background: var(--paper-cream);
    color: var(--text-secondary);
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
}

.product-page-btn:hover:not(:disabled) {
    color: var(--seal-red);
    border-color: var(--seal-red);
}

.product-page-btn.active {
    background: var(--seal-red);
    color: var(--text-light);
    border-color: var(--seal-red);
}

.product-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   产品详情页
   ============================================ */
.detail-section {
    padding: 9rem 2rem 6rem;
}

.detail-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 2.5rem;
}

.detail-back:hover {
    color: var(--seal-red);
}

/* 上半部分：图库 + 信息双栏 */
.detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    margin-bottom: 4rem;
}

.detail-gallery-main {
    background: linear-gradient(135deg, #f8f4ed 0%, #efe7d8 100%);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 1 / 1;
}

.detail-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2rem;
}

.detail-gallery-thumbs {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.detail-thumb {
    width: 72px;
    height: 72px;
    background: var(--paper-cream);
    border: 1px solid var(--border-gold);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.detail-thumb.active,
.detail-thumb:hover {
    border-color: var(--seal-red);
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-category {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--seal-red);
    border: 1px solid var(--seal-red);
    padding: 0.25rem 1rem;
    border-radius: 2px;
    margin-bottom: 1.2rem;
}

.detail-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.detail-price {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--seal-red);
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.detail-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1.8rem;
}

.detail-specs {
    background: var(--paper-cream);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
}

.detail-specs-title {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--text-primary);
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

.detail-specs ul li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.9;
}

.detail-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    color: var(--text-light);
    background: var(--seal-red);
    border: none;
    border-radius: 2px;
    padding: 1rem 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
}

.detail-buy-btn:hover {
    background: var(--seal-dark);
    box-shadow: var(--shadow-medium);
}

.detail-buy-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 0.8rem;
}

/* 下半部分：富文本详细介绍 */
.detail-description {
    background: var(--paper-cream);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    padding: 3rem;
    box-shadow: var(--shadow-soft);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 2;
}

.detail-description h2,
.detail-description h3,
.detail-description h4 {
    font-family: var(--font-serif);
    color: var(--text-primary);
    margin: 2rem 0 1rem;
    line-height: 1.5;
}

.detail-description h2 { font-size: 1.5rem; }
.detail-description h3 { font-size: 1.25rem; }
.detail-description h4 { font-size: 1.1rem; }

.detail-description p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.detail-description img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    margin: 0;
    vertical-align: top;
}

/* 电商详情式无缝长图：只包含单张图片的段落不再产生段间距 */
.detail-description p:has(> img:only-child) {
    margin-bottom: 0;
    line-height: 0;
}

/* 图片段落之后紧跟的文字段落补回上边距，避免文字贴图 */
.detail-description p:has(> img:only-child) + p:not(:has(> img:only-child)) {
    margin-top: 1.2rem;
}

.detail-description blockquote {
    border-left: 3px solid var(--plaque-gold);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.detail-description ul,
.detail-description ol {
    padding-left: 1.8rem;
    margin-bottom: 1.2rem;
}

.detail-description ul li,
.detail-description ol li {
    margin-bottom: 0.5rem;
}

.detail-description a {
    color: var(--seal-red);
    border-bottom: 1px solid var(--border-gold);
}

.detail-description a:hover {
    border-bottom-color: var(--seal-red);
}

.detail-description strong {
    color: var(--text-primary);
}

/* ============================================
   微信小程序码弹窗
   ============================================ */
.wechat-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(26, 26, 26, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wechat-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.wechat-modal {
    background: var(--paper-cream);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    box-shadow: var(--shadow-medium);
    max-width: 360px;
    width: 100%;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
    transform: translateY(12px);
    transition: transform 0.3s ease;
}

.wechat-modal-overlay.open .wechat-modal {
    transform: translateY(0);
}

.wechat-modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.3rem;
    transition: var(--transition);
}

.wechat-modal-close:hover {
    color: var(--seal-red);
}

.wechat-modal-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
}

.wechat-modal-qrcode {
    width: 220px;
    height: 220px;
    margin: 0 auto 1.2rem;
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.wechat-modal-qrcode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wechat-modal-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   Footer（与主站一致）
   ============================================ */
.footer {
    background: var(--deep-brown);
    color: var(--text-light);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(201, 169, 110, 0.2);
}

.footer-brand {
    text-align: center;
}

.footer-logo {
    height: 120px;
    width: auto;
    margin: 0 auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--plaque-gold);
    margin-bottom: 1.2rem;
    letter-spacing: 0.1em;
}

.footer-col ul li {
    margin-bottom: 0.7rem;
}

.footer-col a {
    font-size: 0.9rem;
    color: rgba(245, 240, 232, 0.7);
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--plaque-gold);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(245, 240, 232, 0.5);
    letter-spacing: 0.05em;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .detail-main {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        background: var(--rice-paper);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border-gold);
        transform: translateY(-150%);
        transition: transform 0.4s ease;
        align-items: flex-start;
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .detail-section {
        padding: 8rem 1.5rem 4rem;
    }

    .detail-description {
        padding: 1.8rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 560px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .product-filters {
        gap: 0.5rem;
    }

    .product-filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .product-card-body {
        padding: 0.5rem 0.6rem 0.7rem;
    }

    .product-card-title {
        font-size: 0.95rem;
    }

    .wechat-modal-qrcode {
        width: 180px;
        height: 180px;
    }
}
