/* ==========================================================
   SINGLE PRODUCT PAGE
   ========================================================== */
.woocommerce div.product.sl-single-product-wrap {
    display: block !important;
}

.sl-single-product-wrap > .sl-product-layout {
    display: grid;
    grid-template-columns: minmax(300px, 1.05fr) minmax(300px, 0.95fr);
    gap: 56px;
    align-items: start;
}

.sl-product-gallery-col,
.sl-product-summary {
    min-width: 0;
}

.sl-product-gallery-col {
    position: relative;
}

.sl-single-product-wrap > .sl-product-details-shell {
    display: block;
    width: 100%;
    clear: both;
    margin-top: 56px;
    border-top: 1px solid var(--sl-sand);
    padding-top: 32px;
}

.woocommerce div.product div.images {
    width: 100% !important;
    float: none !important;
}

.woocommerce div.product div.summary {
    width: 100% !important;
    float: none !important;
}

/* Gallery */
.sl-gallery {
    display: flex;
    gap: 14px;
}

.sl-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.sl-gallery-thumb {
    width: 76px;
    height: 96px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.sl-gallery-thumb.active,
.sl-gallery-thumb:hover { border-color: var(--sl-sage); }

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

.sl-gallery-main {
    flex: 1;
    border-radius: var(--sl-radius);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--sl-cream-deep);
}

.sl-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* WooCommerce product gallery thumbnails */
.woocommerce div.product div.images .woocommerce-product-gallery__image {
    border-radius: var(--sl-radius);
    overflow: hidden;
}

.woocommerce div.product div.images .flex-viewport {
    border-radius: var(--sl-radius);
    overflow: hidden;
}

.woocommerce div.product div.images .flex-control-thumbs {
    margin-top: 14px !important;
    display: flex !important;
    gap: 10px !important;
    list-style: none !important;
    padding: 0 !important;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: 76px !important;
    flex-shrink: 0;
}

.woocommerce div.product div.images .flex-control-thumbs img {
    width: 76px !important;
    height: 96px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    opacity: 0.7;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}

.woocommerce div.product div.images .flex-control-thumbs img.flex-active,
.woocommerce div.product div.images .flex-control-thumbs img:hover {
    opacity: 1 !important;
    border-color: var(--sl-sage) !important;
}

/* Sale badge on single product */
.woocommerce span.onsale,
.sl-product-gallery-col span.onsale {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    right: auto !important;
    background: var(--sl-terracotta) !important;
    border-radius: var(--sl-radius-pill) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    font-family: var(--sl-font-body) !important;
    padding: 4px 12px !important;
    min-width: auto !important;
    min-height: auto !important;
    line-height: 1.5 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    z-index: 5;
    width: auto !important;
}

/* Product summary */
.sl-product-summary > * {
    margin-bottom: 14px;
}

/* WC price on single product */
.woocommerce div.product p.price {
    font-size: clamp(24px, 3vw, 30px) !important;
    font-weight: 700 !important;
    color: var(--sl-charcoal) !important;
    margin-bottom: 14px !important;
    letter-spacing: -0.01em;
}

.woocommerce div.product p.price del {
    color: var(--sl-mist) !important;
}

.woocommerce div.product p.price ins {
    text-decoration: none !important;
    font-weight: 700 !important;
    color: var(--sl-terracotta) !important;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    margin-bottom: 14px;
}

/* Product title */
.woocommerce div.product .product_title {
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    font-weight: 400;
}

/* WC short description */
.woocommerce div.product .woocommerce-product-details__short-description {
    font-size: 15px;
    color: var(--sl-text-muted);
    line-height: 1.8;
    margin-bottom: 18px;
    max-width: 56ch;
}

/* WC cart form */
.woocommerce div.product form.cart {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    margin: 24px 0 0;
}

.woocommerce div.product form.cart .quantity {
    margin: 0 !important;
}

.woocommerce div.product form.cart .qty {
    width: 84px;
    height: 52px;
    border-radius: 12px;
    border: 1px solid var(--sl-sand) !important;
    background: var(--sl-white);
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    transition: border-color 0.2s;
}

.woocommerce div.product form.cart .qty:focus {
    border-color: var(--sl-sage) !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    width: 100%;
    min-height: 52px;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
}

.woocommerce div.product form.cart table.variations {
    grid-column: 1 / -1;
    margin-bottom: 8px;
}

.woocommerce div.product form.cart .reset_variations {
    color: var(--sl-sage);
    font-size: 12px;
}

