/* =====================================================
   PROCORA Fruit3 — WooCommerce
   Shop loops, blocks, single product, gallery, archive
   ===================================================== */

/* --- 5. Shop Product Grid --- */
.woocommerce ul.products li.product:not(.product-category) {
    background: #ffffff;
    border: 1px solid rgba(13, 79, 130, 0.14);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(13,79,130,0.12);
    padding: 8px;
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.woocommerce ul.products li.product:not(.product-category) a img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    transition: transform .25s ease;
}

.woocommerce ul.products li.product:not(.product-category) .woocommerce-loop-product__link {
    display: block;
    overflow: visible;
}

.woocommerce-loop-product__title {
    font-size: 13.5px !important;
    font-weight: 400 !important;
    color: #0b3d63 !important;
}

.procora-loop-product-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    line-height: 1.35;
}

.procora-loop-product-title__en {
    display: block;
    font-weight: 600;
    color: #0b3d63;
}

.procora-loop-product-title__th {
    display: block;
    font-weight: 400;
    color: #0b3d63;
}

.procora-loop-product-title__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.procora-loop-product-title__row {
    display: block;
}

.procora-loop-product-title__label {
    font-weight: 400;
    color: #0b3d63;
}

.procora-loop-product-title__value {
    font-weight: 600;
    color: #0b3d63;
}

.woocommerce ul.products li.product:not(.product-category) h2 {
    min-height: 60px;
}

.woocommerce ul.products li.product:not(.product-category) .price {
    font-size: 18px;
    font-weight: 700;
    color: #0b5fa5;
}

.woocommerce ul.products li.product:not(.product-category) .button {
    margin-top: auto;
}

.woocommerce ul.products {
    row-gap: 2px;
}

/* --- 5b. Home Product Carousel (Plant3 s-slider) --- */
/* Markup: .s-slides.products > ul.slide > li.product — not ul.products */
.s-slider .s-slides.products {
    align-items: stretch;
}

.s-slider .s-slides.products > .slide {
    display: flex;
    flex-direction: column;
    height: auto;
    align-self: stretch;
}

.s-slider .s-slides.products > .slide > li.product {
    background: #ffffff;
    border: 1px solid rgba(13, 79, 130, 0.14);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(13, 79, 130, 0.12);
    padding: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
    text-align: center;
}

.s-slider .s-slides.products > .slide > li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(13, 79, 130, 0.18);
}

.s-slider .s-slides.products > .slide > li.product a img {
    display: block;
    width: 100%;
    height: 240px;
    max-height: 240px;
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
    transition: transform 0.25s ease;
}

.s-slider .s-slides.products > .slide > li.product:hover a img {
    transform: scale(1.1);
}

.s-slider .s-slides.products > .slide > li.product .woocommerce-loop-product__link {
    display: block;
    width: 100%;
    overflow: visible;
}

.s-slider .s-slides.products > .slide > li.product .procora-loop-product-title,
.s-slider .s-slides.products > .slide > li.product .woocommerce-loop-product__title,
.s-slider .s-slides.products > .slide > li.product h2 {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    margin-bottom: 8px;
}

/* Same as shop: auto-width button (padding 10px 22px from components.css), not full card width */
.s-slider .s-slides.products > .slide > li.product .button,
.s-slider .s-slides.products > .slide > li.product a.button,
.s-slider .s-slides.products > .slide > li.product .add_to_cart_button {
    margin-top: auto;
    width: auto !important;
    max-width: 100%;
    align-self: center;
    box-sizing: border-box;
    text-align: center;
    display: inline-block;
}

