/*
 * The showcase product page (Doc/05, Product page layouts).
 *
 * Column widths follow a 12-column grid with 30px gutters: photographs 3/12,
 * buy box 7/12 of the remaining 9/12, video 5/12 of it. Written as flex bases
 * so the three columns come out exactly as wide as on the shop this layout was
 * measured from: at a 1490px site width, 350 / 635 / 445px.
 *
 * No boxes around the columns: whitespace and one hairline under the price do
 * the separating. The photograph sits in a fixed 2:3 frame (the reference's
 * 324 x 486), fitted, never cropped; the video is 300px wide at 9:16.
 *
 * The content width is the shop's `--site-width` (config site_width), else
 * the 1320px the core's product page has always had.
 */

.pps-page {
    --pps-line: var(--gadget-line, #e5e7eb);
    --pps-ink: var(--gadget-ink, #111111);
    --pps-muted: var(--gadget-muted, #5f6368);
    --pps-soft: #f7f7f7;
    --pps-bg: var(--gadget-bg, #ffffff);
    --pps-gap: 30px;
    --pps-frame-ratio: 2 / 3;

    box-sizing: border-box;
    width: 100%;
    max-width: calc(var(--site-width, 1320px) + 30px);
    margin-inline: auto;
    padding: 0 15px 24px;
    color: var(--pps-ink);
}

.pps-page *,
.pps-page *::before,
.pps-page *::after {
    box-sizing: border-box;
}

.pps-crumbs {
    padding: 18px 0;
}

.pps-crumbs nav,
.pps-crumbs ol {
    justify-content: flex-start;
}

/* Columns */

.pps-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--pps-gap);
}

.pps-col {
    min-width: 0;
}

.pps-col--media {
    flex: 0 0 calc(25% - 22.5px);
    position: relative;
    z-index: 20;
}

.pps-col--info {
    flex: 0 0 calc(43.75% - 16.875px);
}

.pps-col--video {
    flex: 0 0 calc(31.25% - 20.625px);
}

.pps-grid--no-video .pps-col--info {
    flex-basis: calc(75% - 7.5px);
}

/* Photographs */

.pps-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pps-stage-wrap {
    position: relative;
}

/*
 * A fixed 2:3 frame (the reference's 324 x 486), the same on every product.
 * Portrait and square photos fill it, trimmed at the sides and never at the
 * top; wider photos are shown whole on a blurred copy of themselves. The
 * magnifier and the full-screen viewer always show the whole photograph.
 */
.pps-stage-wrap {
    position: relative;
    aspect-ratio: var(--pps-frame-ratio);
}

.pps-stage {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--pps-soft);
    isolation: isolate;
}

.pps-stage--loading {
    aspect-ratio: var(--pps-frame-ratio);
    border-radius: 10px;
    background: var(--pps-soft);
}

.pps-stage__open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.pps-stage--zooming .pps-stage__open {
    cursor: crosshair;
}

.pps-stage__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.pps-stage--contain .pps-stage__img {
    object-fit: contain;
    object-position: center;
}

.pps-stage__blur {
    position: absolute;
    inset: -30px;
    z-index: -1;
    width: calc(100% + 60px);
    height: calc(100% + 60px);
    object-fit: cover;
    filter: blur(24px) brightness(0.92);
}

video.pps-stage__img {
    object-fit: contain;
    background: #000000;
}

/* Arrows: always there on touch screens, on hover with a mouse. */
.pps-arrow {
    position: absolute;
    top: 50%;
    z-index: 6;
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 2px 10px rgb(0 0 0 / 14%);
    color: var(--pps-ink);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, background 0.2s ease;
}

.pps-arrow:hover {
    background: #ffffff;
}

.pps-arrow--prev {
    left: 10px;
}

.pps-arrow--next {
    right: 10px;
}

@media (hover: hover) and (pointer: fine) {
    .pps-arrow {
        opacity: 0;
    }

    .pps-gallery:hover .pps-arrow,
    .pps-arrow:focus-visible {
        opacity: 1;
    }
}

/* "1 / 4" and a bar that fills as the photos go by. */
.pps-counter {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 4px;
}

.pps-counter__text {
    flex: none;
    min-width: 34px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--pps-ink);
}

.pps-counter__track {
    position: relative;
    flex: 1;
    height: 8px;
    overflow: hidden;
    border: 1.5px solid var(--pps-ink);
    border-radius: 999px;
    cursor: pointer;
}

.pps-counter__fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    background: var(--pps-ink);
    transition: width 0.35s ease;
}

