/* ==========================================================================
   New design (Carrot, Oct 2026): product page (screen 05) and the "Select options" sheet
   Kicker + name + heart, swipeable 4:5 photos with bar dots, "Add to list" and "Download digital
   sample", certification stamps, the spec table and the description. Values from the delivered
   prototype (app.css .pdp-*, .options-sheet, .stepper, .app-cta-btn). Loaded only for Preview users.
   ========================================================================== */

.s2-pdp {
    background: #fff;
    font-family: var(--s2-font);
}

/* ---------- Buttons (shared: solid and outline, sharp corners) ---------- */
.s2-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border: 1.5px solid var(--s2-indigo);
    border-radius: 0;
    background: #fff;
    color: var(--s2-indigo);
    font-family: var(--s2-font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s var(--s2-ease-out);
}
.s2-btn:active {
    background: var(--s2-indigo);
    color: #fff;
    transform: scale(0.97);
}
.s2-btn-solid {
    background: var(--s2-indigo);
    color: #fff;
}
.s2-btn-solid:active {
    background: var(--s2-indigo-dark);
}
.s2-btn svg {
    width: 16px;
    height: 16px;
}

/* ---------- Kicker + name + heart ---------- */
.s2-kicker {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--s2-blue);
}
.s2-pdp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 16px 16px;
}
.s2-pdp-head-text {
    min-width: 0;
}
.s2-pdp-title {
    margin: 0;
    font-family: var(--s2-font);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: var(--s2-indigo);
}
.s2-pdp-fav {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-top: 10px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--s2-indigo);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.s2-pdp-fav svg {
    transition: fill 0.2s ease;
}
.s2-pdp-fav.is-fav svg {
    fill: var(--s2-indigo);
}
.s2-pdp-fav.pop svg {
    animation: s2FavPop 0.45s var(--s2-ease-spring);
}

/* ---------- Photos: full width 2:3, swipe, bar dots ----------
   2:3 = the product photos (front/back/closeup are 2:3). It was 4:5 from the prototype, which cut the top and
   bottom of every photo (marketing note, 15 Nov 2026). */
.s2-pdp-gallery {
    position: relative;
}
.s2-pdp-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.s2-pdp-track::-webkit-scrollbar {
    display: none;
}
.s2-pdp-slide {
    flex: 0 0 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--s2-light-gray);
    scroll-snap-align: start;
}
.s2-pdp-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
[data-s2-fx].fx-in .s2-pdp-slide:first-child img {
    animation: s2ImgSettle 1.1s var(--s2-ease-out) var(--fx-d, 0s) both;
}
.s2-pdp-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}
.s2-pdp-dots span {
    width: 18px;
    height: 2px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
    transition: width 0.35s var(--s2-ease-out), background 0.35s ease;
}
.s2-pdp-dots span.active {
    width: 32px;
    background: #fff;
}

/* Sustainability Logos on the photo, bottom left (as on the current page) */
.s2-pdp-logos {
    position: absolute;
    left: 12px;
    bottom: 28px;
    display: flex;
    gap: 12px;
    pointer-events: none;
    z-index: 2;
}
.s2-pdp-logos img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}
@media (min-width: 768px) {
    .s2-pdp-logos img {
        width: 64px;
        height: 64px;
    }
}

/* ---------- Actions ---------- */
.s2-pdp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 16px 4px;
}
.s2-pdp-actions .s2-btn {
    width: 100%;
    /* "backwards" so that after the entrance the press effect (scale) still works */
    animation: s2LogoRise 0.6s var(--s2-ease-out) backwards;
}
.s2-pdp-actions .s2-btn:nth-child(1) { animation-delay: 0.5s; }
.s2-pdp-actions .s2-btn:nth-child(2) { animation-delay: 0.58s; }

.s2-pdp-add-check {
    display: none;
}
/* Already in the sample list: white button with a check */
.s2-pdp-add.is-added,
.s2-pdp-add.is-added:active {
    background: #fff;
    color: var(--s2-indigo);
    transform: none;
    cursor: default;
}
.s2-pdp-add.is-added .s2-pdp-add-check {
    display: inline-block;
    animation: s2FavPop 0.45s var(--s2-ease-spring);
}

/* Digital sample: a light blue bar fills the button, then it turns indigo for "Sample ready" */
.s2-pdp-sample {
    overflow: hidden;
}
.s2-pdp-sample > :not(.s2-btn-fill) {
    position: relative;
    z-index: 1;
}
.s2-btn-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--progress, 0%);
    background: var(--s2-sky-bg);
    transition: width 0.12s linear;
    pointer-events: none;
}
.s2-pdp-sample.is-done {
    background: var(--s2-indigo);
    color: #fff;
    animation: s2StepTick 0.3s var(--s2-ease-spring);
}

