/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1a1a2e;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #e9ecef;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

a { text-decoration: none; color: inherit; }

/* ===== Header ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

/* ===== Header Search ===== */
.header-search {
    flex: 1;
    max-width: 360px;
    margin: 0 auto;
}

.header-search-input {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: #f1f3f5;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
}

.header-search-input::placeholder {
    color: var(--text-light);
}

.header-search-input:focus {
    background: var(--surface);
    border-color: var(--accent);
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    transition: opacity var(--transition);
}
.logo:hover { opacity: 0.75; }

/* ===== Header Logo ===== */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity var(--transition);
}
.header-logo:hover { opacity: 0.8; }

.header-logo-img {
    height: 38px;
    width: auto;
    flex-shrink: 0;
}

.header-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn,
.cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.lang-btn:hover,
.cat-btn:hover {
    background: #f1f3f5;
}

.lang-btn svg,
.cat-btn svg {
    flex-shrink: 0;
    color: var(--text-light);
}

.lang-label {
    font-size: 13px;
    color: var(--text-light);
}

.lang-chevron {
    transition: transform var(--transition);
    color: var(--text-light);
}

/* ===== Language Dropdown ===== */
.lang-dropdown-wrapper {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 300;
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== Drawer ===== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: var(--surface);
    z-index: 201;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.drawer-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    line-height: 1;
}
.drawer-close:hover {
    background: #e9ecef;
    color: var(--text);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.drawer-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
    font-size: 14px;
}

.drawer-cat-link {
    display: block;
    padding: 12px 24px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
}
.drawer-cat-link:hover {
    background: #f1f3f5;
}
.drawer-cat-link.active {
    background: #e8f0fe;
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* ===== Language Options ===== */
.lang-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 15px;
    font-weight: 500;
    position: relative;
}
.lang-option:hover {
    background: #f8f9fa;
}

.lang-option.active {
    background: #f0f3ff;
    color: #4a6cf7;
}

.lang-option.active::after {
    content: '✓';
    position: absolute;
    right: 24px;
    font-weight: 700;
    color: #4a6cf7;
}

.lang-flag {
    font-size: 22px;
    width: 32px;
    text-align: center;
}

/* ===== Carousel ===== */
.carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    background: #f1f3f5;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
}

.carousel-slide a,
.carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.35);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 10;
}
.carousel-arrow:hover { background: rgba(0,0,0,0.55); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

.carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all var(--transition);
}
.carousel-dot.active {
    background: #fff;
    border-color: #fff;
}
.carousel-dot:hover {
    border-color: #fff;
}
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 16px;
}
.toolbar-left {
    color: var(--text-light);
    font-size: 13px;
}
.toolbar-right select {
    padding: 8px 36px 8px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23636e72' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color var(--transition);
}
.toolbar-right select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
    display: block;
    position: relative;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f1f3f5;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-info {
    padding: 14px 16px 16px;
}
.product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-light);
}
.breadcrumb a {
    color: var(--text-light);
    transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ===== Product Detail ===== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 8px;
}

.product-gallery .main-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f1f3f5;
    border: 1px solid var(--border);
}
.product-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-list {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.thumb-list img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}
.thumb-list img.active,
.thumb-list img:hover {
    border-color: var(--accent);
}

.product-info-detail h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
    color: var(--primary);
}

.price-box { margin-bottom: 24px; }
.price-box .price {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
}

.meta {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 2.2;
}
.sold-out {
    color: var(--accent);
    font-weight: 600;
}

.description {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}
.description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--primary);
}
.description .content {
    font-size: 15px;
    color: var(--text);
    line-height: 1.8;
}

/* ===== Contact Button ===== */
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    margin-bottom: 12px;
}
.btn-contact:hover {
    background: var(--accent-hover);
}

/* ===== Contact Modal ===== */
.contact-modal-content {
    animation: contactFadeIn 0.25s ease;
}

@keyframes contactFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== QR Zoom Overlay ===== */
#qrcodeZoomOverlay {
    animation: qrZoomIn 0.2s ease;
}

@keyframes qrZoomIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#qrcodeZoomImg {
    transition: transform 0.3s ease;
}

.qrcode-zoom {
    transition: transform var(--transition), box-shadow var(--transition);
}

.qrcode-zoom:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ===== 轮播图大图预览 ===== */
.carousel-slide img.carousel-zoom {
    cursor: zoom-in;
}
#imgLightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
    animation: qrZoomIn 0.2s ease;
}
#imgLightbox.open {
    display: flex;
}
#imgLightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 40px 0 32px;
}
.page-link {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    font-weight: 500;
    transition: all var(--transition);
}
.page-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.page-link:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    font-size: 15px;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--primary);
    color: #b2bec3;
    padding: 40px 0 32px;
    margin-top: 64px;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 32px;
}
.contact-info h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
}
.contact-info p {
    font-size: 13px;
    line-height: 2.2;
}
.contact-info .remark {
    margin-top: 10px;
    color: #636e72;
    font-size: 12px;
}
.copyright {
    font-size: 12px;
    color: #636e72;
    align-self: flex-end;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-detail { grid-template-columns: 1fr; gap: 28px; }
    .product-info-detail h1 { font-size: 22px; }
    .price-box .price { font-size: 26px; }
    .drawer { width: 100vw; max-width: 100vw; }
    .container { padding: 0 16px; }
    .site-header .container { height: 56px; gap: 10px; }
    .logo { font-size: 18px; }
    .header-logo-img { height: 32px; }
    .header-logo-text { font-size: 18px; }
    .header-search { max-width: none; }
    .header-search-input { padding: 7px 12px; font-size: 13px; }
    .lang-label { display: none; }
    .lang-btn, .cat-btn { padding: 8px 10px; }
    .lang-btn span, .cat-btn span { display: none; }
    .carousel { aspect-ratio: 16 / 6; border-radius: var(--radius-sm); margin-bottom: 16px; }
    .carousel-arrow { width: 32px; height: 32px; }
    .carousel-prev { left: 8px; }
    .carousel-next { right: 8px; }
    .carousel-dots { bottom: 10px; gap: 6px; }
    .carousel-dot { width: 8px; height: 8px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .product-info { padding: 10px 12px 12px; }
    .product-name { font-size: 13px; }
    .product-price { font-size: 15px; }
    .carousel { aspect-ratio: 3 / 1; border-radius: 8px; margin-bottom: 14px; }
    .carousel-arrow { width: 28px; height: 28px; }
    .carousel-prev { left: 6px; }
    .carousel-next { right: 6px; }
}