/* --- 6. Home Page Product Collection (Blocks) --- */
.wc-block-grid__product,
.wp-block-woocommerce-product-collection .product,
.wp-block-post-template li {
    background: #ffffff;
    border: 1px solid rgba(13, 79, 130, 0.14);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(13,79,130,0.12);
    padding: 14px;
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wc-block-components-product-image,
.wp-block-woocommerce-product-collection .wc-block-components-product-image,
.wc-block-grid__product-image {
    height: 240px;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
}

.wc-block-components-product-image a,
.wp-block-woocommerce-product-collection .wc-block-components-product-image a {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-block-components-product-image img,
.wp-block-woocommerce-product-collection img,
.wc-block-grid__product-image img {
    width: 100%;
    height: 100%;
    max-height: 240px;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wc-block-components-product-title,
.wp-block-woocommerce-product-collection .wc-block-components-product-title,
.wp-block-woocommerce-product-collection .product h2,
.wp-block-post-title,
.wp-block-post-title a {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #0b3d63 !important;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 16px;
    text-decoration: none;
}

.wc-block-components-product-button,
.wp-block-woocommerce-product-collection .wp-block-button,
.wp-block-woocommerce-product-collection .wc-block-components-product-button {
    margin-top: auto !important;
    width: 100%;
    display: flex;
    justify-content: center;
}

.wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-collection .wp-block-button__link {
    width: 100%;
    margin-top: 0 !important;
    box-sizing: border-box;
}

/* Shared product card hover lift (classic loop + blocks) — products only */
.woocommerce ul.products li.product:not(.product-category):hover,
.wc-block-grid__product:hover,
.wp-block-woocommerce-product-collection .product:hover,
.wp-block-post-template li:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(13,79,130,0.18);
}

.woocommerce ul.products li.product:not(.product-category):hover img {
    transform: scale(1.1);
}

.wc-block-grid__product:hover img,
.wp-block-woocommerce-product-collection .product:hover img {
    transform: scale(1.05) !important;
}

/* --- 9. Pagination --- */
.woocommerce-pagination a,
.woocommerce-pagination span {
    border-radius: 8px;
    padding: 8px 12px;
    background: #ffffff;
    color: #0b5fa5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.woocommerce-pagination span.current {
    background: linear-gradient(90deg, #1489c6, #20b3c2);
    color: #ffffff;
}

/* --- 10. Single Product Page --- */
.woocommerce div.product div.images {
    background: #ffffff;
    border: 1px solid rgba(13, 79, 130, 0.14);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 28px rgba(13,79,130,0.10);
}

@media (max-width: 767px) {
    .woocommerce div.product div.images {
        padding: 12px;
    }
}

.woocommerce div.product .summary {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
}

/* --- 11. Shop / Search / Taxonomy Category Grid --- */
.post-type-archive-product ul.products,
.tax-product_cat ul.products,
.procora-search-cats ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch;
    justify-content: start;
}

.post-type-archive-product ul.products li.product-category,
.tax-product_cat ul.products li.product-category,
.procora-search-cats ul.products li.product-category,
.woocommerce ul.products li.product-category.product,
.woocommerce .procora-search-cats ul.products li.product.product-category {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* Top 14px; left/right 8px; bottom 8px — same on category + search */
    padding: 14px 8px 8px 8px !important;
    border: 1px solid rgba(13, 79, 130, 0.14) !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 24px rgba(13, 79, 130, 0.12) !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    justify-content: flex-start !important;
    align-self: stretch;
}

.post-type-archive-product ul.products li.product-category > a,
.tax-product_cat ul.products li.product-category > a,
.procora-search-cats ul.products li.product-category > a,
.woocommerce ul.products li.product-category.product > a,
.woocommerce .procora-search-cats ul.products li.product.product-category > a {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    text-decoration: none;
}

/* Fixed image slot — category + search (must beat product card 240px) */
.post-type-archive-product ul.products li.product-category img,
.tax-product_cat ul.products li.product-category img,
.procora-search-cats ul.products li.product-category img,
.woocommerce ul.products li.product-category.product a img,
.woocommerce ul.products li.product-category.product img,
.woocommerce .procora-search-cats ul.products li.product.product-category a img,
.woocommerce .procora-search-cats ul.products li.product.product-category img {
    display: block !important;
    width: 100% !important;
    height: 140px !important;
    max-height: 140px !important;
    object-fit: contain !important;
    object-position: center center !important;
    flex-shrink: 0;
    margin: 0 auto !important;
    padding: 0 !important;
}

.post-type-archive-product ul.products li.product-category h2,
.tax-product_cat ul.products li.product-category h2,
.procora-search-cats ul.products li.product-category h2,
.woocommerce ul.products li.product-category.product h2 {
    font-size: 14px;
    line-height: 1.4;
    min-height: 0 !important;
}

/* Search: keep category cards on the same column width as shop (do not stretch full row) */
.procora-search-cats ul.products {
    width: 100%;
}

.procora-search-cats ul.products li.product-category {
    /* occupies one cell of the 5-col grid — same footprint as category archive */
    grid-column: span 1;
}

/* --- 13. Responsive Category Archive Grid --- */
@media (max-width: 1200px) {
    .post-type-archive-product ul.products,
    .tax-product_cat ul.products,
    .procora-search-cats ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .post-type-archive-product ul.products,
    .tax-product_cat ul.products,
    .procora-search-cats ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /*
     * Product card images — 240px fixed height is too tall on 2-col mobile
     * cards (~half viewport). Use square slot so contain() has less letterbox.
     */
    .woocommerce ul.products li.product:not(.product-category) a img,
    .s-slider .s-slides.products > .slide > li.product a img {
        height: auto;
        max-height: none;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        object-position: center center;
    }

    .wc-block-components-product-image,
    .wp-block-woocommerce-product-collection .wc-block-components-product-image,
    .wc-block-grid__product-image {
        height: auto;
        aspect-ratio: 1 / 1;
        margin-bottom: 8px !important;
    }

    .wc-block-components-product-image img,
    .wp-block-woocommerce-product-collection img,
    .wc-block-grid__product-image img {
        max-height: none;
    }

    .woocommerce ul.products li.product:not(.product-category) {
        padding: 6px;
    }

    .woocommerce ul.products li.product:not(.product-category) h2 {
        min-height: 0;
    }
}

/* --- 17. Bilingual Category Title --- */
.procora-cat-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 2px 0 0;
    min-height: auto !important;
    flex: 1 1 auto;
    width: 100%;
}

.procora-cat-title .cat-en {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #14395e;
    line-height: 1.3;
}

.procora-cat-title .cat-th {
    display: block;
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 400;
    color: #14395e;
    opacity: 0.85;
    line-height: 1.3;
}

/* Pin product count near the bottom edge (8px card padding-bottom) */
.procora-cat-title .count {
    display: block;
    margin-top: auto;
    padding-top: 6px;
    margin-bottom: 0;
    font-size: 12.5px;
    font-weight: 400;
    color: #111;
    background: none;
}

/* Search category cards: do not stretch tall (shop multi-col stretch is OK) */
.procora-search-cats ul.products {
    align-items: start;
}

.procora-search-cats ul.products li.product-category {
    align-self: start;
    height: auto !important;
}

.procora-search-cats .procora-cat-title {
    flex: 0 0 auto;
}

.procora-search-cats .procora-cat-title .count {
    margin-top: 6px;
}

/* --- Single Product Gallery ---
 * Square frame + shrink-to-fit (mobile + desktop).
 * Img fills the square box; object-fit:contain draws the full bitmap inside.
 * (flex + height:auto failed — Plant3 width:100% + overflow:hidden cropped tall photos.)
 */
.single-product .woocommerce-product-gallery {
    position: relative;
    overflow: hidden;
}

.single-product div.product div.images {
    overflow: hidden;
}

.single-product .flex-viewport {
    position: relative;
    z-index: 1;
    isolation: isolate;
    overflow: hidden !important;
}

.single-product .woocommerce-product-gallery__image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    isolation: isolate;
}

