/* ==========================================================================
   ace6t.css —— 联名定制机详情页：面包屑、图库、购买信息、规格选项卡、
                 开箱礼盒、吸底购买栏
   ========================================================================== */

body.page-product #main {
    padding-top: var(--header-h);
}

/* ---------------- 面包屑 ---------------- */
.breadcrumb {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-block: 14px;
    font-size: 12.5px;
    color: var(--muted);
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb li + li::before {
    content: "/";
    color: var(--muted-light);
}

.breadcrumb a {
    transition: color 0.25s var(--ease);
}

.breadcrumb a:hover {
    color: var(--brand);
}

.breadcrumb [aria-current="page"] {
    color: var(--ink);
}

/* ---------------- 商品主区 ---------------- */
.product {
    padding-block: clamp(24px, 3vw, 40px) clamp(56px, 7vw, 96px);
    background: #fff;
}

.product-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}

/* 图库 */
.product-gallery {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.gallery-main {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ice-200);
    border-radius: var(--radius-l);
    background:
        radial-gradient(600px 420px at 70% 18%, rgba(255, 255, 255, 0.95), transparent 68%),
        linear-gradient(160deg, var(--ice-50), var(--ice-100) 58%, #e2edfb);
}

.gallery-main::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../images/decor/seigaiha.svg") repeat;
    background-size: 140px 70px;
    opacity: 0.28;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 85%);
    mask-image: radial-gradient(circle at 50% 50%, transparent 30%, #000 85%);
    pointer-events: none;
}

.gallery-main img {
    position: absolute;
    top: clamp(18px, 3.4vw, 44px);
    left: clamp(18px, 3.4vw, 44px);
    z-index: 1;
    width: calc(100% - 2 * clamp(18px, 3.4vw, 44px));
    height: calc(100% - 2 * clamp(18px, 3.4vw, 44px));
    max-width: none;
    object-fit: contain;
    filter: drop-shadow(0 24px 36px rgba(22, 50, 79, 0.18));
    transition: opacity 0.28s var(--ease), transform 0.5s var(--ease);
}

.gallery-main.is-switching img {
    opacity: 0;
    transform: scale(0.97);
}

.gallery-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    font-size: 10.5px;
    letter-spacing: 0.16em;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--ice-50);
    opacity: 0.68;
    transition: opacity 0.3s var(--ease), border-color 0.3s var(--ease),
                box-shadow 0.3s var(--ease);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb:hover {
    opacity: 1;
}

.thumb.is-active {
    opacity: 1;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(22, 50, 79, 0.08);
}

/* 购买信息 */
.product-info {
    padding-top: 4px;
}

.product-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--brand);
}

.product-title {
    margin: 14px 0 8px;
    font-family: var(--font-serif);
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: 0.02em;
    color: var(--navy-deep);
}

.product-title span {
    display: block;
    margin-top: 6px;
    font-size: 0.58em;
    letter-spacing: 0.06em;
    color: #4d647c;
}

.product-subtitle {
    font-size: 13.5px;
    color: var(--muted);
}

.product-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--muted);
}

.stars {
    color: #e9a13b;
    letter-spacing: 1px;
}

.price-block {
    margin-top: 24px;
    padding-block: 20px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.price {
    font-size: clamp(32px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.1;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.price-note {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.option-group {
    display: grid;
    gap: 22px;
    margin-top: 26px;
}

.option-row {
    display: grid;
    gap: 10px;
}

.option-label {
    font-size: 12.5px;
    letter-spacing: 0.08em;
    color: var(--muted);
}

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

.option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    font-size: 13.5px;
    color: #333a44;
    transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease),
                color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.option:hover {
    border-color: var(--ink-soft);
}

.option.is-active {
    border-color: var(--navy);
    background: var(--ice-50);
    color: var(--navy);
    box-shadow: inset 0 0 0 1px var(--navy);
    font-weight: 600;
}

.option-price {
    font-size: 11px;
    font-weight: 400;
    color: var(--brand);
}

.buy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.buy-actions .btn {
    flex: 1 1 180px;
}

.service-list {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.service-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4a5260;
}

.service-list svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--navy);
}

.stock-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    font-size: 12.5px;
    color: var(--muted);
}

.stock-note .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f9e6f;
    box-shadow: 0 0 0 0 rgba(47, 158, 111, 0.4);
    animation: pulse 2.2s infinite;
}

.stock-note strong {
    color: var(--ink);
    font-weight: 600;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(47, 158, 111, 0.36); }
    70%  { box-shadow: 0 0 0 8px rgba(47, 158, 111, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 158, 111, 0); }
}

/* ---------------- 规格参数 ---------------- */
.specs {
    background: var(--paper-2);
}

.spec-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: start;
}

