/* ==========================================
   PRODUCT PAGE
========================================== */

.product-page{
    padding:26px 5% 70px;
}

.breadcrumb{
    max-width:1200px;
    margin:0 auto 26px;
    font-size:.78rem;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:var(--muted);
}

.breadcrumb a:hover{
    color:var(--accent);
}

.breadcrumb span{
    margin:0 8px;
    color:var(--gold);
}

.product-container{
    max-width:1200px;
    margin:auto;
    display:grid;
    grid-template-columns:1.05fr 1fr;
    gap:60px;
    align-items:start;
}

/* ==========================================
   IMAGE
========================================== */

.back-btn{
    display:flex;
    align-items:center;
    gap:10px;
    /* Lines up with the left edge of the page content */
    margin:0 0 14px max(0px,calc((100% - 1200px) / 2));
    padding:8px 16px 8px 12px;
    border-radius:40px;
    border:1px solid var(--line);
    background:var(--surface);
    font-size:.8rem;
    font-weight:500;
    letter-spacing:.12em;
    text-transform:uppercase;
    transition:border-color .3s,color .3s,transform .3s var(--ease);
}

.back-btn:hover{
    border-color:var(--accent);
    color:var(--accent);
    transform:translateX(-3px);
}

/* Thumbnails sit beside the photo on wide screens, so they are seen without scrolling */

.product-gallery{
    position:sticky;
    top:calc(var(--header-h) + 20px);
    display:flex;
    align-items:flex-start;
    gap:12px;
    animation:fadeUp .9s var(--ease) both;
}

.gallery-main{
    flex:1;
    min-width:0;
    background:var(--bg-soft);
    border:1px solid var(--line);
    border-radius:18px;
    overflow:hidden;
}

.gallery-main img,
.gallery-main video{
    display:block;
    width:100%;
    aspect-ratio:4/5;
    object-fit:cover;
    transition:transform 1.2s var(--ease);
}

.gallery-main video{
    object-fit:contain;
    background:#1b1413;
}

.gallery-main:hover img{
    transform:scale(1.06);
}

.gallery-thumbs{
    order:-1;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.gallery-thumb{
    position:relative;
    width:72px;
    height:90px;
    flex:none;
    padding:0;
    border-radius:10px;
    overflow:hidden;
    border:2px solid transparent;
    background:var(--bg-soft);
    opacity:.75;
    transition:border-color .3s,opacity .3s,transform .3s var(--ease);
}

.gallery-thumb:hover{
    opacity:1;
    transform:translateY(-2px);
}

.gallery-thumb.active{
    border-color:var(--accent);
    opacity:1;
}

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

.gallery-thumb.is-video{
    display:grid;
    place-items:center;
    background:#3d2a2b;
    color:#fff;
    font-size:1.2rem;
}

/* ==========================================
   DETAILS
========================================== */

.product-details{
    display:flex;
    flex-direction:column;
    padding-top:10px;
}

.product-details > *{
    animation:fadeUp .8s var(--ease) both;
}

.product-details > :nth-child(2){ animation-delay:.08s; }
.product-details > :nth-child(3){ animation-delay:.16s; }
.product-details > :nth-child(4){ animation-delay:.24s; }
.product-details > :nth-child(5){ animation-delay:.32s; }
.product-details > :nth-child(6){ animation-delay:.4s; }
.product-details > :nth-child(7){ animation-delay:.48s; }
.product-details > :nth-child(8){ animation-delay:.56s; }

.product-details .product-category{
    font-size:.74rem;
    letter-spacing:.3em;
    margin-bottom:12px;
}

.product-details h1{
    font-size:clamp(2rem,3.6vw,3.1rem);
    margin-bottom:14px;
}

/* Stars under the name, leading to the reviews further down */

.product-details .product-rating{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-bottom:18px;
    color:#e0a526;
    font-size:.95rem;
}

.product-details .product-rating span{
    color:var(--muted);
    text-decoration:underline;
    text-underline-offset:3px;
}

.price-box{
    display:flex;
    align-items:baseline;
    flex-wrap:wrap;
    gap:8px 14px;
    padding-bottom:22px;
    margin-bottom:22px;
    border-bottom:1px solid var(--line);
}

.price-box .current-price{
    font-size:2rem;
    color:var(--accent);
}

.price-box .old-price{
    font-size:1.1rem;
}

.price-box .discount{
    font-size:.95rem;
}

/* Hide the empty layout until the product has loaded */

.product-page.loading .product-container,
.product-page.loading .breadcrumb{
    visibility:hidden;
}

.product-page.loading .gallery-thumbs{
    display:none;
}

.stock-note{
    color:var(--accent);
    font-weight:500;
    line-height:1.4;
    margin-bottom:14px;
}

.stock-note:empty{
    display:none;
}

.stock-note.sold-out{
    color:var(--danger);
}

.product-buttons .btn:disabled{
    opacity:.5;
    cursor:not-allowed;
    transform:none;
}

#productDescription{
    font-size:1.02rem;
    margin-bottom:28px;
}