.single-product .woocommerce-product-gallery__image > a {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: zoom-in;
    overflow: hidden;
}

.single-product .woocommerce-product-gallery__image img,
.single-product .flex-viewport .woocommerce-product-gallery__image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
}

/*
 * Mobile: FlexSlider viewport height follows the square slide.
 */
@media (max-width: 1023px) {
    .single-product .flex-viewport {
        height: auto !important;
        overflow: hidden !important;
    }
}

/*
 * Gallery thumbnails: square slot + shrink-to-fit via flex (no absolute).
 */
.single-product .flex-control-nav {
    position: relative;
    z-index: 2;
    isolation: isolate;
}

.single-product .flex-control-nav li {
    position: relative !important;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    flex: 0 0 96px;
    width: 96px;
    max-width: 96px;
    height: 96px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.single-product .flex-control-nav img {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    margin: 0 !important;
    flex-shrink: 1 !important;
}

/* --- Product gallery lightbox --- */
.procora-gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 48px 24px 24px;
}

.procora-gallery-lightbox.is-open {
    display: flex;
}

.procora-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 61, 99, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.procora-gallery-lightbox__stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 100%;
}

.procora-gallery-lightbox__dialog {
    position: relative;
    max-width: min(92vw, 960px);
    max-height: 88vh;
    margin: 0;
    /* Reserve space above image so close control clears the frame */
    padding-top: 44px;
}

