/**
 * SMTBOX Single Product Detail Component - Version 3.0 Production Specification
 * File: css/components/single-product.css
 * W3C Canonical 8-Tier Cascade Layer Hierarchy (Tier 6: components)
 * Specificity Target: :is(#wrapper, body).single-product (Tier-Protected)
 * Proof Marker: Stan (已讀 md、非臆測)
 * Strict Zero-Important Guarantee & Zero-Regression Architecture
 */

/* ==========================================================================
   1. Breadcrumbs & Page Header Geometry Lock
   ========================================================================== */

:is(#wrapper, body) .product-page-title,
:is(#wrapper, body) .shop-page-title.product-page-title {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--smt-space-sm, 12px) 0;
    box-sizing: border-box;
    background-color: var(--smt-color-slate-900, #0f172a);
    position: relative;
    z-index: var(--smt-z-base, 1);
}

:is(#wrapper, body) .product-page-title .page-title-inner {
    width: 100%;
    max-width: var(--smt-max-w-screen, 1200px);
    margin: 0 auto;
    padding: var(--smt-space-xs, 8px) var(--smt-space-md, 16px);
    box-sizing: border-box;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--smt-space-xs, 8px);
}

:is(#wrapper, body) .product-page-title :is(.catalog-breadcrumb, .breadcrumbs) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--smt-space-2xs, 4px) var(--smt-space-xs, 8px);
    font-family: var(--smt-font-sans, 'Inter', -apple-system, sans-serif);
    font-size: var(--smt-font-size-sm, 13px);
    line-height: var(--smt-line-height-normal, 1.5);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: var(--smt-font-weight-medium, 500);
    padding: 0;
    margin: 0;
}

:is(#wrapper, body) .product-page-title :is(.catalog-breadcrumb, .breadcrumbs) a {
    color: var(--smt-color-slate-300, #cbd5e1);
    text-decoration: none;
    transition: color var(--smt-transition-fast, 0.2s ease);
}

:is(#wrapper, body) .product-page-title :is(.catalog-breadcrumb, .breadcrumbs) a:hover {
    color: var(--smt-color-white, #ffffff);
    text-decoration: underline;
}

:is(#wrapper, body) .product-page-title :is(.catalog-breadcrumb, .breadcrumbs) .divider {
    color: var(--smt-color-slate-500, #64748b);
    opacity: 0.8;
    margin: 0 var(--smt-space-3xs, 2px);
    user-select: none;
    display: inline-block;
}

:is(#wrapper, body) .product-page-title :is(.catalog-breadcrumb, .breadcrumbs) .current {
    color: var(--smt-color-slate-100, #f1f5f9);
    font-weight: var(--smt-font-weight-semibold, 600);
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

@media (max-width: 549px) {
    :is(#wrapper, body) .product-page-title :is(.catalog-breadcrumb, .breadcrumbs) .current {
        max-width: 220px;
    }
}

/* In-Summary Breadcrumb Placement (when rendered inside summary column) */
:is(#wrapper, body).single-product .product-summary :is(.catalog-breadcrumb, .breadcrumbs) {
    margin-bottom: var(--smt-space-sm, 12px);
    font-size: var(--smt-font-size-xs, 12px);
}

:is(#wrapper, body).single-product .product-summary :is(.catalog-breadcrumb, .breadcrumbs) a {
    color: var(--smt-color-link, #002780);
    text-decoration: none;
}

:is(#wrapper, body).single-product .product-summary :is(.catalog-breadcrumb, .breadcrumbs) a:hover {
    color: var(--smt-color-accent, #CF0921);
    text-decoration: underline;
}

:is(#wrapper, body).single-product .product-summary :is(.catalog-breadcrumb, .breadcrumbs) .divider {
    color: var(--smt-color-slate-400, #94a3b8);
}

/* ==========================================================================
   2. Main Grid Layout & Flex Containment
   ========================================================================== */

:is(#wrapper, body).single-product .product-main {
    margin-top: var(--smt-space-lg, 24px);
    margin-bottom: var(--smt-space-2xl, 40px);
    font-family: var(--smt-font-sans, 'Inter', sans-serif);
}

:is(#wrapper, body).single-product .product-main > .row.content-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-inline: -15px;
}

:is(#wrapper, body).single-product .product-gallery,
:is(#wrapper, body).single-product .product-info,
:is(#wrapper, body).single-product .product-summary {
    min-width: 0;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .product-gallery {
    flex: 0 0 50%;
    max-width: 50%;
    padding-inline: 15px;
    position: relative;
    width: 100%;
}

:is(#wrapper, body).single-product .product-info,
:is(#wrapper, body).single-product .product-summary {
    flex: 0 0 50%;
    max-width: 50%;
    padding-inline: 15px;
    position: relative;
    width: 100%;
}

@media (max-width: 849px) {
    :is(#wrapper, body).single-product .product-gallery,
    :is(#wrapper, body).single-product .product-info,
    :is(#wrapper, body).single-product .product-summary {
        flex: 0 0 100%;
        max-width: 100%;
        padding-inline: 0;
    }
    :is(#wrapper, body).single-product .product-gallery {
        margin-bottom: var(--smt-space-lg, 24px);
    }
}

/* ==========================================================================
   3. Summary Column & Typography
   ========================================================================== */

:is(#wrapper, body).single-product .sre-product-summary-box,
:is(#wrapper, body).single-product .smtbox-product-summary-box {
    background: var(--smt-color-white, #ffffff);
    border: 1px solid var(--smt-color-slate-200, #e2e8f0);
    border-radius: var(--smt-radius-lg, 12px);
    padding: var(--smt-space-lg, 24px);
    box-shadow: var(--smt-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

:is(#wrapper, body).single-product .product-title,
:is(#wrapper, body).single-product .sre-single-title,
:is(#wrapper, body).single-product .smtbox-single-title {
    font-family: var(--smt-font-brand, 'Outfit', sans-serif);
    font-size: var(--smt-font-size-fluid-2xl, clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem));
    font-weight: 800;
    color: var(--smt-color-slate-900, #0f172a);
    margin-top: 0;
    margin-bottom: var(--smt-space-sm, 12px);
    line-height: var(--smt-line-height-tight, 1.25);
    letter-spacing: -0.01em;
    word-break: break-word;
}

:is(#wrapper, body).single-product .product-short-description,
:is(#wrapper, body).single-product .product-short-description p {
    font-family: var(--smt-font-sans, 'Inter', sans-serif);
    font-size: var(--smt-font-size-base, 15px);
    line-height: var(--smt-line-height-relaxed, 1.6);
    color: var(--smt-color-slate-600, #475569);
    margin-top: 0;
    margin-bottom: var(--smt-space-md, 16px);
}

:is(#wrapper, body).single-product .product_meta {
    margin-top: var(--smt-space-md, 16px);
    padding-top: var(--smt-space-sm, 12px);
    border-top: 1px solid var(--smt-color-slate-100, #f1f5f9);
    font-size: var(--smt-font-size-xs, 12px);
    color: var(--smt-color-slate-500, #64748b);
    display: flex;
    flex-direction: column;
    gap: var(--smt-space-2xs, 4px);
}

:is(#wrapper, body).single-product .product_meta a {
    color: var(--smt-color-link, #002780);
    text-decoration: none;
}

:is(#wrapper, body).single-product .product_meta a:hover {
    color: var(--smt-color-accent, #CF0921);
    text-decoration: underline;
}

/* ==========================================================================
   4. Hero Photo Gallery (4:3 Strict Geometry & Flickity Lock)
   ========================================================================== */

:is(#wrapper, body).single-product .product-gallery :is(.product-gallery-slider, .catalog-product-gallery__wrapper, .woocommerce-product-gallery__wrapper) {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--smt-color-white, #ffffff);
    border: 1px solid var(--smt-color-slate-200, #e2e8f0);
    border-radius: var(--smt-radius-md, 8px);
    overflow: hidden;
    contain: layout style;
    box-sizing: border-box;
}

/* Guarantee Flickity Viewport Stretches to Full 4:3 Container */
:is(#wrapper, body).single-product .product-gallery .product-gallery-slider .flickity-viewport {
    width: 100%;
    height: 100%;
    min-height: 100%;
    position: absolute;
    inset: 0;
}

:is(#wrapper, body).single-product .product-gallery :is(.catalog-product-gallery__image, .woocommerce-product-gallery__image, .slide) {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--smt-color-white, #ffffff);
}

:is(#wrapper, body).single-product .product-gallery :is(.catalog-product-gallery__image, .woocommerce-product-gallery__image) a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

:is(#wrapper, body).single-product .product-gallery img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: transform var(--smt-transition-normal, 0.3s ease);
}

/* Placeholder Geometry Containment (4:3) */
:is(#wrapper, body).single-product :is(.catalog-product-gallery__image--placeholder, .woocommerce-product-gallery__image--placeholder) {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--smt-color-white, #ffffff);
    aspect-ratio: 4 / 3;
    width: 100%;
    height: 100%;
}

:is(#wrapper, body).single-product :is(.catalog-product-gallery__image--placeholder, .woocommerce-product-gallery__image--placeholder) img {
    max-width: 320px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

/* ==========================================================================
   5. Thumbnail Gallery Flexbox (72px Square Row Architecture)
   ========================================================================== */

:is(#wrapper, body).single-product .product-thumbnails {
    display: flex;
    flex-direction: row;
    gap: var(--smt-space-xs, 8px);
    margin-top: var(--smt-space-sm, 12px);
    margin-inline: 0;
    min-height: 76px;
    height: 76px;
    max-height: 80px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .product-thumbnails .flickity-viewport {
    min-height: 76px;
    height: 76px;
    max-height: 80px;
    width: 100%;
}

:is(#wrapper, body).single-product .product-thumbnails .col {
    padding: 0;
    margin: 0;
    width: 72px;
    height: 72px;
    max-width: 72px;
    flex: 0 0 72px;
    flex-shrink: 0;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .product-thumbnails a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    aspect-ratio: 1 / 1;
    border: 1.5px solid var(--smt-color-slate-200, #e2e8f0);
    border-radius: var(--smt-radius-sm, 6px);
    overflow: hidden;
    background: var(--smt-color-white, #ffffff);
    transition: all var(--smt-transition-fast, 0.2s ease);
    cursor: pointer;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .product-thumbnails a:hover,
:is(#wrapper, body).single-product .product-thumbnails .is-nav-selected a {
    border-color: var(--smt-color-primary, #002780);
    box-shadow: 0 2px 8px rgba(0, 39, 128, 0.2);
}

:is(#wrapper, body).single-product .product-thumbnails img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* Pre-Flickity Scroll Lock */
:is(#wrapper, body).single-product .product-thumbnails:not(.flickity-enabled) {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--smt-space-xs, 8px);
    scrollbar-width: thin;
}

/* ==========================================================================
   6. Inquiry Action Buttons (Unified 44px Height & Baseline Centering)
   ========================================================================== */

:is(#wrapper, body).single-product .catalog-product-text,
:is(#wrapper, body).single-product .sre-single-rfq-actions,
:is(#wrapper, body).single-product .smtbox-single-rfq-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--smt-space-sm, 12px);
    margin-top: var(--smt-space-md, 20px);
    margin-bottom: var(--smt-space-sm, 12px);
    vertical-align: middle;
    padding: 0;
    height: auto;
}

:is(#wrapper, body).single-product #probutton,
:is(#wrapper, body).single-product div#probutton {
    display: inline-flex;
    margin: 0;
    padding: 0;
    height: auto;
}

/* Primary CTA: Request Instant Quote (#probutton a) */
:is(#wrapper, body).single-product #probutton a.thickbox,
:is(#wrapper, body).single-product #probutton a,
:is(#wrapper, body).single-product .sre-single-rfq-btn,
:is(#wrapper, body).single-product .smtbox-single-rfq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-width: 180px;
    padding: 0 24px 2px 24px;
    background-color: var(--smt-color-primary, #002780);
    color: var(--smt-color-white, #ffffff);
    font-family: var(--smt-font-brand, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: var(--smt-font-size-sm, 13px);
    line-height: 1;
    border-radius: var(--smt-radius-sm, 6px);
    border: 1.5px solid var(--smt-color-primary, #002780);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-sizing: border-box;
    transition: all var(--smt-transition-fast, 0.2s ease-in-out);
    margin: 0;
}

:is(#wrapper, body).single-product #probutton a.thickbox:hover,
:is(#wrapper, body).single-product #probutton a:hover,
:is(#wrapper, body).single-product .sre-single-rfq-btn:hover,
:is(#wrapper, body).single-product .smtbox-single-rfq-btn:hover {
    background-color: var(--smt-color-accent, #CF0921);
    border-color: var(--smt-color-accent, #CF0921);
    color: var(--smt-color-white, #ffffff);
    box-shadow: 0 4px 12px rgba(207, 9, 33, 0.25);
    text-decoration: none;
}

/* Secondary CTA: + Add to Quote List Button */
:is(#wrapper, body).single-product button.smtbox-add-to-quote-btn.is-single-page,
:is(#wrapper, body).single-product button.smtbox-quote-btn.is-single-page,
:is(#wrapper, body).single-product .button.alt.smtbox-quote-btn.is-single-page,
:is(#wrapper, body).single-product .smt-c-product-summary__btn--quote,
:is(#wrapper, body).single-product .sre-single-cart-btn,
:is(#wrapper, body).single-product .smtbox-single-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-width: 180px;
    padding: 0 24px 2px 24px;
    background-color: var(--smt-color-white, #ffffff);
    color: var(--smt-color-primary, #002780);
    border: 1.5px solid var(--smt-color-primary, #002780);
    border-radius: var(--smt-radius-sm, 6px);
    font-family: var(--smt-font-brand, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: var(--smt-font-size-sm, 13px);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    margin: 0;
    margin-left: var(--smt-space-sm, 12px);
    cursor: pointer;
    box-sizing: border-box;
    transition: all var(--smt-transition-fast, 0.2s ease-in-out);
}

:is(#wrapper, body).single-product button.smtbox-add-to-quote-btn.is-single-page:hover,
:is(#wrapper, body).single-product button.smtbox-quote-btn.is-single-page:hover,
:is(#wrapper, body).single-product .button.alt.smtbox-quote-btn.is-single-page:hover,
:is(#wrapper, body).single-product .smt-c-product-summary__btn--quote:hover,
:is(#wrapper, body).single-product .sre-single-cart-btn:hover,
:is(#wrapper, body).single-product .smtbox-single-cart-btn:hover {
    background-color: var(--smt-color-primary, #002780);
    border-color: var(--smt-color-primary, #002780);
    color: var(--smt-color-white, #ffffff);
    box-shadow: 0 4px 12px rgba(0, 39, 128, 0.2);
    text-decoration: none;
}

/* Mobile Action Button Stack (< 550px) */
@media (max-width: 549px) {
    :is(#wrapper, body).single-product .catalog-product-text,
    :is(#wrapper, body).single-product .sre-single-rfq-actions,
    :is(#wrapper, body).single-product .smtbox-single-rfq-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-left: 0;
    }
    :is(#wrapper, body).single-product #probutton,
    :is(#wrapper, body).single-product #probutton a.thickbox,
    :is(#wrapper, body).single-product #probutton a,
    :is(#wrapper, body).single-product button.smtbox-add-to-quote-btn.is-single-page,
    :is(#wrapper, body).single-product button.smtbox-quote-btn.is-single-page {
        width: 100%;
        min-width: 100%;
        margin-left: 0;
        margin-right: 0;
        text-align: center;
    }
}

/* ==========================================================================
   7. Specifications Table (W3C Separated Box Model)
   ========================================================================== */

:is(#wrapper, body).single-product .sre-specs-table-wrapper,
:is(#wrapper, body).single-product .shop_attributes_wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--smt-color-slate-200, #e2e8f0);
    border-radius: var(--smt-radius-md, 8px);
    margin-top: var(--smt-space-md, 16px);
    margin-bottom: var(--smt-space-lg, 24px);
    background: var(--smt-color-white, #ffffff);
}

:is(#wrapper, body).single-product table.shop_attributes,
:is(#wrapper, body).single-product table.woocommerce-product-attributes,
:is(#wrapper, body).single-product .sre-specs-table,
:is(#wrapper, body).single-product .smtbox-specs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: var(--smt-font-size-sm, 13.5px);
    border: none;
}

:is(#wrapper, body).single-product table.shop_attributes th,
:is(#wrapper, body).single-product table.woocommerce-product-attributes th,
:is(#wrapper, body).single-product .sre-specs-table th,
:is(#wrapper, body).single-product .smtbox-specs-table th {
    width: 35%;
    min-width: 140px;
    padding: 12px 16px;
    background-color: var(--smt-color-slate-50, #f8fafc);
    color: var(--smt-color-slate-700, #334155);
    font-weight: 600;
    border-bottom: 1px solid var(--smt-color-slate-200, #e2e8f0);
    text-align: left;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product table.shop_attributes td,
:is(#wrapper, body).single-product table.woocommerce-product-attributes td,
:is(#wrapper, body).single-product .sre-specs-table td,
:is(#wrapper, body).single-product .smtbox-specs-table td {
    padding: 12px 16px;
    color: var(--smt-color-slate-600, #475569);
    border-bottom: 1px solid var(--smt-color-slate-200, #e2e8f0);
    text-align: left;
    box-sizing: border-box;
}

/* Purge nested paragraph margins injected by WooCommerce */
:is(#wrapper, body).single-product table.shop_attributes td p,
:is(#wrapper, body).single-product table.woocommerce-product-attributes td p {
    margin: 0;
    padding: 0;
    line-height: var(--smt-line-height-normal, 1.5);
}

/* Remove bottom border on the final table row */
:is(#wrapper, body).single-product table.shop_attributes tr:last-child th,
:is(#wrapper, body).single-product table.shop_attributes tr:last-child td,
:is(#wrapper, body).single-product table.woocommerce-product-attributes tr:last-child th,
:is(#wrapper, body).single-product table.woocommerce-product-attributes tr:last-child td,
:is(#wrapper, body).single-product .sre-specs-table tr:last-child th,
:is(#wrapper, body).single-product .sre-specs-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   8. Vertical Tab Navigation Architecture
   ========================================================================== */

:is(#wrapper, body).single-product .catalog-tabs.tabbed-content,
:is(#wrapper, body).single-product .woocommerce-tabs.tabbed-content {
    margin-top: var(--smt-space-xl, 32px);
    margin-bottom: var(--smt-space-2xl, 40px);
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    border-top: 1px solid var(--smt-color-slate-200, #e2e8f0);
    padding-top: var(--smt-space-lg, 24px);
    box-sizing: border-box;
}

/* Vertical Tab Navigation Column (240px Fixed Sidebar) */
:is(#wrapper, body).single-product .catalog-tabs .nav-vertical,
:is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--smt-color-slate-200, #e2e8f0);
    border-bottom: none;
    border-top: none;
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li,
:is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical > li {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--smt-color-slate-100, #f1f5f9);
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li > a,
:is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical > li > a {
    display: block;
    width: 100%;
    height: auto;
    padding: 12px 18px;
    font-family: var(--smt-font-brand, 'Outfit', sans-serif);
    font-weight: 600;
    font-size: var(--smt-font-size-sm, 14px);
    color: var(--smt-color-slate-700, #334155);
    text-decoration: none;
    text-align: left;
    border-left: 3px solid transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    background: transparent;
    transition: all var(--smt-transition-fast, 0.2s ease);
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li > a:hover,
:is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li.active > a,
:is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical > li.active > a {
    color: var(--smt-color-primary, #002780);
    background-color: var(--smt-color-slate-50, #f8fafc);
    border-left-color: var(--smt-color-primary, #002780);
    font-weight: 700;
}

/* Tab Panels Content Column */
:is(#wrapper, body).single-product .catalog-tabs .tab-panels,
:is(#wrapper, body).single-product .tabbed-content .tab-panels {
    flex: 1 1 0%;
    min-width: 0;
    overflow-x: auto;
    padding-left: var(--smt-space-xl, 32px);
    padding-right: 0;
    padding-top: 0;
    border-left: none;
    box-sizing: border-box;
}

:is(#wrapper, body).single-product .tab-panels :is(.panel, .catalog-Tabs-panel, .woocommerce-Tabs-panel) {
    font-family: var(--smt-font-sans, 'Inter', sans-serif);
    font-size: var(--smt-font-size-base, 15px);
    line-height: var(--smt-line-height-relaxed, 1.6);
    color: var(--smt-color-slate-700, #334155);
}

:is(#wrapper, body).single-product .tab-panels :is(.panel, .catalog-Tabs-panel):not(.active) {
    display: none;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

:is(#wrapper, body).single-product .tab-panels :is(.panel, .catalog-Tabs-panel).active {
    display: block;
    visibility: visible;
    height: auto;
}

/* Responsive Tab Stacking (@media max-width: 849px) */
@media (max-width: 849px) {
    :is(#wrapper, body).single-product .catalog-tabs.tabbed-content,
    :is(#wrapper, body).single-product .woocommerce-tabs.tabbed-content {
        flex-direction: column;
    }
    :is(#wrapper, body).single-product .catalog-tabs .nav-vertical,
    :is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 2px solid var(--smt-color-slate-200, #e2e8f0);
        margin-bottom: var(--smt-space-md, 16px);
    }
    :is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li,
    :is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical > li {
        width: auto;
        flex: 0 0 auto;
        border-bottom: none;
    }
    :is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li > a,
    :is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical > li > a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 16px;
    }
    :is(#wrapper, body).single-product .catalog-tabs .nav-vertical > li.active > a,
    :is(#wrapper, body).single-product .tabbed-content ul.nav.nav-vertical > li.active > a {
        border-left-color: transparent;
        border-bottom-color: var(--smt-color-primary, #002780);
    }
    :is(#wrapper, body).single-product .catalog-tabs .tab-panels,
    :is(#wrapper, body).single-product .tabbed-content .tab-panels {
        padding-left: 0;
        padding-top: var(--smt-space-md, 16px);
        width: 100%;
    }
}

/* ==========================================================================
   9. Related Products Carousel CLS Stabilization
   ========================================================================== */

:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) {
    margin-top: var(--smt-space-2xl, 40px);
    padding-top: var(--smt-space-lg, 24px);
    border-top: 1px solid var(--smt-color-slate-200, #e2e8f0);
}

:is(#wrapper, body).single-product .product-section-title-related {
    font-family: var(--smt-font-brand, 'Outfit', sans-serif);
    font-size: var(--smt-font-size-xl, 20px);
    font-weight: 800;
    color: var(--smt-color-slate-900, #0f172a);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--smt-color-primary, #002780);
    display: inline-block;
    padding-bottom: 6px;
    margin-bottom: var(--smt-space-lg, 24px);
}

:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .slider.row-slider {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    min-height: 440px;
    contain: layout style;
}

@media (max-width: 849px) {
    :is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .slider.row-slider {
        min-height: 360px;
    }
}

@media (max-width: 549px) {
    :is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .slider.row-slider {
        min-height: 300px;
    }
}

/* Pre-Flickity Column Lock Synchronized with Flatsome Grid Breakpoints */
:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .slider.row-slider:not(.flickity-enabled) > .col {
    flex: 0 0 25%;
    max-width: 25%;
    width: 25%;
    box-sizing: border-box;
}

@media (max-width: 849px) {
    :is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .slider.row-slider:not(.flickity-enabled) > .col {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        width: 33.333%;
    }
}

@media (max-width: 549px) {
    :is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .slider.row-slider:not(.flickity-enabled) > .col {
        flex: 0 0 50%;
        max-width: 50%;
        width: 50%;
    }
}

:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .product-small.box {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--smt-color-white, #ffffff);
    border: 1px solid var(--smt-color-slate-200, #e2e8f0);
    border-radius: var(--smt-radius-md, 8px);
    overflow: hidden;
}

:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .product-small.box .box-image {
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    background: #ffffff;
}

:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .product-small.box .box-image img {
    aspect-ratio: 4 / 3;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

:is(#wrapper, body).single-product :is(.related, .related-products-wrapper) .product-small.box .box-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--smt-space-sm, 12px);
}

/* ==========================================================================
   10. Safe-Area Clearance & Footer Cushioning
   ========================================================================== */

:is(#wrapper, body).single-product .product-footer,
:is(#wrapper, body).single-product .related-products-wrapper,
:is(#wrapper, body).single-product .related.products {
    padding-bottom: 80px;
}
