/* ============================================================
   E-Catalog - 前台样式 (English/Chinese)
   设计风格: 时尚大气
   ============================================================ */

/* --- Reset & Variables --- */
:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e94560;
    --accent-hover: #d63851;
    --text: #2d2d2d;
    --text-light: #666;
    --text-muted: #999;
    --bg: #ffffff;
    --bg-alt: #f8f8fa;
    --border: #eee;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --max-width: 1280px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Top Bar --- */
.top-bar {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    padding: 8px 0;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-right { display: flex; align-items: center; gap: 16px; }
.top-bar-contact { display: flex; align-items: center; gap: 4px; }
.lang-switch a {
    color: rgba(255,255,255,0.6);
    padding: 2px 4px;
    transition: color var(--transition);
}
.lang-switch a:hover, .lang-switch a.active { color: #fff; }
.lang-divider { color: rgba(255,255,255,0.3); margin: 0 2px; }

/* --- Header --- */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.logo-img { height: 40px; width: auto; object-fit: contain; }
.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    align-items: center;
    white-space: nowrap;
}

/* Navigation */
.nav { display: flex; align-items: center; gap: 36px; }
.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding: 4px 0;
    transition: color var(--transition);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    z-index: 200;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
}
.dropdown-item:hover { background: var(--bg-alt); color: var(--accent); }
.dropdown-item.dropdown-has-children { font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.dropdown-item.dropdown-has-children + .dropdown-item { padding-left: 36px; font-size: 13px; }
.dropdown-arrow { font-size: 16px; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.search-toggle, .menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}
.search-toggle:hover, .menu-toggle:hover { background: var(--bg-alt); }
.menu-toggle { display: none; flex-direction: column; gap: 5px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* Search Bar */
.search-bar {
    display: none;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
}
.search-bar.open { display: block; }
.search-bar .container { display: flex; align-items: center; gap: 12px; }
.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition);
}
.search-bar input:focus { border-color: var(--accent); }
.search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
}

/* --- Hero --- */
.hero {
    position: relative;
    height: 520px;
    background: linear-gradient(135deg, var(--primary) 0%, #2d2d5e 40%, #3d2d3d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(233,69,96,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(255,255,255,0.05) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 1200px; padding: 0 24px; }
.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 300;
    opacity: 0.85;
    margin-bottom: 36px;
    line-height: 1.5;
}
.hero-btn {
    display: inline-block;
    padding: 14px 40px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.hero-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(233,69,96,0.4); }

/* Hero 轮播背景 */
.hero-bg-carousel {
    position: absolute; inset: 0; z-index: 0;
}
.hero-bg-slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.2s ease-in-out;
}
.hero-bg-slide.active { opacity: 1; }
.hero-carousel .hero-overlay { background: rgba(0,0,0,0.35); }