/* Product meta */
.woocommerce div.product .product_meta {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--sl-sand);
    font-size: 13px;
    color: var(--sl-mist);
}

.woocommerce div.product .product_meta a:hover { color: var(--sl-sage); }

.product_meta {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--sl-sand);
    color: var(--sl-text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.product_meta > span {
    display: block;
}

.product_meta a {
    color: var(--sl-charcoal);
}

/* Trust lines */
.sl-trust-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    background: var(--sl-soft-green);
    border: 1px solid rgba(92,122,94,0.14);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.sl-trust-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--sl-charcoal);
}

.sl-trust-line-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(30,28,26,0.06);
}

.sl-trust-line-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sl-trust-line-title {
    color: var(--sl-charcoal);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.sl-trust-line-text {
    color: var(--sl-text-muted);
    font-size: 12px;
    line-height: 1.6;
}

/* Category trail chips */
.sl-single-product-category-trail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sl-single-product-category {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: var(--sl-radius-pill);
    background: rgba(92,122,94,0.08);
    border: 1px solid rgba(92,122,94,0.16);
    color: var(--sl-sage);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sl-single-product-category:hover,
.sl-single-product-category:focus-visible,
.sl-single-product-category.is-current {
    background: rgba(92,122,94,0.12);
    border-color: rgba(92,122,94,0.26);
    color: var(--sl-sage);
    transform: translateY(-1px);
}

/* Product support actions */
.sl-product-support-actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.sl-product-support-actions .sl-btn-whatsapp,
.sl-btn.sl-btn-whatsapp.sl-btn-block,
.sl-product-support-actions a.sl-btn.sl-btn-whatsapp.sl-btn-block,
a.sl-btn.sl-btn-whatsapp.sl-btn-block {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border-radius: 14px;
    background: var(--sl-soft-green) !important;
    border: 1px solid rgba(92,122,94,0.2) !important;
    color: var(--sl-whatsapp-text-soft) !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    box-shadow: none !important;
    animation: none !important;
}

.sl-product-support-actions .sl-btn-whatsapp:hover,
.sl-product-support-actions .sl-btn-whatsapp:focus,
.sl-btn.sl-btn-whatsapp.sl-btn-block:hover,
.sl-btn.sl-btn-whatsapp.sl-btn-block:focus,
.sl-product-support-actions a.sl-btn.sl-btn-whatsapp.sl-btn-block:hover,
.sl-product-support-actions a.sl-btn.sl-btn-whatsapp.sl-btn-block:focus,
a.sl-btn.sl-btn-whatsapp.sl-btn-block:hover,
a.sl-btn.sl-btn-whatsapp.sl-btn-block:focus {
    background: var(--sl-sage) !important;
    border-color: var(--sl-sage) !important;
    color: var(--sl-white) !important;
    box-shadow: none !important;
}

.sl-product-summary .sl-btn-cod,
.sl-product-summary .sl-btn-whatsapp {
    width: 100%;
    justify-content: center;
    min-height: 52px;
    border-radius: 14px;
}

.sl-product-summary .sl-btn-whatsapp {
    width: 100% !important;
}

/* Product meta shell */
.sl-product-meta-shell {
    margin-top: 32px;
    padding: 24px;
    border: 1px solid var(--sl-sand);
    border-radius: 18px;
    background: var(--sl-white);
    box-shadow: var(--sl-shadow-soft);
}

.sl-product-meta-title {
    margin: 0 0 14px;
    color: var(--sl-charcoal);
    font-family: var(--sl-font-display);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
}

.sl-product-meta-shell .product_meta {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
/* ==========================================================
   SINGLE PRODUCT MOBILE SAFETY — PHASE 3 MERGE
   Prevents horizontal overflow and keeps gallery/summary
   aligned cleanly on small screens.
   ========================================================== */
@media (max-width: 767px) {
    html,
    body.single-product {
        overflow-x: hidden;
    }

    body.single-product .sl-wc-main,
    body.single-product .sl-wc-content,
    body.single-product .sl-single-product-wrap,
    body.single-product .sl-product-layout,
    body.single-product .sl-product-gallery-col,
    body.single-product .sl-product-summary,
    body.single-product .summary.entry-summary,
    body.single-product .woocommerce-product-gallery,
    body.single-product .woocommerce-product-gallery__wrapper,
    body.single-product .flex-viewport {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    body.single-product .woocommerce-product-gallery,
    body.single-product .woocommerce-product-gallery__image,
    body.single-product .woocommerce-product-gallery__image a,
    body.single-product .woocommerce-product-gallery__image img {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.single-product .woocommerce div.product div.images,
    body.single-product .woocommerce div.product div.summary {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        clear: both;
    }

    body.single-product .woocommerce div.product div.images .flex-control-thumbs {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px !important;
    }

    body.single-product .woocommerce div.product div.images .flex-control-thumbs li {
        flex: 0 0 60px;
    }

    body.single-product .sl-related-products-footer {
        margin-top: 14px;
    }

    body.single-product .sl-related-products-footer__link {
        width: 100%;
    }
}
/* ==========================================================
   STICKY MOBILE CART — SINGLE PRODUCT
   ========================================================== */
.sl-mobile-sticky-cart { display: none !important; }

@media (max-width: 767px) {
    body.single-product {
        padding-bottom: 104px;
    }

    body.single-product .sl-mobile-sticky-cart {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: rgba(248,244,239,0.98);
        border-top: 1px solid var(--sl-sand);
        box-shadow: 0 -10px 28px rgba(30,28,26,0.1);
        backdrop-filter: blur(8px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(16px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    }

    body.single-product.sl-mobile-sticky-cart-visible .sl-mobile-sticky-cart {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    body.single-product .sl-mobile-sticky-cart__price {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    body.single-product .sl-mobile-sticky-cart__label {
        font-size: 10px;
        line-height: 1;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--sl-mist);
        font-weight: 600;
    }

    body.single-product .sl-mobile-sticky-cart__value,
    body.single-product .sl-mobile-sticky-cart__value .price {
        font-size: 18px;
        line-height: 1.2;
        font-weight: 700;
        color: var(--sl-charcoal);
    }

    body.single-product .sl-mobile-sticky-cart__value del {
        opacity: 0.55;
        margin-right: 6px;
        font-size: 14px;
    }

    body.single-product .sl-mobile-sticky-cart__value ins {
        text-decoration: none;
    }

    body.single-product .sl-mobile-sticky-cart__actions {
        flex: 0 0 auto;
        display: flex;
    }

    body.single-product .sl-mobile-sticky-cart__button {
        min-height: 46px;
        padding: 12px 18px;
        white-space: nowrap;
    }

    body.single-product.sl-sticky-cart-disabled {
        padding-bottom: 0;
    }

    body.single-product.sl-sticky-cart-disabled .sl-mobile-sticky-cart {
        display: none !important;
    }
}

/* ==========================================================
   PHASE 4 SINGLE PRODUCT RESPONSIVE CLEANUP
   ========================================================== */
@media (max-width: 767px) {
    .sl-single-product-wrap > .sl-product-layout {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .sl-single-product-wrap > .sl-product-details-shell {
        margin-top: 40px !important;
        padding-top: 24px !important;
    }

    .sl-gallery {
        flex-direction: column-reverse;
    }

    .sl-gallery-thumbs {
        flex-direction: row;
    }

    .sl-gallery-thumb {
        width: 60px;
        height: 76px;
    }

    .woocommerce div.product .product_title {
        font-size: 28px;
    }

    .woocommerce div.product form.cart {
        grid-template-columns: 1fr;
    }

    .woocommerce div.product form.cart .qty,
    .woocommerce div.product form.cart .single_add_to_cart_button {
        width: 100%;
    }

    .sl-trust-lines {
        padding: 14px 16px;
    }

    .sl-product-meta-shell {
        padding: 18px;
        border-radius: 16px;
    }

    .sl-product-support-actions .sl-btn-whatsapp,
    .sl-btn.sl-btn-whatsapp.sl-btn-block,
    a.sl-btn.sl-btn-whatsapp.sl-btn-block {
        min-height: 54px;
        font-size: 13px;
        padding: 14px 18px;
    }
}


/* ==========================================================
   PHASE 1 PDP MOBILE UPGRADE — CTA / TRUST / STICKY / QUANTITY
   ========================================================== */
.sl-product-summary-inner--premium {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    margin-bottom: 12px;
}

.woocommerce div.product form.cart {
    gap: 14px;
    margin: 18px 0 0;
}

.woocommerce div.product form.cart .quantity,
.woocommerce div.product form.cart .sl-quantity {
    min-width: 120px;
}

.sl-trust-lines {
    gap: 12px;
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(227,235,228,0.78) 0%, rgba(223,232,224,0.94) 100%);
}

.sl-trust-line {
    align-items: flex-start;
    gap: 12px;
}

.sl-trust-line-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(92,122,94,0.16);
    background: rgba(255,255,255,0.88);
}

.sl-trust-line-icon::before {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    color: var(--sl-sage-dark);
    font-weight: 700;
}

.sl-trust-line-icon--dispatch::before {
    content: '✓';
}

.sl-trust-line-icon--payment::before {
    content: '₨';
}

.sl-trust-line-icon--returns::before {
    content: '↺';
}

.sl-product-support-actions {
    gap: 10px;
    margin-top: 14px;
}

.sl-product-summary .single_add_to_cart_button {
    min-height: 54px;
    border-radius: 14px !important;
}

.sl-product-summary .sl-btn-cod,
.sl-product-summary .sl-btn-whatsapp {
    min-height: 54px;
}

@media (max-width: 767px) {
    body.single-product {
        padding-bottom: 96px;
    }

    .woocommerce div.product .product_title {
        font-size: clamp(26px, 8vw, 34px);
        line-height: 1.1;
    }

    .woocommerce div.product p.price {
        margin-bottom: 10px !important;
    }

    .woocommerce div.product form.cart {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 14px;
    }

    .woocommerce div.product form.cart .quantity,
    .woocommerce div.product form.cart .sl-quantity {
        width: 100%;
        min-width: 0;
    }

    .woocommerce div.product form.cart .single_add_to_cart_button,
    .sl-product-summary .sl-btn-cod,
    .sl-product-summary .sl-btn-whatsapp {
        min-height: 52px;
        font-size: 13px !important;
    }

    .sl-quantity {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        width: 100%;
        min-height: 52px;
        border-radius: 14px;
    }

    .sl-qty-btn {
        width: 48px;
        min-width: 48px;
        font-size: 19px;
    }

    .sl-quantity .qty,
    .sl-quantity input.qty,
    .woocommerce .quantity .qty {
        width: 100%;
        min-width: 0;
        height: 52px;
        font-size: 17px;
    }

    .sl-trust-lines {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
        margin-bottom: 18px;
    }

    .sl-trust-line {
        gap: 12px;
        padding: 2px 0;
    }

    body.single-product .sl-mobile-sticky-cart {
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        border: 1px solid rgba(214, 204, 190, 0.92);
        border-radius: 18px;
        gap: 10px;
        padding: 10px 12px;
        background: rgba(248,244,239,0.96);
        box-shadow: 0 12px 28px rgba(30,28,26,0.12);
    }

    body.single-product .sl-mobile-sticky-cart__price {
        gap: 2px;
    }

    body.single-product .sl-mobile-sticky-cart__label {
        font-size: 9px;
    }

    body.single-product .sl-mobile-sticky-cart__value,
    body.single-product .sl-mobile-sticky-cart__value .price {
        font-size: 16px;
    }

    body.single-product .sl-mobile-sticky-cart__value del {
        font-size: 12px;
        margin-right: 4px;
    }

    body.single-product .sl-mobile-sticky-cart__button {
        min-height: 42px;
        padding: 10px 16px;
        border-radius: 999px !important;
        font-size: 12px !important;
        letter-spacing: 0.05em !important;
    }
}


/* ==========================================================
   PHASE 1.1 PDP CORRECTIVE OVERRIDES
   - lighter sticky bar
   - sticky visibility only after main CTA scrolls away
   - cleaner trust block rhythm
   ========================================================== */
@media (max-width: 767px) {
    body.single-product {
        padding-bottom: 92px;
    }

    body.single-product .sl-trust-lines {
        gap: 14px;
        padding: 16px 16px 14px;
        border-radius: 18px;
        margin-bottom: 18px;
    }

    body.single-product .sl-trust-line {
        align-items: flex-start;
        gap: 12px;
    }

    body.single-product .sl-trust-line-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        margin-top: 1px;
    }

    body.single-product .sl-trust-line-title {
        font-size: 12px;
        line-height: 1.35;
    }

    body.single-product .sl-trust-line-text {
        font-size: 11px;
        line-height: 1.5;
    }

    body.single-product .sl-product-details-shell {
        margin-top: 34px !important;
        padding-top: 20px !important;
    }

    body.single-product .sl-mobile-sticky-cart {
        left: 14px;
        right: 14px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        border: 1px solid rgba(196, 186, 173, 0.82);
        border-top: 1px solid rgba(196, 186, 173, 0.82);
        border-radius: 22px;
        padding: 10px 12px;
        gap: 10px;
        box-shadow: 0 14px 34px rgba(30, 28, 26, 0.12);
        backdrop-filter: blur(10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(16px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    }

    body.single-product.sl-mobile-sticky-cart-visible .sl-mobile-sticky-cart {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    body.single-product .sl-mobile-sticky-cart__price {
        gap: 3px;
    }

    body.single-product .sl-mobile-sticky-cart__label {
        font-size: 9px;
        letter-spacing: 0.12em;
    }

    body.single-product .sl-mobile-sticky-cart__value,
    body.single-product .sl-mobile-sticky-cart__value .price {
        font-size: 16px;
        line-height: 1.15;
    }

    body.single-product .sl-mobile-sticky-cart__value del {
        font-size: 13px;
        margin-right: 5px;
    }

    body.single-product .sl-mobile-sticky-cart__button {
        min-height: 42px;
        padding: 10px 16px;
        border-radius: 999px;
        font-size: 12px !important;
        letter-spacing: 0.05em !important;
    }

    body.single-product.sl-sticky-cart-disabled {
        padding-bottom: 0;
    }

    body.single-product.sl-sticky-cart-disabled .sl-mobile-sticky-cart {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}


/* ==========================================================
   PHASE 3B MOBILE PRODUCT GALLERY STABILITY
   ========================================================== */
body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    touch-action: manipulation;
}

body.single-product .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce-product-gallery__image,
body.single-product .woocommerce-product-gallery__image a,
body.single-product .woocommerce-product-gallery__image img {
    backface-visibility: hidden;
}

@media (max-width: 767px) {
    body.single-product .woocommerce-product-gallery .flex-control-thumbs {
        overscroll-behavior-x: contain;
    }

    body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
        min-width: 60px;
    }
}

/* ==========================================================
   PHASE 3C MOBILE WOO GALLERY BLANK-FIX OVERRIDE
   ========================================================== */
@media (max-width: 900px) {
    body.single-product .woocommerce-product-gallery.sl-mobile-gallery-direct-active .woocommerce-product-gallery__wrapper {
        transform: translate3d(0, 0, 0) !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transition-duration: 0s !important;
        -webkit-transition-duration: 0s !important;
    }

    body.single-product .woocommerce-product-gallery.sl-mobile-gallery-direct-active .woocommerce-product-gallery__image:first-child,
    body.single-product .woocommerce-product-gallery.sl-mobile-gallery-direct-active .woocommerce-product-gallery__image:first-child a,
    body.single-product .woocommerce-product-gallery.sl-mobile-gallery-direct-active .woocommerce-product-gallery__image:first-child img {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }

    body.single-product .woocommerce-product-gallery.sl-mobile-gallery-direct-active .woocommerce-product-gallery__image:first-child img {
        width: 100% !important;
        height: auto !important;
        min-height: 1px;
    }

    body.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
        opacity: 1 !important;
        border-color: var(--sl-sage) !important;
    }
}

/* ==========================================================
   PHASE 3D SERVER-RENDERED MOBILE PRODUCT GALLERY
   ========================================================== */
body.single-product .sl-mobile-product-gallery {
    display: none;
}

@media (max-width: 900px) {
    body.single-product .sl-product-gallery-col > .woocommerce-product-gallery {
        display: none !important;
    }

    body.single-product .sl-mobile-product-gallery {
        display: block;
        width: 100%;
        margin: 0 0 14px;
    }

    body.single-product .sl-mobile-product-gallery__main-link {
        display: block;
        width: 100%;
        border-radius: 22px;
        overflow: hidden;
        background: #f8f5ef;
        box-shadow: 0 18px 42px rgba(38, 34, 29, 0.08);
        text-decoration: none;
        aspect-ratio: 4 / 5;
    }

    body.single-product .sl-mobile-product-gallery__main-image {
        display: block;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        object-position: center;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.single-product .sl-mobile-product-gallery.is-loading .sl-mobile-product-gallery__main-image {
        opacity: 0.45 !important;
    }

    body.single-product .sl-mobile-product-gallery__thumbs {
        display: flex;
        gap: 10px;
        margin: 12px -2px 0;
        padding: 2px 2px 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    body.single-product .sl-mobile-product-gallery__thumb {
        flex: 0 0 68px;
        width: 68px;
        height: 84px;
        padding: 0;
        border: 2px solid rgba(32, 32, 32, 0.08);
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        cursor: pointer;
        scroll-snap-align: start;
        box-shadow: 0 8px 18px rgba(38, 34, 29, 0.06);
    }

    body.single-product .sl-mobile-product-gallery__thumb.is-active {
        border-color: var(--sl-sage);
        box-shadow: 0 10px 22px rgba(92, 122, 94, 0.18);
    }

    body.single-product .sl-mobile-product-gallery__thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* ==========================================================
   PHASE 3E MOBILE PRODUCT GALLERY SWIPE FEEL
   ========================================================== */
@media (max-width: 900px) {
    body.single-product .sl-mobile-product-gallery__main-link {
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
        -webkit-user-drag: none;
    }

    body.single-product .sl-mobile-product-gallery__main-image {
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    body.single-product .sl-mobile-product-gallery.is-swiping .sl-mobile-product-gallery__main-image {
        opacity: 0.82 !important;
    }
}

/* ==========================================================
   PHASE 4A SINGLE PRODUCT PAGE CLARITY POLISH
   Mobile-first PDP clarity + premium spacing
   ========================================================== */

/* ---------- Desktop / shared refinement ---------- */
body.single-product .sl-product-layout--premium {
    gap: clamp(34px, 5vw, 64px);
}

body.single-product .sl-product-summary-inner--premium {
    position: relative;
    gap: 14px;
}

body.single-product .sl-product-gallery-col--premium {
    min-width: 0;
}

@media (min-width: 992px) {
    body.single-product .sl-product-gallery-col--premium {
        position: sticky;
        top: 96px;
    }

    body.single-product .sl-product-summary-inner--premium {
        padding: 6px 0 0;
    }
}

/* Category route chips */
body.single-product .sl-single-product-category-trail {
    gap: 8px;
    margin-bottom: 14px;
}

body.single-product .sl-single-product-category {
    min-height: 32px;
    padding: 7px 12px;
    border-color: rgba(92,122,94,0.18);
    background: rgba(92,122,94,0.075);
    color: var(--sl-sage-dark);
}

/* Title / price / short description rhythm */
body.single-product .woocommerce div.product .product_title,
body.single-product .woocommerce div.product .summary .product_title {
    margin: 0 0 8px;
    color: var(--sl-charcoal);
    max-width: 13ch;
}

body.single-product .woocommerce div.product p.price {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    width: fit-content;
    margin: 4px 0 12px !important;
    padding: 9px 13px;
    border: 1px solid rgba(214,204,190,0.82);
    border-radius: 999px;
    background: rgba(255,255,255,0.82);
    box-shadow: 0 8px 22px rgba(38,34,29,0.045);
}

body.single-product .woocommerce div.product .woocommerce-product-details__short-description {
    margin: 2px 0 16px;
    padding: 15px 16px;
    border: 1px solid rgba(214,204,190,0.72);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(250,246,239,0.74));
    color: rgba(32,32,32,0.72);
    font-size: 15px;
    line-height: 1.7;
    max-width: 58ch;
}

body.single-product .woocommerce div.product .woocommerce-product-details__short-description p {
    margin: 0;
}

/* Main purchase form */
body.single-product .woocommerce div.product form.cart {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(214,204,190,0.74);
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 12px 28px rgba(38,34,29,0.045);
}

body.single-product .woocommerce div.product form.cart .single_add_to_cart_button {
    min-height: 54px;
    border-radius: 14px !important;
    box-shadow: 0 12px 24px rgba(92,122,94,0.14);
}

body.single-product .woocommerce div.product form.cart .single_add_to_cart_button:hover,
body.single-product .woocommerce div.product form.cart .single_add_to_cart_button:focus {
    transform: translateY(-1px);
}

/* Trust and support */
body.single-product .sl-trust-lines {
    margin-top: 14px;
    margin-bottom: 16px;
    border-color: rgba(92,122,94,0.16);
    background: linear-gradient(180deg, rgba(240,246,240,0.84), rgba(231,240,232,0.88));
    box-shadow: 0 12px 28px rgba(38,34,29,0.045);
}

body.single-product .sl-trust-line-title {
    font-weight: 800;
    letter-spacing: -0.01em;
}

body.single-product .sl-product-support-actions {
    gap: 10px;
    margin-top: 12px;
}

body.single-product .sl-product-summary .sl-btn-cod {
    background: var(--sl-charcoal);
    color: #fff;
    border-color: var(--sl-charcoal);
    box-shadow: 0 12px 24px rgba(32,32,32,0.12);
}

body.single-product .sl-product-summary .sl-btn-cod:hover,
body.single-product .sl-product-summary .sl-btn-cod:focus {
    background: var(--sl-sage-dark);
    border-color: var(--sl-sage-dark);
    color: #fff;
}

body.single-product .sl-product-summary .sl-btn-whatsapp {
    background: rgba(92,122,94,0.08) !important;
    border-color: rgba(92,122,94,0.18) !important;
    color: var(--sl-sage-dark) !important;
}

/* Details shell */
body.single-product .sl-product-details-shell--premium {
    border-top-color: rgba(214,204,190,0.86);
}

body.single-product .sl-product-detail-item--premium {
    border: 1px solid rgba(214,204,190,0.78);
    border-radius: 18px;
    background: rgba(255,255,255,0.78);
    overflow: hidden;
}

body.single-product .sl-product-detail-item--premium + .sl-product-detail-item--premium {
    margin-top: 10px;
}

body.single-product .sl-product-detail-item--premium summary {
    min-height: 54px;
}

/* Keep browsing chips */
body.single-product .sl-single-product-browse-more {
    border-radius: 22px;
    background: rgba(250,246,239,0.82);
    border: 1px solid rgba(214,204,190,0.70);
}

/* ---------- Mobile clarity ---------- */
@media (max-width: 900px) {
    body.single-product .sl-product-layout--premium {
        gap: 18px !important;
    }

    body.single-product .sl-mobile-product-gallery {
        margin-bottom: 12px;
    }

    body.single-product .sl-mobile-product-gallery__main-link {
        border-radius: 20px;
        box-shadow: 0 14px 32px rgba(38,34,29,0.08);
    }

    body.single-product .sl-mobile-product-gallery__thumbs {
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-top: 10px;
        padding-bottom: 4px;
    }

    body.single-product .sl-mobile-product-gallery__thumbs::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.single-product .sl-mobile-product-gallery__thumb {
        flex-basis: 62px;
        width: 62px;
        height: 78px;
        border-radius: 13px;
    }

    body.single-product .sl-product-summary-inner--premium {
        gap: 12px;
        padding: 18px 16px 16px;
        border: 1px solid rgba(214,204,190,0.72);
        border-radius: 24px;
        background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,246,239,0.84));
        box-shadow: 0 16px 38px rgba(38,34,29,0.07);
    }

    body.single-product .sl-single-product-category-trail {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        margin: -2px -16px 10px;
        padding: 2px 16px 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    body.single-product .sl-single-product-category-trail::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.single-product .sl-single-product-category {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    body.single-product .woocommerce div.product .product_title,
    body.single-product .woocommerce div.product .summary .product_title {
        max-width: 100%;
        font-size: clamp(28px, 8.4vw, 36px);
        line-height: 1.08;
        letter-spacing: -0.035em;
    }

    body.single-product .woocommerce div.product p.price {
        width: 100%;
        justify-content: flex-start;
        margin-top: 2px !important;
        margin-bottom: 8px !important;
        padding: 11px 13px;
        border-radius: 16px;
        font-size: 22px !important;
    }

    body.single-product .woocommerce div.product .woocommerce-product-details__short-description {
        margin-bottom: 10px;
        padding: 13px 14px;
        border-radius: 16px;
        font-size: 15px;
        line-height: 1.62;
    }

    body.single-product .woocommerce div.product form.cart {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 10px;
        padding: 12px;
        border-radius: 18px;
    }

    body.single-product .woocommerce div.product form.cart .single_add_to_cart_button,
    body.single-product .sl-product-summary .sl-btn-cod,
    body.single-product .sl-product-summary .sl-btn-whatsapp {
        min-height: 52px;
        border-radius: 14px !important;
        font-size: 12px !important;
        letter-spacing: 0.06em !important;
    }

    body.single-product .sl-product-support-actions {
        gap: 9px;
        margin-top: 10px;
    }

    body.single-product .sl-trust-lines {
        gap: 10px;
        margin-top: 10px;
        margin-bottom: 12px;
        padding: 13px;
        border-radius: 18px;
    }

    body.single-product .sl-trust-line {
        gap: 10px;
    }

    body.single-product .sl-trust-line-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    body.single-product .sl-trust-line-title {
        font-size: 12px;
    }

    body.single-product .sl-trust-line-text {
        font-size: 11px;
        line-height: 1.45;
    }

    body.single-product .sl-product-details-shell--premium {
        margin-top: 24px !important;
        padding-top: 18px !important;
    }

    body.single-product .sl-product-detail-item--premium summary {
        min-height: 50px;
        padding-inline: 14px;
    }

    body.single-product .sl-product-detail-content {
        font-size: 14px;
        line-height: 1.75;
    }

    body.single-product .sl-mobile-sticky-cart {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(10px + env(safe-area-inset-bottom)) !important;
        border-radius: 22px !important;
    }
}

@media (max-width: 420px) {
    body.single-product .sl-product-summary-inner--premium {
        padding: 16px 14px 15px;
        border-radius: 22px;
    }

    body.single-product .woocommerce div.product .product_title,
    body.single-product .woocommerce div.product .summary .product_title {
        font-size: clamp(27px, 8.8vw, 34px);
    }

    body.single-product .woocommerce div.product p.price {
        font-size: 21px !important;
    }

    body.single-product .sl-mobile-product-gallery__thumb {
        flex-basis: 58px;
        width: 58px;
        height: 72px;
    }
}


/* ==========================================================
   PHASE 4B SINGLE PRODUCT STICKY CART + LOWER PAGE POLISH
   ========================================================== */
@media (max-width: 900px) {
    /*
     * Sticky cart should not sit on top of the first product image.
     * JS adds body.sl-show-mobile-sticky-cart only after the main cart form has passed.
     */
    body.single-product .sl-mobile-sticky-cart {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(18px) !important;
        transition:
            opacity 0.22s ease,
            transform 0.22s ease,
            visibility 0.22s ease !important;
    }

    body.single-product.sl-show-mobile-sticky-cart .sl-mobile-sticky-cart {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    body.single-product .sl-mobile-sticky-cart {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(10px + env(safe-area-inset-bottom)) !important;
        max-width: none !important;
        border-radius: 22px !important;
        border: 1px solid rgba(214, 204, 190, 0.85) !important;
        background: rgba(255, 252, 247, 0.96) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 18px 42px rgba(38, 34, 29, 0.16) !important;
    }

    body.single-product .sl-mobile-sticky-cart .button,
    body.single-product .sl-mobile-sticky-cart button,
    body.single-product .sl-mobile-sticky-cart .single_add_to_cart_button {
        border-radius: 18px !important;
    }

    /*
     * Give the bottom of PDP enough breathing room when sticky bar is visible.
     */
    body.single-product.sl-show-mobile-sticky-cart .site-footer,
    body.single-product.sl-show-mobile-sticky-cart footer {
        padding-bottom: calc(118px + env(safe-area-inset-bottom));
    }

    /*
     * Lower PDP sections: reduce accidental oversized gaps and keep cards readable.
     */
    body.single-product .sl-product-details-shell--premium {
        margin-bottom: 26px !important;
    }

    body.single-product .sl-single-product-browse-more {
        margin-top: 28px;
        margin-bottom: 30px;
        padding: 20px 18px;
        border-radius: 22px;
    }

    body.single-product .sl-single-product-browse-more .sl-section-eyebrow,
    body.single-product .sl-single-product-browse-more h2,
    body.single-product .sl-single-product-browse-more h3 {
        margin-top: 0;
    }

    body.single-product .related,
    body.single-product .related.products,
    body.single-product .upsells,
    body.single-product .upsells.products,
    body.single-product .sl-related-products,
    body.single-product .sl-product-recommendations {
        margin-top: 28px !important;
    }

    body.single-product .related.products > h2,
    body.single-product .upsells.products > h2,
    body.single-product .sl-related-products .sl-section-title,
    body.single-product .sl-product-recommendations .sl-section-title {
        font-size: clamp(34px, 9.6vw, 42px);
        line-height: 1.04;
        letter-spacing: -0.035em;
    }

    body.single-product .related.products .sl-view-all,
    body.single-product .upsells.products .sl-view-all,
    body.single-product .sl-related-products .sl-view-all,
    body.single-product .sl-product-recommendations .sl-view-all {
        min-height: 42px;
        padding: 10px 16px;
        border-radius: 999px;
    }

    /*
     * Route chips on product summary should feel intentional, not cut.
     */
    body.single-product .sl-single-product-category-trail {
        mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
    }

    /*
     * If the sticky cart exists, avoid the last related card/keep browsing area feeling trapped.
     */
    body.single-product .site-main,
    body.single-product main {
        padding-bottom: 18px;
    }
}
