*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}




/* =========================================================
   PAGE WRAPPER (Fluid outer, fixed inner at 1400px)
========================================================= */

.product-page {
    width: 100%;
    margin-bottom: 100px;
}

@media (min-width: 1400px) {
    .product-page {
        padding-inline: 40px;
    }
}

/* =========================================================
   PRODUCT LAYOUT
========================================================= */

.product-layout {
    max-width: 1400px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    min-width: 0;
}


/* =========================================================
   IMAGE GALLERY
========================================================= */

.product-image-gallery-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-width: 0; /* 🔑 critical */
}

@media (min-width: 1024px) {
    .product-image-gallery-wrapper {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .product-info {
        flex: 0 0 50%;
        max-width: 50%;
    }
}


.product-image-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    max-height: min(60vh, 720px);
}

.product-image-gallery::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 100%;
    min-width: 0; /* 🔑 */
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
}

.gallery-image {
    width: 300px;
    aspect-ratio: 6 / 7;   /* 👈 forces 6:7 ratio */
    object-fit: cover;     /* 👈 crops image to fill the box */
    display: block;
}



/* Counter */
.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #000;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 10;
}

 /* Gallery navigation */
    .gallery-nav {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: rgba(0,0,0,0.6);
        color: #fff;
        font-size: 24px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 20;
        border: none;
    }

    .gallery-nav.prev { left: 12px; }
    .gallery-nav.next { right: 12px; }

    .gallery-nav:hover {
        background: rgba(0,0,0,0.8);
    }


/* =========================================================
   PRODUCT INFO
========================================================= */

.product-info {
    flex: 1;
    padding-inline: 10px;
    min-width: 0; /* 🔑 */
}

.brand {
    padding: 10px;
}

.brand img {
    width: 40px;
    height: auto;
}

/* Title */
.title {
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 20px;
    font-weight: 500;
    color: #000;
    margin-bottom: 25px;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-height: calc(1.3em * 2);
}

/* Price */
.price-regular {
    font-size: 25px;
    font-weight: 600;
    text-decoration: line-through;
    opacity: 0.5;
    margin-right: 8px;
}

.price-sale,
.price-normal {
    font-size: 25px;
    font-weight: 600;
}

/* =========================================================
   PRODUCT SIZES
========================================================= */

.product-sizes-wrapper {
    margin: 50px 0 16px;
}

.size-label-title {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 500;
}

.product-sizes {
    display: flex;
    gap: 10px;
}

/* Size button */
.size-button {
    cursor: pointer;
}

.size-input {
    display: none;
}

.size-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.size-input:checked + .size-text {
    background: #222;
    border-color: #222;
    color: #fff;
}

.size-button:hover .size-text {
    border-color: #222;
}

/* =========================================================
   ADD TO BAG BAR (Mobile First)
========================================================= */

.add-to-bag-bar {
    margin-top: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Top row */
.top-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Quantity */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 40px;
}

.qty-btn {
    color: black;
    width: 36px;
    height: 40px;
    background: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

#qty {

    width: 32px;
    text-align: center;
    font-weight: 500;
}

/* Add to bag */
.add-to-cart-button {
    flex: 1;
    height: 40px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.add-to-cart-button.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-to-cart-button.is-added {
    background: #000;
    color: #fff;
}


.add-to-cart-button:disabled,
.add-to-cart-button.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}












/* Stash button */
.stash-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 10px;
    background: #222;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}


/* SVG */
.stash-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    pointer-events: none;
}

.stash-button:hover {
    border-color: #000;
}



/* When stashed */
.stash-button.is-stashed {
    border: none;
    background: #ccc;
    color: #666;
}

/* Hover effect */
.stash-button:hover {
    transform: scale(1.1);
}



.stash-button::after {
    content: attr(data-label);

    position: absolute;
    top: -35px;
    right: 50%;
    transform: translateX(50%);

    border: 1px solid #ddd;

    background: black;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;

    white-space: nowrap;

    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

.stash-button:hover::after {
    opacity: 1;
    transform: translateX(50%) translateY(-4px);
}



















/* =========================
   OVERLAY (BACKGROUND)
========================= */


#stash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);

    opacity: 0;
    pointer-events: none;

    z-index: 9998;
}

#stash-overlay.show {
    opacity: 1;
    pointer-events: auto; /* 🔥 THIS is critical */
}



/* =========================
   POPUP (BOTTOM SLIDE)
========================= */
#stash-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    
    transform: translateY(100%);
    transition: transform 0.35s ease;

    z-index: 9999;
}

#stash-popup.show {
    transform: translateY(0);
}


/* =========================
   CONTENT
========================= */
.stash-popup-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

#stash-popup-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}


/* =========================
   BUTTON
========================= */
.stash-view-btn {
    display: block;
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background: #000;
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
}




