/* ==========================================================================
   pdp.css — the product page
   ========================================================================== */

.pd-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-block: var(--space-5) var(--space-4);
    font-size: var(--fs-xs);
    color: var(--muted);
}
.pd-crumbs a:hover { color: var(--ink); }

/* Two columns: gallery on the right (start), buy panel on the left */
.pd {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--space-8);
    align-items: start;
}
@media (max-width: 899px) { .pd { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); } }

/* ---------- Gallery ---------- */
.pgal {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);      /* thumbnails column, then the stage */
    gap: var(--space-3);
}
.pgal__thumbs { grid-column: 1; grid-row: 1; display: grid; align-content: start; gap: var(--space-2); }
.pgal__stage  { grid-column: 2; grid-row: 1; position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius-sm); background: var(--line); }

.pgal__open {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}
.pgal__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--dur-base) var(--ease-out), transform 900ms var(--ease-out);
}
.pgal__img.is-loading { opacity: 0.15; }
@media (hover: hover) { .pgal__stage:hover .pgal__img { transform: scale(1.03); } }

.pgal__zoom {
    position: absolute;
    inset-block-end: var(--space-3);
    inset-inline-end: var(--space-3);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: rgba(251, 248, 242, 0.92);
    color: var(--ink);
}

.pgal__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(251, 248, 242, 0.92);
    color: var(--ink);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity var(--dur-base), background var(--dur-micro), color var(--dur-micro);
}
.pgal__nav--next { inset-inline-end: var(--space-3); }                       /* the left side, in RTL */
.pgal__nav--prev { inset-inline-start: var(--space-3); }
.pgal__nav--prev .icon { transform: scaleX(-1); }
.pgal__nav:hover { background: var(--ink); color: var(--paper); }
.pgal__stage:hover .pgal__nav,
.pgal__nav:focus-visible { opacity: 1; }
@media (hover: none) { .pgal__nav { opacity: 1; } }

.pgal__thumb,
.pgal__more {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--line);
    cursor: pointer;
    opacity: 0.65;
    transition: opacity var(--dur-micro);
}
.pgal__thumb img,
.pgal__more img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pgal__thumb:hover,
.pgal__more:hover { opacity: 1; }
.pgal__thumb.is-active,
.pgal__more.is-active { opacity: 1; outline: 1.5px solid var(--ink); outline-offset: 2px; }
.pgal__more-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(20, 32, 31, 0.55);
    color: var(--paper);
    font-weight: 700;
}

/* Phones and tablets: thumbnails go under the photo, in a row */
@media (max-width: 767px) {
    .pgal { grid-template-columns: minmax(0, 1fr); }
    .pgal__stage { grid-column: 1; }
    .pgal__thumbs { grid-column: 1; grid-row: 2; grid-auto-flow: column; grid-auto-columns: 4.25rem; overflow-x: auto; scrollbar-width: none; }
    .pgal__thumbs::-webkit-scrollbar { display: none; }
}

/* ---------- Buy panel ---------- */
.pd-panel {
    position: sticky;
    top: 112px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
@media (max-width: 899px) { .pd-panel { position: static; } }

.pd-kicker { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: var(--fs-sm); font-weight: 600; color: var(--gold-700); }
.pd-title { margin: 0; font-size: var(--fs-h2); }

.pd-rating { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--ink-soft); }
.pd-rating:hover { color: var(--ink); }

/* The wrapper has no box of its own: its groups become direct children of the
   panel, which is what lets the add-to-cart bar stick on phones. */
.vs { display: contents; }

/* Price (the JS rewrites this block with the same classes) */
.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); margin: 0; }
.pd-price__now { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 800; line-height: 1.3; }
.pd-price.is-sale .pd-price__now { color: var(--sale); }
.pd-price__was { font-size: var(--fs-sm); color: var(--muted); }
.pd-price__off {
    padding: 2px 14px;
    background: var(--sale);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 700;
    line-height: 1.7;
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
}

/* Colour and size pickers */
.vs__group { display: grid; gap: var(--space-3); }
.vs__label { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.vs__label strong { color: var(--ink); font-weight: 700; }
.vs__swatches { display: flex; flex-wrap: wrap; gap: var(--space-4); padding: 5px; }   /* padding makes room for the selection ring */
.vs__sizes { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.sw {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sw);
    box-shadow: inset 0 0 0 1px rgba(27, 26, 23, 0.22);
    cursor: pointer;
}
.sw::after {                                          /* selection ring, just outside the colour */
    content: '';
    position: absolute;
    inset: -5px;
    border: 1.5px solid transparent;
    border-radius: 50%;
    transition: border-color var(--dur-micro);
}
.sw:hover::after { border-color: var(--line); }
.sw.is-selected::after { border-color: var(--ink); }
.sw.is-unavailable { opacity: 0.55; }
.sw.is-unavailable::before {                          /* diagonal strike: out of stock in every size */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(27, 26, 23, 0.6) 50%, transparent calc(50% + 1px));
}