/* --- Sections --- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: var(--primary);
    position: relative;
    padding-bottom: 20px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* --- Categories Grid --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.category-card {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.category-card-img {
    height: 160px;
    background: linear-gradient(135deg, #f0f0f5, #e8e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.category-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.category-card:hover .category-card-img img { transform: scale(1.05); }
.category-card-placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}
.category-card-body {
    padding: 16px;
    text-align: center;
}
.category-card-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}
.category-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.category-card-parent {
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.category-card-subs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.category-card-sub {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-alt, #f0f0f5);
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
a.category-card-sub:hover {
    background: var(--accent);
    color: #fff;
}
.category-card-sub-more {
    cursor: default;
}

/* --- Category Sidebar Layout --- */
.category-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.category-sidebar {
    flex: 0 0 200px;
    background: var(--bg-alt, #f8f8fa);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 96px;
}
.category-sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.category-sidebar-parent {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    transition: color 0.2s;
}
.category-sidebar-parent:hover {
    color: var(--accent);
}
.category-sidebar-link.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.category-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-sidebar-list li {
    margin: 0;
}
.category-sidebar-link {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.category-sidebar-link:hover {
    background: var(--accent);
    color: #fff;
}
.category-main {
    flex: 1;
    min-width: 0;
}
@media (max-width: 768px) {
    .category-layout {
        flex-direction: column;
    }
    .category-sidebar {
        flex: none;
        width: 100%;
        position: static;
        padding: 16px;
    }
    .category-sidebar-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .category-sidebar-list li {
        margin: 0;
    }
    .category-sidebar-link {
        padding: 6px 14px;
        font-size: 13px;
        background: #fff;
    }
}

/* --- Products Grid --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}
.product-card {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.product-card-img {
    position: relative;
    height: 320px;
    background: linear-gradient(135deg, #f8f8fa, #f0f0f5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}
.product-card:hover .product-card-img img { transform: scale(1.06); }
.product-card-placeholder {
    color: var(--text-muted);
    opacity: 0.4;
}
.product-code-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(26,26,46,0.8);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.product-card-body { padding: 20px; }
.product-card-category {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 6px;
}
.product-card-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-card-price {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 32px;
}
.feature-card {
    text-align: center;
    padding: 36px 24px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon { color: var(--accent); margin-bottom: 20px; }
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; color: var(--primary); }
.feature-card p { font-size: 15px; color: var(--text-light); line-height: 1.6; }

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}
.breadcrumb a { color: var(--text-light); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.category-desc {
    text-align: center;
    max-width: 600px;
    margin: -24px auto 40px;
    color: var(--text-light);
}

/* --- Product Detail --- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}
.product-gallery { position: relative; }
.gallery-main {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-alt);
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.gallery-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.3;
}
.product-meta { font-size: 15px; color: var(--text-light); margin-bottom: 20px; }
.product-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}
.product-meta-item {
    background: var(--bg-alt);
    padding: 14px 16px;
    border-radius: 8px;
}
.meta-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 4px; }
.meta-value { font-size: 15px; font-weight: 600; color: var(--text); }
.product-description { margin-bottom: 28px; }
.product-description h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: var(--primary); }
.product-desc-content { font-size: 15px; color: var(--text-light); line-height: 1.7; }
.product-fields-table { width: 100%; border-collapse: collapse; }
.product-fields-table tr { border-bottom: 1px solid var(--border); }
.product-fields-table tr:last-child { border-bottom: none; }
.product-field-label { padding: 10px 12px 10px 0; font-weight: 600; color: var(--text); font-size: 14px; white-space: nowrap; width: 1%; vertical-align: top; }
.product-field-value { padding: 10px 0; color: var(--text-light); font-size: 14px; line-height: 1.6; }

.btn-inquiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.btn-inquiry:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(233,69,96,0.4); }

/* ===== Product Prev/Next Navigation — Book-flipping Style ===== */
.product-nav-section {
    margin: 56px 0 0 0;
    padding: 0;
}
.product-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 36px;
    background: var(--bg-alt, #f5f5f8);
    border-radius: 16px;
    border: 2px solid var(--border);
    position: relative;
    gap: 16px;
}
/* Book-spine center line */
.product-nav::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    pointer-events: none;
}
.product-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 32px;
    border: 2px solid var(--accent);
    border-radius: 16px;
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    background: transparent;
    min-width: 140px;
    justify-content: flex-start;
}
.product-nav-btn.next {
    justify-content: flex-end;
}
.product-nav-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(233,69,96,0.35);
}
.product-nav-btn:active {
    transform: translateY(-1px) scale(0.98);
}
.product-nav-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s;
}
.product-nav-btn.prev:hover svg {
    animation: flipArrowLeft 0.5s ease;
}
.product-nav-btn.next:hover svg {
    animation: flipArrowRight 0.5s ease;
}
@keyframes flipArrowLeft {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-6px); }
}
@keyframes flipArrowRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}
.product-nav-btn.disabled {
    opacity: 0.15;
    pointer-events: none;
    cursor: default;
}
.nav-btn-label {
    font-weight: 700;
    letter-spacing: 2px;
}
.product-nav-center {
    text-align: center;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}