.spec-tabs {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-tab {
    padding: 12px 16px;
    border-left: 2px solid transparent;
    border-radius: 0 10px 10px 0;
    text-align: left;
    font-size: 14px;
    color: #4a5260;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
                border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.spec-tab:hover {
    background: rgba(22, 50, 79, 0.05);
}

.spec-tab.is-active {
    border-left-color: var(--brand);
    background: #fff;
    color: var(--navy);
    font-weight: 600;
    box-shadow: var(--shadow-s);
}

.spec-panels {
    min-height: 340px;
    padding: clamp(22px, 3vw, 40px);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    background: #fff;
}

.spec-panel[hidden] {
    display: none;
}

.spec-panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.spec-panel-title span {
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.14em;
    color: var(--muted-light);
}

.spec-list {
    display: grid;
}

.spec-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    padding-block: 14px;
    border-bottom: 1px dashed var(--line);
}

.spec-item:last-child {
    border-bottom: 0;
}

.spec-item dt {
    font-size: 13px;
    color: var(--muted);
}

.spec-item dd {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.7;
    color: #2b3440;
}

/* ---------------- 开箱礼盒 ---------------- */
.gift {
    background: #fff;
}

.gift-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
}

.gift-figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--ice-200);
    border-radius: var(--radius-l);
    background: var(--ice-50);
    box-shadow: var(--shadow-s);
}

.gift-figure img {
    width: 100%;
    object-fit: cover;
}

.gift-figure figcaption {
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.gift-list {
    margin: 24px 0 30px;
}

.gift-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-block: 13px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: #38424f;
}

.gift-list li span {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

/* ---------------- 吸底购买栏 ---------------- */
.buybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px rgba(16, 32, 56, 0.08);
    transform: translateY(110%);
    transition: transform 0.45s var(--ease);
}

.buybar.is-visible {
    transform: none;
}

.buybar-inner {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    max-width: 1280px;
    margin-inline: auto;
    padding: 10px clamp(20px, 4vw, 40px);
}

.buybar-product {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.buybar-product img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.buybar-name {
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buybar-spec {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.buybar-price {
    margin-left: auto;
    font-size: 24px;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.buybar-actions {
    display: flex;
    gap: 10px;
}

.buybar-actions .btn {
    height: 42px;
    padding: 0 22px;
    font-size: 13px;
}

/* ---------------- 购物车按钮（导航栏） ---------------- */
.cart-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #3a3f47;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.cart-btn:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.cart-btn svg {
    width: 21px;
    height: 21px;
}

.cart-count {
    position: absolute;
    top: 1px;
    right: -1px;
    min-width: 16px;
    height: 16px;
    padding-inline: 4px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    transform: scale(0);
    transition: transform 0.28s var(--ease);
}

.cart-count.is-visible {
    transform: scale(1);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
    .buybar-name {
        max-width: 240px;
    }
}

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

    .product-gallery {
        position: static;
        max-width: 620px;
        margin-inline: auto;
        width: 100%;
    }

    .gift-inner {
        grid-template-columns: 1fr;
    }

    .gallery-main {
        aspect-ratio: 4 / 3.4;
    }
}

@media (max-width: 760px) {
    .spec-layout {
        grid-template-columns: 1fr;
    }

    .spec-tabs {
        position: static;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .spec-tabs::-webkit-scrollbar {
        display: none;
    }

    .spec-tab {
        flex-shrink: 0;
        border-left: 0;
        border-radius: 999px;
        background: #fff;
        border: 1px solid var(--line);
        padding: 9px 16px;
        font-size: 13px;
    }

    .spec-tab.is-active {
        border-color: var(--navy);
        color: var(--navy);
        box-shadow: none;
    }

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

    .spec-panels {
        min-height: 0;
        padding: 20px;
    }

    .buybar-product img {
        display: none;
    }

    .buybar-name {
        max-width: 42vw;
        font-size: 12.5px;
    }

    .buybar-spec {
        display: none;
    }

    .buybar-price {
        font-size: 19px;
    }

    .buybar-actions .btn {
        height: 40px;
        padding: 0 14px;
        font-size: 12px;
    }

    .product-gallery {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .gallery-badge {
        display: none;
    }

    .gallery-main {
        aspect-ratio: 1 / 1;
        border-radius: var(--radius-m);
    }

    .thumb {
        border-radius: 10px;
    }

    .product-title {
        font-size: 30px;
    }

    .buy-actions .btn {
        flex: 1 1 100%;
    }

    .buybar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .buybar-inner {
        gap: 10px;
        padding: 8px 14px;
    }

    .buybar-product {
        flex: 1;
        min-width: 0;
    }

    .buybar-name {
        max-width: 40vw;
    }

    .buybar-actions .btn:first-child {
        display: none;
    }

    .buybar-price {
        font-size: 17px;
    }
}