.procora-gallery-lightbox__img {
    display: block;
    max-width: min(92vw, 960px);
    max-height: calc(88vh - 44px);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 16px 48px rgba(13, 79, 130, 0.35);
}

/* Close + nav: icon only, dark-blue glow (no circular plate) */
.procora-gallery-lightbox__close,
.procora-gallery-lightbox__nav {
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    box-shadow: none;
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 0 2px #0b3d63)
            drop-shadow(0 0 6px #0b3d63)
            drop-shadow(0 1px 3px rgba(11, 61, 99, 0.85));
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.procora-gallery-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    display: flex;
    /* Center of X sits on the image frame's right edge */
    transform: translateX(50%);
}

/* No focus ring on lightbox controls (open focuses close; iOS shows ring otherwise) */
.procora-gallery-lightbox__close:focus,
.procora-gallery-lightbox__close:focus-visible,
.procora-gallery-lightbox__nav:focus,
.procora-gallery-lightbox__nav:focus-visible {
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.procora-gallery-lightbox.has-nav .procora-gallery-lightbox__nav {
    display: flex;
}

/* Single-image: reserve nav footprint so the dialog matches multi-image side gutters */
.procora-gallery-lightbox:not(.has-nav) .procora-gallery-lightbox__stage {
    padding-left: 56px;
    padding-right: 56px;
}

.procora-gallery-lightbox__close:hover {
    background: transparent;
    transform: translateX(50%) scale(1.08);
    filter: drop-shadow(0 0 3px #0b3d63)
            drop-shadow(0 0 10px #0b3d63)
            drop-shadow(0 2px 4px rgba(11, 61, 99, 0.9));
}

.procora-gallery-lightbox__nav:hover {
    background: transparent;
    transform: scale(1.08);
    filter: drop-shadow(0 0 3px #0b3d63)
            drop-shadow(0 0 10px #0b3d63)
            drop-shadow(0 2px 4px rgba(11, 61, 99, 0.9));
}

.procora-gallery-lightbox__nav:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.procora-gallery-lightbox__icon {
    display: block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    pointer-events: none;
}

.procora-gallery-lightbox__close .procora-gallery-lightbox__icon {
    width: 30px;
    height: 30px;
}

/* Nav chevrons ~1.5× previous size (28 → 42) */
.procora-gallery-lightbox__nav .procora-gallery-lightbox__icon {
    width: 42px;
    height: 42px;
}

body.procora-lightbox-open,
html.procora-lightbox-open {
    overflow: hidden;
}

/* Hide leftover WooCommerce PhotoSwipe UI (replaced by Procora lightbox) */
.pswp {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 767px) {
    .procora-gallery-lightbox {
        padding: 40px 8px 16px;
    }

    .procora-gallery-lightbox__stage {
        gap: 4px;
        width: 100%;
        max-width: 100%;
    }

    .procora-gallery-lightbox:not(.has-nav) .procora-gallery-lightbox__stage {
        padding-left: 44px;
        padding-right: 44px;
    }

    .procora-gallery-lightbox__dialog {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        padding-top: 40px;
    }

    .procora-gallery-lightbox__close,
    .procora-gallery-lightbox__nav {
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }

    .procora-gallery-lightbox__close {
        top: 0;
        right: 0;
    }

    .procora-gallery-lightbox__close .procora-gallery-lightbox__icon {
        width: 28px;
        height: 28px;
    }

    .procora-gallery-lightbox__nav .procora-gallery-lightbox__icon {
        width: 33px;
        height: 33px;
    }

    .procora-gallery-lightbox__img {
        max-width: 100%;
        max-height: calc(75vh - 40px);
    }
}

/* --- Single product mobile: stop horizontal page overflow ---
   Plant3 .woocommerce-product-gallery uses negative side margins.
   Tall products + FlexSlider inline widths can push body.scrollWidth
   past the viewport (worse after lightbox open/close). */
@media (max-width: 1023px) {
    body.single-product,
    body.single-product #page,
    body.single-product .site,
    body.single-product .site-content,
    body.single-product .content-area,
    body.single-product .site-main {
        overflow-x: hidden;
        max-width: 100%;
    }

    .single-product div.product,
    .single-product div.product div.images,
    .single-product .summary {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .single-product .woocommerce-product-gallery {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100%;
        width: 100%;
        overflow: hidden;
        min-width: 0;
    }

    .single-product .flex-viewport {
        max-width: 100%;
        overflow: hidden !important;
        height: auto !important;
        min-width: 0;
    }

    /*
     * Do not force slide width:100%!important — FlexSlider sets inline px widths
     * on each .woocommerce-product-gallery__image for the horizontal track.
     * Overriding them blanks the main image when switching to thumbnail 2+.
     */
    .single-product .woocommerce-product-gallery__image {
        min-width: 0;
        box-sizing: border-box;
    }
}

/* ปิดการคลิกลิงก์บนรูปภาพสินค้าหลักเพื่อไม่ให้หลุดหน้า */
/*
.single-product .woocommerce-product-gallery__image a {
    pointer-events: none;
    cursor: default;
}
*/

/* --- Single Product Tabs — connected tab bar + paper panel --- */
.single-product .woocommerce-tabs,
.single-product .wc-tabs-wrapper {
    overflow: visible;
}

.single-product .woocommerce-tabs .wc-tabs {
    gap: 2px;
    margin-bottom: 0;
    justify-content: flex-start;
    position: relative;
    z-index: 2;
    width: 50%;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow: visible;
}

.single-product .woocommerce-tabs .wc-tabs li {
    flex: 1 1 0;
    min-width: 0;
    list-style: none;
}

.single-product .woocommerce-tabs .wc-tabs li a {
    background: linear-gradient(90deg, #17a2b8 0%, #20b3c2 50%, #1489c6 100%);
    color: #ffffff !important;
    border: none;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 10px 12px;
    font-weight: 600;
    box-shadow: none;
    text-align: center;
    white-space: normal;
    transition: background 0.25s ease, opacity 0.25s ease;
}

.single-product .woocommerce-tabs .wc-tabs li a:hover {
    background: linear-gradient(90deg, #0e8fa4 0%, #149bb0 50%, #0b5fa5 100%);
    color: #ffffff !important;
}

.single-product .woocommerce-tabs .wc-tabs li.active a {
    background: linear-gradient(90deg, #0b5fa5 0%, #1489c6 100%);
    color: #ffffff !important;
    font-weight: 700;
    opacity: 1;
    position: relative;
    z-index: 3;
}

.single-product .woocommerce-tabs .wc-tabs li:not(.active) a {
    opacity: 0.85;
}

.single-product .woocommerce-tabs .woocommerce-Tabs-panel,
.single-product .woocommerce-tabs .wc-tab {
    background: #ffffff;
    border: 1px solid rgba(13, 79, 130, 0.14);
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 10px 24px rgba(13, 79, 130, 0.12);
    padding: 24px;
    margin-top: 0;
    position: relative;
    z-index: 1;
    clear: both;
    max-width: 100%;
    box-sizing: border-box;
    /*
     * Do not set overflow-x:auto on the panel — CSS then forces overflow-y:auto
     * and tall description images appear cropped. Scroll wide tables inside wrappers.
     */
    overflow: visible;
}

.single-product .woocommerce-Tabs-panel img,
.single-product .woocommerce-tabs .wc-tab img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.single-product .procora-spec-content {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.single-product .woocommerce-Tabs-panel .table-container,
.single-product .woocommerce-tabs .wc-tab .table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.single-product .woocommerce-Tabs-panel table,
.single-product .woocommerce-tabs .wc-tab table,
.single-product .procora-spec-content table {
    width: max-content;
    max-width: none;
    min-width: 100%;
    border-collapse: collapse;
}

/* Spec tables: keep columns readable while scrolling horizontally */
.single-product .procora-spec-content table th,
.single-product .procora-spec-content table td {
    white-space: nowrap;
    padding: 8px 10px;
}

/* Fallback for legacy WPCode inline PDF link */
.single-product .woocommerce-Tabs-panel--downloads_tab a:not(.procora-brochure-link) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    padding: 10px 18px;
    /* Acrobat-inspired red, muted for PROCORA UI */
    background: linear-gradient(90deg, #c44a4a 0%, #d45c5c 50%, #a83a3a 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(168, 58, 58, 0.28);
}

.single-product .woocommerce-Tabs-panel--downloads_tab a:not(.procora-brochure-link)::before {
    content: "";
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    /* Outline PDF file icon (dog-ear + PDF label) — white stroke for gradient button */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 2v6h6' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ctext x='12' y='16.5' text-anchor='middle' fill='%23ffffff' font-size='5.5' font-weight='700' font-family='Arial,Helvetica,sans-serif'%3EPDF%3C/text%3E%3C/svg%3E") center / contain no-repeat;
}

.single-product .woocommerce-Tabs-panel--downloads_tab a:not(.procora-brochure-link)::after {
    content: "เอกสารประกอบ";
}

.single-product .woocommerce-Tabs-panel--downloads_tab a:not(.procora-brochure-link) {
    font-size: 0;
}

.single-product .woocommerce-Tabs-panel--downloads_tab a:not(.procora-brochure-link)::after {
    font-size: 15px;
}

.procora-downloads-content {
    margin-bottom: 32px;
}

.procora-brochure-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    /* Acrobat-inspired red (#E31E24 family), desaturated for softer UI */
    background: linear-gradient(90deg, #c44a4a 0%, #d45c5c 50%, #a83a3a 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(168, 58, 58, 0.28);
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.procora-brochure-link:hover {
    background: linear-gradient(90deg, #b43f3f 0%, #c44a4a 50%, #963232 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(168, 58, 58, 0.36);
}

.procora-brochure-link__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    /* Outline PDF file icon (dog-ear + PDF label) — white stroke for gradient button */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 2v6h6' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ctext x='12' y='16.5' text-anchor='middle' fill='%23ffffff' font-size='5.5' font-weight='700' font-family='Arial,Helvetica,sans-serif'%3EPDF%3C/text%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 767px) {
    .single-product .woocommerce-tabs .wc-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 50%;
        max-width: 100%;
    }

    .single-product .woocommerce-tabs .wc-tabs li {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .single-product .woocommerce-tabs .wc-tabs li a {
        padding: 12px 10px;
        font-size: 16px;
        line-height: 1.3;
    }

    .single-product .woocommerce-tabs .woocommerce-Tabs-panel,
    .single-product .woocommerce-tabs .wc-tab {
        border-radius: 12px;
        margin-top: 8px;
        padding: 16px 12px;
    }

    .single-product .procora-spec-content table th,
    .single-product .procora-spec-content table td {
        font-size: 13px;
        padding: 6px 8px;
    }
}
