/**
 * ============================================================
 * CtrlEat Official Shopping Website
 * ============================================================
 * CtrlEat 正式版购物网站
 * 版权归天河星雨工作室[thxymc Studio] thxymc.com所有
 * Copyright © 2026 thxymc.com. All rights reserved.
 * 网页由天河星雨工作室制作 thxymc.com
 * ！！未经允许禁止公开源码！！
 * ============================================================
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 8% 8%, rgba(34, 197, 94, 0.12), transparent 30%),
        radial-gradient(circle at 92% 10%, rgba(59, 130, 246, 0.10), transparent 30%),
        #f5f7fb;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.product-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: 68px;
    padding: 0 5vw;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-logo {
    color: #16a34a;
    font-size: 1.5rem;
    font-weight: 1000;
    text-decoration: none;
}

.product-nav {
    display: flex;
    gap: 1rem;
}

.product-nav a {
    color: #334155;
    text-decoration: none;
    font-weight: 900;
}

.product-nav a:hover {
    color: #16a34a;
}

.product-page {
    flex: 1;
    width: min(1180px, 92vw);
    margin: 28px auto 60px;
}

.product-detail-card,
.product-description-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 30px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.product-detail-card {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1fr);
    gap: 28px;
    padding: 26px;
    align-items: start;
}

.product-gallery {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 14px;
}

.main-product-image {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(59, 130, 246, 0.08)),
        #eef2f7;
    aspect-ratio: 1 / 0.88;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-image-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-image-thumbs button {
    width: 66px;
    height: 66px;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.product-image-thumbs button.active {
    border-color: #22c55e;
}

.product-image-thumbs img {
    width: 100%;
    height: 100%;
    border-radius: 13px;
    object-fit: contain;
    display: block;
}

.product-main {
    min-width: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-bottom: 14px;
    color: #64748b;
    font-weight: 800;
}

.breadcrumb a {
    color: #16a34a;
    text-decoration: none;
    font-weight: 1000;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.product-tags span {
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.82rem;
    font-weight: 1000;
    display: inline-flex;
    align-items: center;
}

.product-tags span.discount {
    background: #fff7ed;
    color: #c2410c;
}

.product-tags span[style] {
    color: #fff;
}

.product-tags span.muted {
    background: #f1f5f9;
    color: #64748b;
}

.product-main h1 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: clamp(2rem, 4.8vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.product-subtitle {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 1.02rem;
    line-height: 1.8;
    font-weight: 700;
}

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.product-info-grid div {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
}

.product-info-grid span {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 800;
}

.product-info-grid strong {
    color: #0f172a;
    font-size: 1rem;
}

.price-box {
    margin: 18px 0;
    padding: 18px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04));
    color: #16a34a;
    display: grid;
    gap: 6px;
}

.price-box strong {
    font-size: 1.75rem;
    font-weight: 1000;
}

.price-box del {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 900;
}

.price-box small {
    color: #ea580c;
    font-weight: 1000;
}

.buy-panel {
    margin-top: 22px;
}

.buy-panel h2,
.product-description-card h2 {
    margin: 0 0 16px;
    font-size: 1.28rem;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.spec-option {
    position: relative;
    min-height: 112px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    transition: 0.16s ease;
}

.spec-option:hover {
    border-color: #86efac;
    background: #f7fef9;
}

.spec-option.active {
    border-color: #22c55e;
    background: #f0fdf4;
    box-shadow: 0 14px 28px rgba(34, 197, 94, 0.12);
}

.spec-option.disabled {
    opacity: 0.52;
    cursor: not-allowed;
    background: #f8fafc;
}

.spec-option strong,
.spec-option span,
.spec-option em,
.spec-option small {
    display: block;
}

.spec-option strong {
    margin-bottom: 7px;
    font-size: 1rem;
}

.spec-option span {
    color: #16a34a;
    font-weight: 1000;
}

.spec-option em {
    margin-top: 7px;
    color: #64748b;
    font-style: normal;
    font-size: 0.88rem;
    font-weight: 800;
}

.spec-option small {
    margin-top: 6px;
    color: #ea580c;
    font-weight: 900;
}

.spec-tag-row {
    margin-top: 7px;
    display: flex !important;
    flex-wrap: wrap;
    gap: 5px;
}

.spec-tag-row i {
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    font-size: .72rem;
    font-style: normal;
    font-weight: 1000;
    display: inline-flex;
    align-items: center;
}

.pay-mode-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 20px;
    background: #f8fafc;
}

.pay-mode-box h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.pay-mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pay-mode {
    min-width: 110px;
    height: 42px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 1000;
    cursor: pointer;
}

.pay-mode.active {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.pay-mode.disabled,
.pay-mode:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #64748b;
    border-color: #e2e8f0;
}

.pay-mode-box p {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.7;
    font-weight: 700;
}

.quantity-row {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.quantity-row > span {
    color: #334155;
    font-weight: 1000;
}

.qty-control {
    display: inline-grid;
    grid-template-columns: 42px 72px 42px;
    gap: 8px;
    align-items: center;
}

.qty-control button,
.qty-control input {
    height: 42px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    background: #fff;
    text-align: center;
    font-size: 1rem;
    font-weight: 1000;
}

.qty-control button {
    cursor: pointer;
    color: #16a34a;
}

.qty-control button:hover {
    background: #dcfce7;
}

.qty-control input {
    outline: none;
    color: #0f172a;
}

.add-cart-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
    border: 0;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    box-shadow: 0 16px 32px rgba(22, 163, 74, 0.24);
    font-size: 1.05rem;
    font-weight: 1000;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-cart-btn:hover {
    background: #15803d;
}

.add-cart-btn.disabled,
.add-cart-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.add-cart-btn.login-link {
    background: #0ea5e9;
    box-shadow: 0 16px 32px rgba(14, 165, 233, 0.20);
}

.product-description-card {
    margin-top: 20px;
    padding: 24px;
}

.description-content {
    color: #334155;
    line-height: 1.9;
    font-weight: 700;
}

.empty-description {
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 800;
}

.site-footer {
    width: min(1180px, 92vw);
    margin: 0 auto 22px;
    padding: 18px 10px;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.8;
}

.site-footer a {
    color: #16a34a;
    font-weight: 900;
    text-decoration: none;
}

@media (max-width: 980px) {
    .product-detail-card {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        position: static;
    }

    .main-product-image {
        aspect-ratio: 1 / 0.72;
    }
}

@media (max-width: 680px) {
    .product-topbar {
        height: auto;
        min-height: 64px;
        padding: 12px 4vw;
    }

    .product-logo {
        font-size: 1.22rem;
    }

    .product-nav {
        gap: 0.55rem;
    }

    .product-nav a {
        font-size: 0.78rem;
    }

    .product-page {
        width: 94vw;
        margin-top: 16px;
    }

    .product-detail-card,
    .product-description-card {
        border-radius: 22px;
    }

    .product-detail-card {
        padding: 16px;
        gap: 18px;
    }

    .product-info-grid,
    .spec-grid {
        grid-template-columns: 1fr;
    }

    .price-box {
        font-size: 1.35rem;
    }

    .quantity-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .qty-control {
        width: 100%;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
    }
}

.product-alert {
    margin: 0 0 16px;
    padding: 13px 15px;
    border-radius: 16px;
    line-height: 1.6;
    font-weight: 900;
}

.product-alert.error {
    background: #fef2f2;
    color: #dc2626;
}

.product-alert.success {
    background: #f0fdf4;
    color: #15803d;
}

.product-expiry-notice {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 12px;
    margin: 10px 0 0;
}

.product-expiry-notice[hidden] {
    display: none;
}

.main-product-image img[data-lightbox-image="1"] {
    cursor: zoom-in;
}

.product-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.82);
}

.product-lightbox.show {
    display: flex;
}

.product-lightbox img {
    max-width: min(96vw, 1100px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    background: #fff;
}

.product-lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
    .product-lightbox {
        padding: 12px;
    }

    .product-lightbox img {
        max-width: 96vw;
        max-height: 82vh;
        border-radius: 12px;
    }

    .product-lightbox-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }
}
.product-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-size: 32px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.product-lightbox-prev {
    left: 18px;
}

.product-lightbox-next {
    right: 18px;
}

.product-lightbox-nav[hidden] {
    display: none;
}

@media (max-width: 640px) {
    .product-lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 26px;
    }

    .product-lightbox-prev {
        left: 10px;
    }

    .product-lightbox-next {
        right: 10px;
    }
}