.product-nav-product {
    display: block;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-nav-code {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 3px;
}

/* ===== Gallery Flip Buttons (overlaid on product image) ===== */
.product-gallery {
    position: relative;
    overflow: hidden;
}
.gallery-flip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.gallery-flip:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 24px rgba(233,69,96,0.35);
}
.gallery-flip:active {
    transform: translateY(-50%) scale(0.9);
    transition: transform 0.1s;
}
.gallery-flip-prev { left: 12px; }
.gallery-flip-next { right: 12px; }
.gallery-flip.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

/* ===== Gallery Inquiry Checkbox ===== */
.gallery-main {
    position: relative;
}
.gallery-inquiry-check {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.25s;
}
.gallery-inquiry-check:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(233,69,96,0.3);
}
.gallery-check-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}
.gallery-inquiry-check .inquiry-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ===== Boundary Toast ===== */
.flip-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 999;
    padding: 12px 24px;
    border-radius: 12px;
    background: rgba(26,26,46,0.92);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}
.flip-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.flip-toast.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* ===== Mobile Bottom Nav Bar (always visible on mobile) ===== */
.mobile-product-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: #fff;
    border-top: 2px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    padding: 10px 16px;
    justify-content: space-between;
    align-items: center;
}
.mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none;
    transition: all 0.25s;
    flex: 1;
    justify-content: center;
    margin: 0 6px;
}
.mobile-nav-btn:active {
    transform: scale(0.95);
    background: var(--accent-hover);
}
.mobile-nav-btn.disabled {
    background: #eee;
    color: #bbb;
    pointer-events: none;
}
.mobile-nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

/* ===== Book-Flip Transition Overlay ===== */
.flip-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
}
.flip-overlay-inner {
    position: absolute;
    inset: 0;
    background: var(--bg, #f8f8fa);
}
/* Page spine shadow — simulates the book binding */
.flip-overlay-inner::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    background: transparent;
    pointer-events: none;
}
.flip-overlay.flip-next .flip-overlay-inner::after {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.15), transparent);
    opacity: 0;
    transition: opacity 0.15s;
}
.flip-overlay.flip-next.active .flip-overlay-inner::after {
    opacity: 1;
    transition: opacity 0.25s 0.1s;
}
.flip-overlay.flip-prev .flip-overlay-inner::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.15), transparent);
    opacity: 0;
    transition: opacity 0.15s;
}
.flip-overlay.flip-prev.active .flip-overlay-inner::after {
    opacity: 1;
    transition: opacity 0.25s 0.1s;
}

/* Active flip animations */
.flip-overlay.active .flip-overlay-inner {
    animation: 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 0 60px rgba(0,0,0,0.15);
}
.flip-overlay.flip-next .flip-overlay-inner {
    transform-origin: left center;
}
.flip-overlay.flip-next.active .flip-overlay-inner {
    animation-name: pageFlipNext;
}
.flip-overlay.flip-prev .flip-overlay-inner {
    transform-origin: right center;
}
.flip-overlay.flip-prev.active .flip-overlay-inner {
    animation-name: pageFlipPrev;
}

/* Swipe preview */
.flip-overlay.flip-next.swipe .flip-overlay-inner {
    animation: none;
    transform-origin: left center;
    transform: perspective(1600px) rotateY(calc(var(--swipe-progress, 0) * -30deg));
    opacity: calc(var(--swipe-progress, 0) * 0.85);
}
.flip-overlay.flip-prev.swipe .flip-overlay-inner {
    animation: none;
    transform-origin: right center;
    transform: perspective(1600px) rotateY(calc(var(--swipe-progress, 0) * 30deg));
    opacity: calc(var(--swipe-progress, 0) * 0.85);
}