/* ---------- Certification stamps ---------- */
.s2-pdp-certs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 16px 4px;
}
.s2-pdp-cert {
    width: 76px;
    height: 76px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--s2-indigo);
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--s2-indigo);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    color: var(--s2-indigo);
    overflow-wrap: anywhere;
}

/* ---------- Spec table ---------- */
.s2-pdp-specs {
    margin: 18px 16px 0;
    border-top: 1.5px solid var(--s2-indigo);
}
.s2-pdp-spec-row {
    display: grid;
    grid-template-columns: 46% 54%;
    gap: 8px;
    padding: 11px 0;
    border-bottom: 1px solid var(--s2-border);
}
.s2-pdp-spec-row dt {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--s2-indigo);
}
.s2-pdp-spec-row dd {
    margin: 0;
    font-size: 13px;
    color: var(--s2-indigo-dark);
    overflow-wrap: anywhere;
}

/* ---------- Description ---------- */
.s2-pdp-desc {
    padding: 22px 16px 28px;
}
.s2-pdp-desc-title {
    margin: 0 0 8px;
    font-family: var(--s2-font);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--s2-indigo);
}
.s2-pdp-desc p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--s2-indigo-dark);
}

/* ---------- "Select options" sheet ---------- */
.s2-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(0, 20, 40, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.s2-sheet-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.s2-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2101;
    padding: 10px 16px 24px;
    background: #fff;
    font-family: var(--s2-font);
    transform: translateY(105%);
    transition: transform 0.5s var(--s2-ease-out);
}
.s2-sheet.is-open {
    transform: translateY(0);
}
.s2-sheet-handle {
    display: block;
    width: 36px;
    height: 3px;
    margin: 0 auto 16px;
    background: var(--s2-border);
}
.s2-sheet-title {
    margin: 0 0 10px;
    font-family: var(--s2-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--s2-indigo);
}
.s2-sheet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--s2-border);
}
.s2-sheet-row-label span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--s2-indigo);
}
.s2-sheet-row-label small {
    font-size: 11px;
    color: var(--s2-text-muted);
}
.s2-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--s2-indigo);
}
.s2-stepper-btn {
    width: 38px;
    height: 36px;
    padding: 0;
    border: 0;
    background: #fff;
    font-family: var(--s2-font);
    font-size: 18px;
    color: var(--s2-indigo);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.s2-stepper-btn:disabled {
    color: var(--s2-border);
    cursor: default;
}
.s2-stepper-val {
    width: 30px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--s2-indigo);
}
.s2-stepper-val.tick {
    animation: s2StepTick 0.3s var(--s2-ease-spring);
}
.s2-sheet-add {
    width: 100%;
    margin-top: 20px;
}
.s2-sheet-add:disabled,
.s2-sheet-add:disabled:active {
    background: var(--s2-border);
    border-color: var(--s2-border);
    color: #fff;
    transform: none;
    cursor: default;
}

/* Small square of the product photo that flies into the sample list tab */
.s2-fly-thumb {
    position: fixed;
    z-index: 2200;
    width: 64px;
    height: 64px;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    box-shadow: 0 6px 18px rgba(0, 20, 40, 0.3);
    pointer-events: none;
}

@keyframes s2StepTick {
    0%   { transform: translateY(-6px); opacity: 0.2; }
    100% { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .s2-pdp-actions .s2-btn, .s2-pdp-add.is-added .s2-pdp-add-check, .s2-pdp-sample.is-done, .s2-stepper-val.tick { animation: none; }
}

/* ---------- Photo zoom (zoom.js, Dec 2026) ---------- */
.s2-pdp-slide {
    cursor: zoom-in;
}
html.s2-zoom-lock,
html.s2-zoom-lock body {
    overflow: hidden;
}
.s2-zoom {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #fff;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.s2-zoom.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}
.s2-zoom-track {
    display: flex;
    height: 100%;
    will-change: transform;
}
.s2-zoom-slide {
    flex: 0 0 100%;
    height: 100%;
    overflow: hidden;
    cursor: zoom-in;
}
.s2-zoom-slide.is-zoomed {
    cursor: grab;
}
.s2-zoom-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: 0 0;
    will-change: transform;
    -webkit-user-drag: none;
}
.s2-zoom-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--s2-indigo-dark);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}
.s2-zoom-count {
    position: absolute;
    top: calc(22px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    text-align: center;
    font: 600 13px/1 var(--s2-font);
    color: var(--s2-indigo-dark);
    pointer-events: none;
}
.s2-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(0, 34, 64, 0.75);
    color: #fff;
    font: 500 12px/1 var(--s2-font);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.s2-zoom.hint-gone .s2-zoom-hint {
    opacity: 0;
}
/* Opened by a pinch on the page photo: show at once so the fingers keep zooming without a fade */
.s2-zoom.is-open.no-fade {
    transition: none;
}