/* The saving, on the photograph's corner, as the reference shop marks it. */
.pps-off {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    padding: 4px 10px;
    border-radius: 6px;
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* The lens stays clear; everything around it dims, as on the reference shop. */
.pps-lens {
    position: absolute;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgb(51 51 51 / 50%);
}

.pps-zoom-pane {
    position: absolute;
    top: 0;
    left: calc(100% + 15px);
    width: 400px;
    height: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
    pointer-events: none;
    z-index: 30;
}

.pps-zoom-pane img {
    position: absolute;
    max-width: none;
}

/* Five small thumbnails to a row; more scroll sideways. */
.pps-thumbs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 32px) / 5);
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.pps-thumb {
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--pps-line);
    border-radius: 8px;
    background: var(--pps-soft);
    cursor: pointer;
}

.pps-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pps-thumb--active {
    border: 2px solid var(--gadget-accent, #111111);
}

.pps-thumb__video {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #111111;
}

/* Buy box */

.pps-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.pps-title {
    margin: 0;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.pps-wish {
    display: flex;
    flex: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pps-line);
    border-radius: 999px;
    background: #ffffff;
    font-size: 22px;
    color: var(--pps-ink);
    cursor: pointer;
}

.pps-wish--on {
    color: #e11d48;
    border-color: #fecdd3;
    background: #fff1f2;
}

.pps-sku {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--pps-muted);
}

.pps-sku span {
    font-weight: 600;
    color: var(--pps-ink);
}

.pps-rating {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

/* Now, before (struck out), and the saving in a pill: "৳1,720 ৳2,150 Save ৳430". */
.pps-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--pps-line);
}

.pps-price p {
    margin: 0;
}

.pps-price .price-label {
    flex-basis: 100%;
    font-size: 13px;
    color: var(--pps-muted);
}

.pps-price .final-price {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pps-ink);
}

.pps-price .regular-price {
    font-size: 17px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: line-through;
}

/* The core's "20% OFF" line; the page shows it on the photo instead. */
.pps-price .discount-badge {
    display: none !important;
}

.pps-save {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: #dcfce7;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.pps-tax,
.pps-offers {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--pps-muted);
}

.pps-short {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--pps-muted);
}

.pps-buy {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.pps-qty {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pps-qty__label {
    font-size: 15px;
}

.pps-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pps-actions > :only-child {
    grid-column: 1 / -1;
}

.pps-contacts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pps-contacts--1 {
    grid-template-columns: 1fr;
}

.pps-contact {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s ease;
}

.pps-contact:hover {
    filter: brightness(0.97);
}

.pps-contact--whatsapp {
    border: 1px solid #b7e4c7;
    background: #effaf3;
    color: #146c3a;
}

.pps-contact--phone {
    border: 1px solid #bcd3f5;
    background: #eef4fd;
    color: #1a4f9c;
}

/* Description */

.pps-desc {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--pps-line);
}

.pps-desc__title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.pps-desc__body {
    position: relative;
    font-size: 15px;
    line-height: 1.7;
    color: #3a3a3a;
    overflow-wrap: anywhere;
}

.pps-desc__body--folded {
    max-height: 190px;
    overflow: hidden;
}

.pps-desc__body--folded::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 72px;
    background: linear-gradient(transparent, var(--pps-bg));
}

.pps-desc__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px auto 0;
    padding: 8px 20px;
    border: 1px solid var(--pps-line);
    border-radius: 999px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    color: var(--pps-ink);
    cursor: pointer;
}

.pps-extras {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
}

.pps-compare {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--pps-line);
    border-radius: 10px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
    color: var(--pps-ink);
    cursor: pointer;
}

.pps-share {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pps-share__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pps-muted);
}

.pps-share__link {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pps-line);
    border-radius: 999px;
    color: var(--pps-ink);
}

.pps-share__link:hover {
    background: var(--pps-ink);
    color: #ffffff;
}

/*
 * Video: a panel as wide as its column. The upright video sits in the middle
 * at 9:16, never cropped; the product's photo, blurred and darkened, fills
 * the sides. v-product sets the panel's height on wide screens; below that
 * it is 560px, and on a phone the video simply fills the width.
 */

.pps-video__title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}

.pps-video__frame {
    position: relative;
    display: flex;
    width: 100%;
    height: 560px;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: #1b1b1b;
    isolation: isolate;
}

.pps-video__backdrop {
    position: absolute;
    inset: -40px;
    z-index: -1;
    width: calc(100% + 80px);
    height: calc(100% + 80px);
    object-fit: cover;
    filter: blur(28px) brightness(0.55) saturate(1.15);
}

.pps-video__screen {
    position: relative;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    background: #000000;
    box-shadow: 0 0 40px rgb(0 0 0 / 35%);
}

.pps-video__screen iframe,
.pps-video__screen video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

/* Before it plays: the shop's name and Share along the top, a play button in the middle. */
.pps-video__bar {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 36px;
    background: linear-gradient(rgb(0 0 0 / 55%), transparent);
    color: #ffffff;
}

.pps-video__channel {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgb(0 0 0 / 40%);
}