@keyframes pageFlipNext {
    0% {
        transform: perspective(1600px) rotateY(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: perspective(1600px) rotateY(-85deg);
        opacity: 0.6;
    }
}
@keyframes pageFlipPrev {
    0% {
        transform: perspective(1600px) rotateY(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: perspective(1600px) rotateY(85deg);
        opacity: 0.6;
    }
}

.related-products { margin-top: 32px; }

/* --- Contact Sidebar --- */
.contact-sidebar { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 90; }
.contact-toggle {
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    box-shadow: -2px 2px 12px rgba(0,0,0,0.15);
}
.contact-toggle:hover { background: var(--accent-hover); }
.sidebar-panel {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    width: 360px;
    height: 100vh;
    background: #fff;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    flex-direction: column;
}
.contact-sidebar.open .sidebar-panel { display: flex; }
.contact-sidebar.open .contact-toggle { display: none; }
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h3 { font-size: 18px; color: var(--primary); }
.sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}
.sidebar-body { flex: 1; overflow-y: auto; padding: 24px; }
.sidebar-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; }
.sidebar-name { font-size: 18px; font-weight: 600; color: var(--primary); }
.sidebar-title { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.sidebar-info { margin-bottom: 24px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text);
    transition: color 0.2s;
    border-bottom: 1px solid var(--border);
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { color: var(--accent); }
.sidebar-inquiry { margin-top: 20px; }
.sidebar-inquiry textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
.sidebar-inquiry textarea:focus { border-color: var(--accent); }
.sidebar-inquiry button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.sidebar-inquiry button:hover { background: var(--accent-hover); }

/* --- Footer --- */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.75);
    padding: 60px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
}
.footer-col h4 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}
.footer-col p, .footer-col a {
    font-size: 14px;
    line-height: 1.8;
    display: block;
}
.footer-col a { color: rgba(255,255,255,0.6); transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-desc { color: var(--accent) !important; font-weight: 500; margin-bottom: 8px; }
.footer-links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state p { margin-top: 16px; font-size: 16px; }
.btn-back {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-back:hover { background: var(--accent-hover); }

/* --- Inquiry Checkbox on Product Cards --- */
.inquiry-check-label {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inquiry-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.inquiry-check-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.inquiry-check-icon::after {
    content: '';
    width: 12px;
    height: 6px;
    border: 2px solid #fff;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) translateY(1px);
    opacity: 0;
    transition: opacity 0.2s;
}
.inquiry-check-input:checked + .inquiry-check-icon {
    background: var(--accent);
    border-color: var(--accent);
}
.inquiry-check-input:checked + .inquiry-check-icon::after {
    opacity: 1;
}
.product-card:hover .inquiry-check-icon {
    transform: scale(1.1);
}

/* --- Floating Inquiry Cart --- */
.inquiry-cart {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 150;
    display: none !important; /* Replaced by fixed inquiry bar */
}
.inquiry-cart.visible {
    display: none !important;
}
.inquiry-cart-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(233,69,96,0.4);
    transition: all var(--transition);
    position: relative;
}
.inquiry-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(233,69,96,0.5);
}
.inquiry-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #fff;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.inquiry-cart-label {
    position: absolute;
    right: 72px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.inquiry-cart-btn:hover .inquiry-cart-label {
    opacity: 1;
}

/* --- Inquiry Modal --- */
.inquiry-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.inquiry-modal-overlay.open {
    display: flex;
}
.inquiry-modal {
    background: #fff;
    border-radius: 16px;
    width: 560px;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.inquiry-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.inquiry-modal-header h2 {
    font-size: 18px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.inquiry-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}
.inquiry-modal-close:hover { background: var(--bg-alt); color: var(--text); }
.inquiry-modal-body { padding: 24px; }
.inquiry-modal-body .form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.inquiry-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.inquiry-form-group {
    margin-bottom: 12px;
}
.inquiry-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.inquiry-form-group input,
.inquiry-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}
.inquiry-form-group textarea { resize: vertical; min-height: 80px; }
.inquiry-form-group input:focus,
.inquiry-form-group textarea:focus {
    border-color: var(--accent);
}
.inquiry-product-list {
    margin-bottom: 16px;
}
.inquiry-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-alt);
    border-radius: 10px;
    margin-bottom: 8px;
}
.inquiry-product-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e0e0e0;
}
.inquiry-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.inquiry-product-info {
    flex: 1;
    min-width: 0;
}
.inquiry-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inquiry-product-code {
    font-size: 12px;
    color: var(--text-muted);
}
.inquiry-product-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.inquiry-product-remove:hover { color: var(--accent); }
.inquiry-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.inquiry-submit-btn:hover { background: var(--accent-hover); }
.inquiry-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* --- Fixed Inquiry Bar (replaces floating cart) --- */
.inquiry-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid var(--border);
    z-index: 149;
    padding: 12px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    transition: border-color 0.3s;
}
.inquiry-bar.active { border-top-color: var(--accent); }
.inquiry-bar.visible { display: block; }
.inquiry-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.inquiry-bar-info { font-size: 14px; color: var(--text-muted); }
.inquiry-bar-info .inquiry-bar-count {
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.3s;
}
.inquiry-bar.active .inquiry-bar-count { color: var(--accent); }
.inquiry-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    background: #ddd;
    color: #999;
}
.inquiry-bar.active .inquiry-bar-btn {
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}
.inquiry-bar.active .inquiry-bar-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,69,96,0.3);
}