.sz {
    min-width: 48px;
    height: 48px;
    padding-inline: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur-micro), color var(--dur-micro), border-color var(--dur-micro);
}
.sz:hover:not(:disabled) { border-color: var(--ink); }
.sz.is-selected { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sz:disabled {                                        /* sold out / not made in this colour */
    border-style: dashed;
    background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px));
    color: var(--muted);
    cursor: not-allowed;
}

.vs__measure { margin: 0; font-size: var(--fs-xs); line-height: 1.8; color: var(--ink-soft); }
.vs__measure:empty { display: none; }

.pd-msg { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.pd-msg:empty { display: none; }
.pd-msg.is-success { color: var(--success); }
.pd-msg.is-error { color: var(--sale); }

.vs__cta { display: flex; gap: var(--space-3); }
.vs__add { flex: 1; }
.pd-wish {
    display: grid;
    place-items: center;
    flex: none;
    width: 52px;
    height: 52px;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background var(--dur-micro), color var(--dur-micro);
}
.pd-wish .icon { transition: fill var(--dur-base), stroke var(--dur-base), transform var(--dur-micro) var(--ease-spring); }
.pd-wish:hover { background: var(--ink); color: var(--paper); }
.pd-wish:active .icon { transform: scale(0.82); }
.pd-wish.is-liked .icon { fill: var(--sale); stroke: var(--sale); }
.pd-wish.is-liked:hover .icon { fill: #fff; stroke: #fff; }

/* Phones: the add-to-cart bar stays visible above the bottom tab bar while you are in the buy panel */
@media (max-width: 768px) {
    .vs__cta {
        position: sticky;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        padding-block: var(--space-3);
        background: rgba(246, 242, 234, 0.96);
        backdrop-filter: blur(8px);
        box-shadow: 0 -1px 0 var(--line);
    }
}

.pd-trust {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-5) 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
    font-size: var(--fs-sm);
    color: var(--ink-soft);
}
.pd-trust li { display: flex; align-items: center; gap: var(--space-3); }
.pd-trust .icon { width: 1.125rem; height: 1.125rem; color: var(--gold-700); }

/* ---------- Details (accordions) ---------- */
.pd-details { max-width: 56rem; margin: var(--section-space) auto 0; }
.pd-text p { margin: 0 0 var(--space-3); color: var(--ink-soft); }
.pd-text p:last-child { margin-bottom: 0; }
.pd-scroll { overflow-x: auto; }
.pd-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); text-align: center; }
.pd-table th,
.pd-table td { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); }
.pd-table thead th { background: var(--surface); font-weight: 700; color: var(--ink-soft); }
.pd-table thead small { font-weight: 400; color: var(--muted); }
.pd-table tbody th { font-weight: 700; }

/* ==========================================================================
   Full-screen viewer (.lb)
   ========================================================================== */
.lb {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: rgba(20, 32, 31, 0.96);
    color: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base), visibility 0s linear var(--dur-base);
}
.lb.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.lb__close {
    position: absolute;
    top: var(--space-4);
    inset-inline-end: var(--space-4);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(246, 242, 234, 0.35);
    background: rgba(20, 32, 31, 0.6);
    color: var(--paper);
    cursor: pointer;
    transition: background var(--dur-micro), color var(--dur-micro);
}
.lb__close:hover,
.lb__nav:hover { background: var(--paper); color: var(--night); }
.lb__counter { padding: var(--space-5); text-align: center; font-size: var(--fs-sm); color: #D9D4C7; }

.lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding-inline: var(--space-8); }
.lb__stage img { max-width: 100%; max-height: calc(100vh - 11rem); object-fit: contain; }

.lb__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(246, 242, 234, 0.35);
    background: rgba(20, 32, 31, 0.6);
    color: var(--paper);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background var(--dur-micro), color var(--dur-micro);
}
.lb__nav--next { inset-inline-end: var(--space-4); }
.lb__nav--prev { inset-inline-start: var(--space-4); }
.lb__nav--prev .icon { transform: scaleX(-1); }

.lb__strip { padding: var(--space-4); overflow-x: auto; scrollbar-width: none; }
.lb__strip::-webkit-scrollbar { display: none; }
.lb__strip-inner { display: flex; gap: var(--space-2); width: max-content; margin-inline: auto; }
.lb__thumb {
    flex: none;
    width: 56px;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity var(--dur-micro);
}
.lb__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb__thumb:hover { opacity: 0.9; }
.lb__thumb.is-active { opacity: 1; border-color: var(--paper); }

.lb.is-single .lb__nav,
.lb.is-single .lb__strip,
.lb.is-single .lb__counter { display: none; }

@media (max-width: 767px) {
    .lb__stage { padding-inline: 0; }
    .lb__nav { width: 44px; height: 44px; }
}