/* aweb3 product detail — Ali-style layout (from 9美妆源码) */

.page-product-detail {
    padding: 0 0 0;
    background: #fff;
}

.pd-breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.pd-breadcrumb-bar .container {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.section-detail {
    padding-bottom: 2rem;
}

.ali-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: #6b7280;
}

.ali-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.ali-breadcrumb a:hover {
    color: #c8102e;
}

.ali-breadcrumb-sep {
    color: #d1d5db;
}

.pd-top,
.ali-pd-top {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 28px;
    align-items: start;
    padding-top: 1.5rem;
}

.ali-left-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ali-gallery-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ali-thumbs-h {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ali-thumb-h {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: #fff;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ali-thumb-h img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.ali-thumb-h.active,
.ali-thumb-h:hover {
    border-color: #111827;
    box-shadow: 0 0 0 1px #111827;
}

.ali-stage {
    position: relative;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    max-height: 520px;
}

.ali-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 16px;
    box-sizing: border-box;
    background: #fff;
}

.ali-stage-tools {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.ali-stage-tool {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: background 0.15s ease;
}

.ali-stage-tool:hover {
    background: #fff;
    color: #c8102e;
}

.ali-stage-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.ali-stage-nav--prev {
    left: 12px;
}

.ali-stage-nav--next {
    right: 12px;
}

.ali-stage-nav:hover {
    color: #c8102e;
}

.ali-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ali-zoom-modal[hidden] {
    display: none !important;
}

.ali-zoom-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.ali-zoom-content {
    position: relative;
    max-width: min(90vw, 900px);
    max-height: 90vh;
    z-index: 1;
}

.ali-zoom-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.ali-zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
}

.ali-buy-box {
    padding: 4px 0 0;
}

.ali-brand {
    margin: 0 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.ali-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.625rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    font-family: "Playfair Display", Georgia, serif;
}

.ali-meta-row {
    margin-top: 10px;
    font-size: 0.8125rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ali-meta-dot {
    color: #d1d5db;
}

.ali-cat-link {
    color: #1e3a8a;
    text-decoration: none;
}

.ali-cat-link:hover {
    text-decoration: underline;
}

.ali-price-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 16px;
    margin: 20px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.ali-tier-price {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    color: #c8102e;
    line-height: 1.1;
}

.ali-tier-range {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

.ali-qty-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ali-qty-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    min-width: 60px;
}

.ali-qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.ali-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f9fafb;
    color: #374151;
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ali-qty-btn:hover {
    background: #f3f4f6;
}

.ali-qty-input {
    width: 56px;
    height: 36px;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 600;
    -moz-appearance: textfield;
}

.ali-qty-input::-webkit-outer-spin-button,
.ali-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ali-qty-hint {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.ali-attrs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ali-attr-box {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 14px;
}

.ali-attr-key {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.ali-attr-val {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.ali-glance {
    margin-bottom: 20px;
}

.ali-glance-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
}

.ali-glance-list {
    margin: 0;
    padding-left: 1.125rem;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.7;
}

.ali-glance-list li + li {
    margin-top: 4px;
}

.ali-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.product-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-badge--green {
    background: #dcfce7;
    color: #15803d;
}

.product-badge--blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.product-badge--emerald {
    background: #d1fae5;
    color: #047857;
}

.ali-order-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 24px !important;
    font-size: 1rem !important;
    box-sizing: border-box;
}

.ali-order-note {
    margin: 10px 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.pd-subline {
    margin: 8px 0 16px;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
}

.pd-muted {
    color: #6b7280;
}

.pd-bottom {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.pd-anchor-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 14px;
    margin: 20px 0 0;
    position: sticky;
    top: 64px;
    z-index: 19;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(200, 16, 46, 0.06);
}

.pd-anchor-nav a {
    font-size: 0.84rem;
    font-weight: 600;
    color: #6b7280;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pd-anchor-nav a:hover {
    color: #c8102e;
}

.pd-anchor-nav a.active {
    color: #c8102e;
    background: rgba(200, 16, 46, 0.06);
    border-color: #c8102e;
}

.pd-module {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(200, 16, 46, 0.04);
    padding: 16px;
}

.pd-module[id] {
    scroll-margin-top: 120px;
}

.pd-module h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.pd-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pd-spec-table th,
.pd-spec-table td {
    border-top: 1px solid #e5e7eb;
    padding: 9px 8px;
    text-align: left;
}

.pd-spec-table th {
    width: 230px;
    color: #6b7280;
    font-weight: 700;
}

.pd-pack-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #374151;
    line-height: 1.8;
}

.pd-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pd-detail-grid img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.pd-calculator {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.pd-calculator-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
}

.pd-calculator-fields--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pd-calculator-fields > div {
    padding: 16px;
    border-right: 1px solid #e5e7eb;
}

.pd-calculator-fields > div:last-child {
    border-right: none;
}

.pd-calculator-fields label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.pd-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9375rem;
    box-sizing: border-box;
}

.pd-input:focus {
    outline: none;
    border-color: #c8102e;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.pd-calculator-result {
    background: linear-gradient(135deg, #c8102e 0%, #1e3a8a 100%);
    color: #fff;
    text-align: center;
    padding: 24px 16px;
}

.pd-calculator-label {
    margin: 0 0 4px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.pd-calculator-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.pd-calculator-sub {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
}

.product-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.related-section--ali {
    padding: 3.5rem 0 4rem;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
}

.related-section__head {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.related-section__sub {
    margin: 0.35rem 0 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.related-section__all {
    color: #c8102e;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    align-self: flex-start;
}

.related-section__all:hover {
    text-decoration: underline;
}

@media (min-width: 640px) {
    .related-section__head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

@media (max-width: 1020px) {
    .pd-top,
    .ali-pd-top {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .ali-stage {
        max-height: 400px;
    }

    .ali-attrs {
        grid-template-columns: 1fr;
    }

    .pd-anchor-nav {
        top: 64px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .pd-anchor-nav a {
        flex: 0 0 auto;
    }

    .pd-detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pd-calculator-fields {
        grid-template-columns: 1fr;
    }

    .pd-calculator-fields > div {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .pd-calculator-fields > div:last-child {
        border-bottom: none;
    }
}

@media (max-width: 720px) {
    .ali-price-tiers {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pd-detail-grid {
        grid-template-columns: 1fr;
    }
}