/* Body padding when inquiry bar is visible */
body.has-inquiry-bar { padding-bottom: 72px; }
body.has-inquiry-bar .inquiry-cart { display: none !important; }

/* --- Salesperson Selector Page --- */
.sales-selector {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.sales-selector h2 { font-size: 28px; color: var(--primary); margin-bottom: 8px; }
.sales-selector .sub { color: var(--text-muted); font-size: 16px; margin-bottom: 40px; }
.sales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    max-width: 800px;
    width: 100%;
}
.sales-card {
    display: block;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}
.sales-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.sales-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    background: var(--bg-alt);
}
.sales-card-name { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.sales-card-title { font-size: 14px; color: var(--text-muted); }
.sales-card-email { font-size: 13px; color: var(--accent); margin-top: 8px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .product-detail { grid-template-columns: 1fr; gap: 40px; }
    .product-gallery { position: relative; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .gallery-flip { width: 40px; height: 40px; }
    .gallery-flip svg { width: 22px; height: 22px; }
    .inquiry-cart { bottom: 20px; right: 20px; }
    .inquiry-cart-btn { width: 52px; height: 52px; }
    .inquiry-modal { width: 90vw; max-height: 90vh; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .section { padding: 48px 0; }
    .hero { height: 400px; }
    .section-title { font-size: 26px; margin-bottom: 32px; }
    .menu-toggle { display: flex; }
    .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
    .nav.open { display: flex; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .product-card-img { height: 220px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .top-bar-welcome { display: none; }
    .product-detail { gap: 24px; }
    .sidebar-panel { width: 100%; max-width: 360px; }
    .product-nav-section { margin: 32px 0 0 0; }
    .product-nav { padding: 16px 16px; margin-top: 0; }
    .product-nav-btn { padding: 8px 14px; font-size: 12px; gap: 6px; min-width: auto; border-radius: 10px; }
    .product-nav-btn svg { width: 18px; height: 18px; }
    .product-nav-btn .nav-btn-label { font-size: 11px; }
    .product-nav-product { font-size: 12px; }
    .inquiry-form-row { grid-template-columns: 1fr; }
    .inquiry-modal { border-radius: 16px 16px 0 0; margin-top: auto; max-height: 90vh; }
    /* Mobile bottom nav bar */
    .mobile-product-nav { display: flex; }

@media (max-width: 480px) {
    .hero { height: 320px; }
    .hero-title { font-size: 28px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card-body { padding: 12px; }
    .product-card-name { font-size: 14px; }
    .product-nav-btn { padding: 6px 10px; min-width: auto; }
    .product-nav-product { font-size: 11px; }
    .gallery-flip { width: 36px; height: 36px; }
    .gallery-flip svg { width: 20px; height: 20px; }
    .gallery-flip-prev { left: 6px; }
    .gallery-flip-next { right: 6px; }
    .gallery-inquiry-check { padding: 6px 10px; font-size: 12px; bottom: 8px; right: 8px; }
    .mobile-nav-btn { padding: 10px 14px; font-size: 12px; gap: 4px; }
}