/* ==========================================
   SIZES OR COLOURS
========================================== */

.option-box{
    margin-bottom:24px;
}

.option-title{
    display:block;
    margin-bottom:10px;
    font-size:.76rem;
    font-weight:500;
    letter-spacing:.2em;
    text-transform:uppercase;
    color:var(--muted);
}

.option-list{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.option-chip{
    min-width:54px;
    min-height:44px;
    padding:8px 16px;
    border:1px solid rgba(53,34,31,.3);
    border-radius:10px;
    background:var(--surface);
    color:var(--text);
    font-size:.96rem;
    font-weight:500;
    overflow-wrap:anywhere;
    transition:border-color .3s,box-shadow .3s,background .3s;
}

.option-chip:hover{
    border-color:var(--accent);
}

.option-chip.chosen{
    border-color:var(--accent);
    background:#fff;
    color:var(--accent);
    box-shadow:0 0 0 2px var(--accent);
}

/* Still tappable, so a buyer can see it is gone and ask for it */

.option-chip.sold-out{
    color:var(--muted);
    text-decoration:line-through;
    border-style:dashed;
    background:transparent;
}

.option-error{
    margin-top:10px;
    color:var(--danger);
    font-weight:500;
    line-height:1.4;
}

.option-error:empty{
    display:none;
}

/* ==========================================
   QUANTITY
========================================== */

.quantity-box{
    display:inline-flex;
    align-items:center;
    align-self:flex-start;
    border:1px solid var(--line);
    border-radius:50px;
    background:var(--surface);
    margin-bottom:26px;
}

.quantity-box button{
    width:46px;
    height:46px;
    border-radius:50%;
    font-size:20px;
    color:var(--text);
    transition:background .3s,color .3s;
}

.quantity-box button:hover{
    background:var(--fill);
    color:var(--on-fill);
}

#quantity{
    min-width:40px;
    text-align:center;
    font-size:1.05rem;
    font-weight:500;
}

/* ==========================================
   BUTTONS
========================================== */

.product-buttons{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
}

.product-buttons .btn{
    flex:1;
    min-width:190px;
}

/* ==========================================
   TELL ME WHEN IT'S BACK
========================================== */

.notify-box{
    margin-top:18px;
    padding:18px 20px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:var(--surface);
}

.notify-box strong{
    display:block;
    font-weight:500;
    color:var(--text);
}

.notify-box p{
    margin-top:4px;
    font-size:.93rem;
    line-height:1.5;
}

.notify-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:12px;
}

.notify-row input{
    flex:1 1 180px;
    min-width:0;
    padding:12px 16px;
    border:1px solid rgba(53,34,31,.3);
    border-radius:50px;
    background:#fff;
    color:var(--text);
    font:inherit;
}

.notify-row input:focus{
    outline:none;
    border-color:var(--accent);
}

.notify-row .btn{
    flex:none;
}

.notify-row .btn:disabled{
    opacity:.5;
    cursor:not-allowed;
}

/* ==========================================
   PERKS
========================================== */

.product-perks{
    display:grid;
    gap:12px;
    margin-top:30px;
    padding:20px 22px;
    border-radius:var(--radius);
    background:var(--bg-soft);
}

.product-perks li{
    display:flex;
    align-items:center;
    gap:14px;
    font-size:.93rem;
    color:var(--text);
}

/* Order on WhatsApp */

.whatsapp-order{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:10px;
    margin-top:12px;
    padding:13px 20px;
    border-radius:50px;
    border:1px solid var(--success);
    background:rgba(255,255,255,.55);
    color:var(--success);
    font-size:.82rem;
    font-weight:500;
    letter-spacing:.16em;
    text-transform:uppercase;
    transition:background .3s,color .3s,transform .4s var(--ease);
}

.whatsapp-order i{
    font-size:1.25rem;
}

.whatsapp-order:hover{
    background:var(--success);
    color:#fff;
    transform:translateY(-2px);
}

.product-page.loading .whatsapp-order{
    display:none;
}

.product-perks i{
    width:20px;
    text-align:center;
    color:var(--accent);
}

/* ==========================================
   MOBILE
========================================== */

@media(max-width:992px){

    .product-container{
        grid-template-columns:1fr;
        gap:28px;
    }

    .product-gallery{
        position:static;
        flex-direction:column;
        align-items:stretch;
    }

    /* On phones the thumbnails go in a row under the photo */

    .gallery-thumbs{
        order:0;
        flex-direction:row;
    }

}

@media(max-width:768px){

    .product-page{
        padding:18px 16px 50px;
    }

    .product-buttons .btn{
        min-width:100%;
    }

}
