/* AI Product Page Styles
   Reference: https://0908codexelaine.vercel.app/products/em9501-tactical-combat-shirt
   All values extracted from the actual reference page CSS.
*/

.ai-dark-theme-wrapper {
    /* CSS Variables - exact values from reference page */
    --bg: #070a0c;
    --panel: #0d1114;
    --surface: #0d151b;
    --page-bg: #081016;
    --line: #293138;
    --line-dark: #28343b;
    --muted: #9ca7af;
    --white: #f7f9fa;
    --blue: #087cff;
    --blue-dark: #075cc3;
    --blue-active: #458dff;

    /* Section-specific colors */
    --spec-border: #39444b;
    --spec-dt-bg: #2d3941;
    --spec-dd-color: #aab4ba;
    --spec-dt-color: #d8dfe3;
    --func-bg: #0a1116;
    --func-border: #35434b;
    --detail-bg: #ececea;
    --detail-border: #34434c;
    --size-bg: #091015;
    --size-border: #34434c;
    --table-border: #2b3740;
    --table-th-bg: #122432;
    --table-td-color: #9ca8af;
    --table-th-color: #ecf1f4;
    --color-opt-bg: #090e12;
    --color-opt-border: #46525b;
    --thumb-bg: #f3f3f1;
    --thumb-border: #4b555d;
    --main-img-bg: #f4f4f2;
    --main-img-border: #727b81;

    --max-width: 1220px;

    background-color: var(--page-bg);
    color: var(--white);
    font-family: Inter, Arial, sans-serif;
    line-height: 1.5;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Page Shell ========== */
.ai-dark-theme-wrapper{
    margin: 0 auto;
    padding: 40px 0;
}

.ai-dark-theme-wrapper .page-shell {
    width: min(var(--max-width), 100% - 48px);
    margin-inline: auto;
}

@media (max-width: 768px) {
    .ai-dark-theme-wrapper .page-shell {
        width: min(100% - 30px, var(--max-width));
    }
}

/* ========== Hero / Buy Grid ========== */
.ai-dark-theme-wrapper .product-buy-grid {
    display: grid;
    grid-template-columns: 1.22fr .9fr;
    gap: 42px;
    padding-bottom: 34px;
}

@media (max-width: 900px) {
    .ai-dark-theme-wrapper .product-buy-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Product Gallery ========== */
.ai-dark-theme-wrapper .product-gallery {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Main Image Slider */
.ai-dark-theme-wrapper .product-main-slider-wrap {
    position: relative;
    background: var(--main-img-bg);
    border: 1px solid var(--main-img-border);
    min-height: 440px;
    overflow: hidden;
}

@media (max-width: 900px) {
    .ai-dark-theme-wrapper .product-main-slider-wrap {
        min-height: 390px;
    }
}

.ai-dark-theme-wrapper .product-main-slider {
    width: 100%;
    height: 100%;
    min-height: 440px;
}

@media (max-width: 900px) {
    .ai-dark-theme-wrapper .product-main-slider {
        min-height: 390px;
    }
}

.ai-dark-theme-wrapper .product-main-slider .main-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-dark-theme-wrapper .product-main-slider .main-slide img {
    object-fit: contain;
    padding: 16px;
    width: 100%;
    height: 100%;
}

/* Main Slider Arrows */
.ai-dark-theme-wrapper .main-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.ai-dark-theme-wrapper .main-slider-arrow:hover {
    background: var(--blue);
}

.ai-dark-theme-wrapper .main-slider-prev {
    left: 8px;
}

.ai-dark-theme-wrapper .main-slider-next {
    right: 8px;
}

/* bxSlider overrides for main slider */
.ai-dark-theme-wrapper .product-main-slider-wrap .bx-wrapper {
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.ai-dark-theme-wrapper .product-main-slider-wrap .bx-controls-direction a {
    display: none;
}

/* Thumbnails - 水平排列 (Grid) */
.ai-dark-theme-wrapper .product-thumbnails {
    margin-top: 12px;
}

/* Override bxSlider styles to ensure horizontal layout */
.ai-dark-theme-wrapper .product-thumbnails .small_img_list {
    width: 100%;
}

.ai-dark-theme-wrapper .product-thumbnails .small_img_list .bx-wrapper {
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    position: static !important;
}

.ai-dark-theme-wrapper .product-thumbnails .small_img_list .bx-viewport {
    height: auto !important;
    overflow: visible !important;
    min-height: 0 !important;
}

.ai-dark-theme-wrapper .product-thumbnails .small_img_list .bx-controls {
    display: none !important;
}

.ai-dark-theme-wrapper .product-thumbnails .small_img_list .list {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 768px) {
    .ai-dark-theme-wrapper .product-thumbnails .small_img_list .list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .ai-dark-theme-wrapper .product-thumbnails .small_img_list .list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.ai-dark-theme-wrapper .ai-thumb {
    cursor: pointer;
    background: var(--thumb-bg);
    border: 1px solid var(--thumb-border);
    position: relative;
    overflow: hidden;
    padding: 0;
    border-radius: 0;
    transition: border-color 0.2s;
    width: 100%;
    height: auto;
    display: block;
}

.ai-dark-theme-wrapper .ai-thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.ai-dark-theme-wrapper .ai-thumb:hover {
    border-color: var(--blue-active);
}

.ai-dark-theme-wrapper .ai-thumb.active {
    border: 2px solid var(--blue-active);
}

/* bxSlider thumbnail overrides */
.ai-dark-theme-wrapper .small_img_list .bx-wrapper {
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.ai-dark-theme-wrapper .small_img_list .bx-controls-direction a {
    display: none;
}

/* ========== Product Configurator ========== */
.ai-dark-theme-wrapper .product-configurator {
    padding: 12px 0 0;
    min-width: 0;
}

/* Title - Oswald font, uppercase */
.ai-dark-theme-wrapper .ai-title {
    letter-spacing: -.035em;
    text-transform: uppercase;
    margin: .45rem 0 .7rem;
    font: 600 clamp(2.45rem, 3.5vw, 3.2rem) / .98 Oswald, 'Inter', sans-serif;
    color: var(--white) !important;
}

@media (max-width: 900px) {
    .ai-dark-theme-wrapper .ai-title {
        font-size: 3rem;
    }
}

/* Description */
.ai-dark-theme-wrapper .ai-desc {
    color: var(--muted);
    margin-bottom: 0;
    font-size: .85rem;
    line-height: 1.6;
}

/* Config Block */
.ai-dark-theme-wrapper .config-block {
    margin-top: 1.2rem;
}

/* Variable Groups */
.ai-dark-theme-wrapper .ai-var-group {
    margin-bottom: 1rem;
}

.ai-dark-theme-wrapper .ai-var-label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ai-dark-theme-wrapper .ai-var-label span {
    color: var(--white);
    font-weight: 600;
    margin-left: 4px;
}

/* Color / Size Options Container */
.ai-dark-theme-wrapper .ai-color-options,
.ai-dark-theme-wrapper .ai-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Color Button (with image swatch) - 进一步缩小 */
.ai-dark-theme-wrapper .ai-color-btn {
    color: #dce2e6;
    text-align: left;
    cursor: pointer;
    background: var(--color-opt-bg);
    border: 1px solid var(--color-opt-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 2px;
    border-radius: 0;
    transition: border-color 0.2s;
    width: 40px;
    height: 40px;
    min-height: auto;
    font-size: .75rem;
    font-weight: 500;
    font-family: Inter, Arial, sans-serif;
}

.ai-dark-theme-wrapper .ai-color-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.ai-dark-theme-wrapper .ai-color-btn.active {
    border: 2px solid var(--blue-active);
}

.ai-dark-theme-wrapper .ai-color-btn:hover {
    border-color: var(--blue-active);
}

/* Size Button (text only) */
.ai-dark-theme-wrapper .ai-size-btn {
    padding: 0;
    background: var(--color-opt-bg);
    border: 1px solid var(--color-opt-border);
    color: var(--white);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 42px;
    font-size: .78rem;
    font-weight: 600;
    font-family: Inter, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.ai-dark-theme-wrapper .ai-size-btn.active {
    border: 2px solid var(--blue-active);
    color: #fff;
    background: #174c88;
    border-color: #4e9fff;
}

.ai-dark-theme-wrapper .ai-size-btn:hover {
    border-color: var(--blue-active);
}

/* ========== CTA Button ========== */
.ai-dark-theme-wrapper .button.primary {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    border: 1px solid transparent;
    justify-content: center;
    align-items: center;
    gap: .65rem;
    min-height: 46px;
    padding: .8rem 1.35rem;
    font-family: Oswald, sans-serif;
    font-weight: 600;
    font-size: .85rem;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    width: 100%;
    margin-top: 1.25rem;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    text-align: center;
    border-radius: 0;
}

.ai-dark-theme-wrapper .button.primary:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

/* Secondary Button (Catalog) */
.ai-dark-theme-wrapper .button.secondary {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    border: 1px solid var(--line);
    justify-content: center;
    align-items: center;
    gap: .65rem;
    min-height: 46px;
    padding: .8rem 1.35rem;
    font-family: Oswald, sans-serif;
    font-weight: 600;
    font-size: .85rem;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
    margin-top: .75rem;
    background: transparent;
    color: var(--white);
    text-decoration: none;
    text-align: center;
    border-radius: 0;
}

.ai-dark-theme-wrapper .button.secondary svg {
    flex-shrink: 0;
}

.ai-dark-theme-wrapper .button.secondary:hover {
    background: var(--panel);
    border-color: var(--blue);
}

/* ========== Product Surface (lower sections) ========== */
.ai-dark-theme-wrapper .product-surface {
    background: var(--surface);
}

/* ========== Product Section ========== */
.ai-dark-theme-wrapper .product-section {
    border-bottom: 1px solid var(--line-dark);
    padding-block: 24px;
}

/* Section Heading */
.ai-dark-theme-wrapper .product-section .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 1rem;
}

/* Section H2 titles - Oswald, uppercase */
.ai-dark-theme-wrapper .product-section h2 {
    text-transform: uppercase;
    letter-spacing: .01em;
    margin: .38rem 0 .9rem;
    font: 600 2rem / 1.03 Oswald, sans-serif;
    color: var(--white);
}

@media (max-width: 768px) {
    .ai-dark-theme-wrapper .product-section h2 {
        font-size: 1.6rem;
        margin: .26rem 0 .3rem;
    }
}

/* Section label (small uppercase above h2) */
.ai-dark-theme-wrapper .product-section .section-label {
    color: var(--blue);
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 4px;
}

/* ========== Specs Section ========== */
.ai-dark-theme-wrapper .spec-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .ai-dark-theme-wrapper .spec-tables {
        grid-template-columns: 1fr;
    }
}

.ai-dark-theme-wrapper .spec-tables dl {
    border: 1px solid var(--spec-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-block: 1.6rem;
}

.ai-dark-theme-wrapper .spec-tables dt {
    color: var(--spec-dt-color);
    text-transform: uppercase;
    border-right: 1px solid var(--spec-border);
    border-bottom: 1px solid var(--spec-border);
    font-weight: 600;
    padding: .72rem .9rem;
    font-size: .73rem;
    background: var(--spec-dt-bg);
}

.ai-dark-theme-wrapper .spec-tables dd {
    padding: .72rem .9rem;
    font-size: .73rem;
    color: var(--spec-dd-color);
    margin: 0;
    border-bottom: 1px solid var(--spec-border);
    border-right: 1px solid var(--spec-border);
}

/* ========== Function Grid ========== */
.ai-dark-theme-wrapper .urban-function-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 1024px) {
    .ai-dark-theme-wrapper .urban-function-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ai-dark-theme-wrapper .urban-function-grid {
        grid-template-columns: 1fr;
    }
}

.ai-dark-theme-wrapper .urban-function-grid article {
    background: var(--func-bg);
    border: 1px solid var(--func-border);
    min-height: 180px;
    padding: 20px;
    border-radius: 0;
    transition: transform 0.2s;
}

.ai-dark-theme-wrapper .urban-function-grid article:hover {
    transform: translateY(-2px);
}

.ai-dark-theme-wrapper .urban-function-grid img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0;
    margin-bottom: 0;
}

.ai-dark-theme-wrapper .urban-function-grid h3 {
    text-transform: uppercase;
    margin: 1.2rem 0 .7rem;
    font: 600 1.05rem / 1.15 Oswald, sans-serif;
    color: var(--white);
    padding: 0;
}

.ai-dark-theme-wrapper .urban-function-grid p {
    color: #89969e;
    font-size: .68rem;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.ai-dark-theme-wrapper .feature-caption {
    display: block;
    color: var(--white);
    font-size: 1.05rem;
    font-family: Oswald, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 1.2rem;
    padding: 0;
    letter-spacing: -.02em;
}

.ai-dark-theme-wrapper .feature-caption::before {
    content: attr(data-filename);
}

/* ========== Size Chart ========== */
.ai-dark-theme-wrapper .urban-size-scroll {
    scrollbar-color: #4e91e8 #11191f;
    overflow-x: auto;
}

.ai-dark-theme-wrapper .urban-size-scroll table {
    border-collapse: collapse;
    width: 100%;
    min-width: 760px;
    font-size: .73rem;
    border: 1px solid var(--spec-border);
}

.ai-dark-theme-wrapper .urban-size-scroll th {
    color: var(--spec-dt-color);
    text-transform: uppercase;
    background: var(--spec-dt-bg);
    font-family: Oswald, sans-serif;
    font-weight: 600;
    padding: .72rem .9rem;
    text-align: center;
    border-bottom: 1px solid var(--spec-border);
    border-right: 1px solid var(--spec-border);
    font-size: .73rem;
}

.ai-dark-theme-wrapper .urban-size-scroll th:first-child {
    color: var(--spec-dt-color);
    text-align: left;
    background: var(--spec-dt-bg);
    min-width: 160px;
    position: sticky;
    left: 0;
    z-index: 1;
}

.ai-dark-theme-wrapper .urban-size-scroll td {
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid var(--spec-border);
    border-right: 1px solid var(--spec-border);
    min-width: 74px;
    padding: .72rem .9rem;
    color: var(--spec-dd-color);
    font-size: .73rem;
}

.ai-dark-theme-wrapper .urban-size-scroll td:first-child {
    color: var(--spec-dt-color);
    text-align: left;
    background: var(--spec-dt-bg);
    min-width: 160px;
    position: sticky;
    left: 0;
    z-index: 1;
    font-weight: 600;
}

/* ========== Detail Image Grid ========== */
.ai-dark-theme-wrapper .urban-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 1024px) {
    .ai-dark-theme-wrapper .urban-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ai-dark-theme-wrapper .urban-detail-grid {
        grid-template-columns: 1fr;
    }
}

.ai-dark-theme-wrapper .urban-detail-grid figure {
    background: var(--detail-bg);
    border: 1px solid var(--detail-border);
    margin: 0;
    border-radius: 0;
    overflow: hidden;
}

.ai-dark-theme-wrapper .urban-detail-grid figure img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s;
}

.ai-dark-theme-wrapper .urban-detail-grid figure:hover img {
    transform: scale(1.02);
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .ai-dark-theme-wrapper .product-gallery {
        position: static;
    }

    .ai-dark-theme-wrapper .product-main-slider,
    .ai-dark-theme-wrapper .product-main-slider-wrap {
        min-height: 390px;
    }
}

@media (max-width: 768px) {
    .ai-dark-theme-wrapper .product-section {
        padding-block: 18px;
    }

    .ai-dark-theme-wrapper .spec-tables dl {
        grid-template-columns: 1fr;
    }

    .ai-dark-theme-wrapper .spec-tables dt {
        border-right: none;
        border-bottom: 1px solid var(--spec-border);
    }
}