/* =========================
   CLOSE BUTTON
========================= */
.stash-close {
    position: absolute;
    top: 10px;
    right: 15px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.stash-close svg{
    width: 18px;
}

body.stash-open {
    overflow: hidden;
    height: 100vh;
    scrollbar-gutter: stable;
}

#stash-popup-brand-img{
    width: 20px;
}

#stash-popup-name{
    font-size: 18px;
    font-weight: 600;
    opacity: 0.5;
}

#stash-popup-price{
    font-size: 20px;
    font-weight: 600;
    margin-right: 8px;
}





/* =========================
   DESKTOP (TOP RIGHT POPUP)
========================= */
@media (min-width: 1025px) {

    #stash-popup {
        top: 0;
        right: 0;
        left: auto;
        bottom: auto;

        width: 380px;      /* adjust width */
        height: 100vh;     /* 🔥 full height */

        transition: none;

        border-radius: 0;  /* remove rounded corners for panel feel */

        transform: translateX(100%); /* slide in from right */
        

        display: flex;
        flex-direction: column;
    }

    #stash-popup.show {
        flex: 1;
        transform: translateX(0);
        transition: transform 0.35s ease;
    }

    .stash-view-btn {
        margin-top: auto; /* 🔥 pushes it to bottom */
    }
}


@media (max-width: 1024px) {
    #stash-popup {
        transition: none;
    }

    #stash-popup.show {
        transition: transform 0.35s ease;
    }
}




/* =========================================================
   DESKTOP ≥1024px
========================================================= */

@media (min-width: 1025px) {

    .product-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .product-image-gallery-wrapper {
        width: 60%;
    }

    .product-info {
        width: 40%;
    }

    .title {
        font-size: 25px;
        font-weight: 600;
        margin: 20px 0;
    }

   

    /* Add to bag desktop layout */
    .add-to-bag-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .top-row {
        justify-content: space-between;
    }

    .add-to-cart-button {
        width: 100%;
        min-height: 40px;
    }
}

/* =========================================================
   LARGE DESKTOP ≥1200px
========================================================= */

@media (min-width: 1200px) {
    .add-to-bag-bar {
        flex-direction: row;
    }
}










/* =========================================================
   PRODUCT TABS – FLUID OUTER / CAPPED INNER
========================================================= */

.product-tabs-section {
    width: 100%;
    padding-inline: 20px;
}

@media (min-width: 1400px) {
    .product-tabs-section {
        padding-inline: 40px;
    }
}

/* Inner capped container */
.product-tabs-inner {
    max-width: 1400px;
    margin-inline: auto;
}

/* =========================================================
   TAB NAV
========================================================= */

.product-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #ddd;
    margin-top: 40px;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn.active {
    color: #000;
    border-bottom: 2px solid #000;
}

/* =========================================================
   TAB CONTENT
========================================================= */

.tab-content {
    max-width: 100%;
    overflow-wrap: break-word;
    display: none;
    font-size: 16px;
    line-height: 1.7;
    color: #222;
    max-width: 900px; /* 👈 readable text width */
}

.tab-content.active {
    display: block;
}

/* Woo content spacing cleanup */
.tab-content p {
    margin-bottom: 16px;
}

.tab-content ul {
    padding-left: 18px;
}




/* =========================================================
   DESKTOP REFINEMENTS
========================================================= */

@media (min-width: 1024px) {
    .tab-btn {
        font-size: 20px;
    }

    .tab-content {
        font-size: 17px;
    }
}









/* =====================================
   RELATED PRODUCTS – FLEX RESPONSIVE
===================================== */

/* Container */
.related-products-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Product card – MOBILE FIRST (2 per row) */
.related-product-image {
    display: flex;
    flex-direction: column;
    flex: 0 0 calc(50% - 6px);
    text-decoration: none;
    color: inherit;
}

/* Image – natural size, no cropping */
.related-product-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Brand name */
.product-brand {
    margin-top: 8px;
    font-size: 12px;
    text-transform: uppercase;
    color: #000;
}

/* Product name – EXACTLY 2 LINES */
.product-name {
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    height: calc(1.4em * 2);
    color: #777;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price */
.product-price {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

/* ===============================
   BREAKPOINTS
================================ */

/* Small tablets / large phones → 3 per row */
@media (min-width: 600px) {
    .related-product-image {
        flex: 0 0 calc(33.333% - 8px);
    }
}

/* Tablets → 4 per row */
@media (min-width: 900px) {
    .related-product-image {
        flex: 0 0 calc(25% - 9px);
    }
}

/* Desktop → 5 per row */
@media (min-width: 1200px) {
    .related-product-image {
        flex: 0 0 calc(20% - 10px);
    }
}