.pps-video__channel > img,
.pps-video__channel > span:first-child {
    display: flex;
    flex: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    color: var(--pps-ink);
    font-weight: 700;
    object-fit: contain;
}

.pps-video__channel > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pps-video__share {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 40%));
}

.pps-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    width: 76px;
    height: 76px;
    align-items: center;
    justify-content: center;
    padding: 0 0 0 5px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: rgb(0 0 0 / 28%);
    color: #ffffff;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: background 0.2s ease, transform 0.2s ease;
}

.pps-video__play:hover {
    background: rgb(0 0 0 / 45%);
    transform: translate(-50%, -50%) scale(1.05);
}

/* The core's colour and size swatch rows never wrap; in a narrow column they must. */
.pps-col--info form .flex.gap-3 {
    flex-wrap: wrap;
}

/* Below the columns */

.pps-reviews {
    max-width: 100%;
    overflow: hidden;
}

.pps-section {
    margin-top: 30px;
}

.pps-section--details {
    padding-top: 24px;
    border-top: 1px solid var(--pps-line);
}

.pps-section__title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
}

.pps-specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px 24px;
    margin: 0;
}

.pps-specs div {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.pps-specs dt {
    color: var(--pps-muted);
}

.pps-specs dd {
    margin: 0;
    font-weight: 500;
}

/* Size chart, under the video (size-chart.blade.php) */

.pps-side {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/*
 * Stacked columns (below 1180px): v-product moves .pps-side into the buy box
 * column under the product title, so the emptied third column is hidden.
 */
.pps-col--side-moved {
    display: none;
}

.pps-side-slot:not(:empty) {
    margin: 16px 0 20px;
}

.pps-size__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 10px;
    cursor: pointer;
    list-style: none;
}

.pps-size__head::-webkit-details-marker {
    display: none;
}

.pps-size__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.pps-size__chevron {
    flex: none;
    color: #6b6b6b;
    transition: transform 0.2s ease;
}

.pps-size:not([open]) .pps-size__chevron {
    transform: rotate(-90deg);
}

.pps-size__head:focus-visible {
    outline: 2px solid var(--brand, #111);
    outline-offset: 3px;
    border-radius: 4px;
}

.pps-size__scroll {
    overflow-x: auto;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
}

.pps-size__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pps-size__table th,
.pps-size__table td {
    padding: 10px 8px;
    border-right: 1px solid #e4e4e4;
    border-bottom: 1px solid #e4e4e4;
}

.pps-size__table tr > :last-child {
    border-right: 0;
}

.pps-size__table tbody tr:last-child > * {
    border-bottom: 0;
}

.pps-size__table thead th {
    background: color-mix(in srgb, var(--brand, #1f1f1f) 7%, #fff);
    color: var(--brand-ink, #1f1f1f);
    font-weight: 600;
    vertical-align: middle;
}

.pps-size__table tbody th {
    font-weight: 600;
}

.pps-size__table tbody tr:nth-child(even) > * {
    background: #f7f7f7;
}

.pps-size__note {
    margin: 8px 0 0;
    font-size: 13px;
    color: #6b6b6b;
}

/* Smaller screens: no room for the magnifier pane or three columns. */

@media (max-width: 1179px) {
    .pps-col--media {
        flex-basis: calc(40% - 15px);
    }

    .pps-col--info,
    .pps-grid--no-video .pps-col--info {
        flex-basis: calc(60% - 15px);
    }

    .pps-col--video {
        flex-basis: 100%;
    }

    .pps-zoom-pane,
    .pps-lens {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .pps-page {
        padding: 0 16px 16px;
    }

    .pps-grid {
        gap: 16px;
    }

    .pps-col--media,
    .pps-col--info,
    .pps-grid--no-video .pps-col--info,
    .pps-col--video {
        flex-basis: 100%;
    }

    .pps-title {
        font-size: 21px;
    }

    /* A phone is as narrow as the video: it fills the width at its own shape. */
    .pps-video__frame {
        height: auto;
    }

    .pps-video__screen {
        width: 100%;
        height: auto;
    }

    .pps-price .final-price {
        font-size: 21px;
    }
}

/* "Only 3 left in stock" under the price (product_page.low_stock_threshold) */
.pps-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 2px;
    color: #b45309;
    font-size: 14px;
    font-weight: 600;
}

.pps-stock::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Estimated delivery under the buy buttons (product_page.delivery_estimate) */
.pps-delivery {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgb(0 0 0 / 8%);
    border-radius: 10px;
    background: #fafaf9;
    color: var(--brand-ink, #1f2937);
    font-size: 14px;
    line-height: 1.5;
}

.pps-delivery svg {
    flex: none;
    margin-top: 2px;
    color: var(--brand, currentColor);
}

.pps-delivery__title {
    margin: 0 0 2px;
    font-weight: 600;
}

.pps-delivery__line {
    margin: 0;
    color: rgb(31 41 55 / 80%);
}
