/* ==========================================================================
   Product page (markup: storefront/product.blade.php and storefront/product/_*,
   behaviour: js/storefront/product-page.js)
   ========================================================================== */

.store--product .store__main {
    padding: 0 0 calc(210px + env(safe-area-inset-bottom));
    gap: 26px;
}

/* The cart pill floats just above the buy bar */
.store--product .cart-pill {
    bottom: calc(86px + env(safe-area-inset-bottom));
}

/* ---------- Floating header buttons ---------- */

.product-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;   /* only the buttons take taps */
}

.product-header__group {
    display: flex;
    gap: 8px;
}

.product-header__button {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    color: var(--color-ink);
    box-shadow: 0 2px 8px rgba(42, 16, 82, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.product-header__button .icon {
    width: 22px;
    height: 22px;
    stroke-width: 2.4;
}

/* ---------- Page layout ---------- */

.product-page {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.product-page__body {
    padding: 0 var(--page-gutter);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------- Photos ---------- */

.product-gallery {
    position: relative;
    background: #F7F6FA;
}

.product-gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.product-gallery__track::-webkit-scrollbar {
    display: none;
}

.product-gallery__slide {
    flex: 0 0 100%;
    height: 360px;
    margin: 0;
    padding: 56px 24px 34px;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.product-gallery__slide--empty .icon {
    width: 72px;
    height: 72px;
    color: #C9BEDD;
}

.product-gallery__badge {
    position: absolute;
    top: 64px;
    left: 16px;
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--color-offer);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 800;
}

.product-gallery__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
}

/* A 32 px tap target; the dot people see is drawn inside it */
.product-gallery__dot {
    min-width: 32px;
    height: 32px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.product-gallery__dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #D8CCEB;
    transition: width 0.2s ease;
}

.product-gallery__dot.is-active::before {
    width: 22px;
    background: var(--color-primary);
}

/* ---------- Name and price ---------- */

.product-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.product-info__brand {
    /* 8 px more to tap above and below, the same place on the page */
    padding-block: 8px;
    margin-block: -8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-offer);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.product-info__brand .icon {
    width: 13px;
    height: 13px;
    stroke-width: 3;
}

.product-info__name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.product-info__share {
    min-height: 36px;
    padding: 5px 12px 5px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border-strong);
    color: var(--color-ink);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.product-info__share .icon {
    width: 16px;
    height: 16px;
}

.product-info__share:hover {
    background: var(--color-soft);
}

.product-info__pack {
    font-size: 14px;
    color: var(--color-text-muted);
}

.product-info__prices {
    margin-top: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.product-info__prices--hidden {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.product-info__price {
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--color-price);
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
}

.product-info__mrp {
    font-size: 14px;
    color: #7A7090;
}

.product-info__save {
    font-size: 13px;
    font-weight: 800;
    color: var(--color-offer);
}

.product-info__tax {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ---------- Delivery ---------- */

.product-delivery {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--color-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-delivery__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-delivery__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-delivery__icon .icon {
    width: 18px;
    height: 18px;
}

.product-delivery__text {
    display: flex;
    flex-direction: column;
}

.product-delivery__title {
    font-size: 14px;
    font-weight: 700;
}

.product-delivery__note {
    font-size: 12px;
    color: #5E4F7A;
}

/* ---------- Description ---------- */

.product-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-details__title {
    font-size: 16px;
    font-weight: 800;
}

.product-details__text {
    font-size: 14px;
    line-height: 1.55;
    color: #3D3550;
    overflow-wrap: break-word;
}

.product-details__text > :first-child {
    margin-top: 0;
}

.product-details__text p {
    margin: 0 0 8px;
}

.product-details__text h3,
.product-details__text h4 {
    margin: 14px 0 6px;
    color: var(--color-ink);
    line-height: 1.3;
}

.product-details__text h3 {
    font-size: 15px;
    font-weight: 800;
}

.product-details__text h4 {
    font-size: 14px;
    font-weight: 800;
}

.product-details__text strong {
    font-weight: 700;
    color: var(--color-text);
}

.product-details__text ul,
.product-details__text ol {
    margin: 0 0 8px;
    padding-left: 20px;
}

.product-details__text li {
    margin-bottom: 4px;
}

/* Tables scroll sideways on small screens instead of overflowing */
.product-details__text table {
    display: block;
    max-width: 100%;
    margin: 4px 0 10px;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 13px;
}

.product-details__text th,
.product-details__text td {
    padding: 6px 10px;
    border: 1px solid #ECE6F5;
    text-align: left;
    vertical-align: top;
}

.product-details__text th {
    background: #F6F1FF;
    font-weight: 700;
    color: var(--color-ink);
}

/* Cut after about 6 lines until "Read more" is tapped */
.product-details__text.is-clamped {
    max-height: calc(1.55em * 6);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000000 60%, transparent 100%);
    mask-image: linear-gradient(180deg, #000000 60%, transparent 100%);
}

.product-details__more {
    align-self: flex-start;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.product-details__empty {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ---------- Buy bar ---------- */

.buy-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    padding: 10px max(14px, calc((100% - 760px) / 2 + 14px)) calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid #EEE8F5;
    background: var(--color-surface);
    box-shadow: 0 -6px 18px rgba(42, 16, 82, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.buy-bar__price {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.buy-bar__pack {
    font-size: 13px;
    color: var(--color-text-muted);
}

.buy-bar__amount {
    font-size: 18px;
    font-weight: 800;
}

.buy-bar__amount--request {
    font-size: 14px;
    color: #4C1D95;
}

.buy-bar__mrp {
    font-size: 13px;
    font-weight: 500;
    color: #7A7090;
}

.buy-bar__sold-out {
    width: 160px;
    height: 50px;
    border: 0;
    border-radius: var(--radius-md);
    background: #C9C2D6;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 800;
    cursor: not-allowed;
}

/* "Adding to: Fast cart · change" across the top of the bar */
.buy-bar {
    flex-wrap: wrap;
    row-gap: 8px;
}

.buy-bar__cart {
    flex: 1 1 100%;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: #F1ECFB;
    color: #2A1052;
    font: inherit;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.buy-bar__cart:hover {
    background: #E9E1F8;
}

.buy-bar__cart-icon {
    width: 14px;
    height: 14px;
    color: #5B21B6;
}

.buy-bar__cart-change {
    color: #5B21B6;
    font-weight: 800;
}

/* The bar is taller with that line: the cart pill floats above it */
.store--product:has(.buy-bar__cart) .cart-pill {
    bottom: calc(124px + env(safe-area-inset-bottom));
}

/* …and taller again with the quick amounts row */
.store--product:has(.qty-quick:not([hidden])) .cart-pill {
    bottom: calc(166px + env(safe-area-inset-bottom));
}

/* "Which cart?" popup */
.which-cart__text {
    margin: 0;
    font-size: 13px;
    color: #6A6080;
}

/* ---------- Bigger screens: photo and details side by side ---------- */

@media (min-width: 900px) {
    .product-page {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 32px;
        padding-top: 70px;
    }

    .product-gallery {
        border-radius: var(--radius-xl);
        overflow: hidden;
        margin-left: var(--page-gutter);
    }

    .product-gallery__slide {
        height: 480px;
    }

    .product-page__body {
        padding-left: 0;
    }

    .product-page .offer-rail {
        grid-column: 1 / -1;
    }
}

/* No photo yet: the icon with "Image not available" under it (#7A6E96) */
.product-gallery__slide--empty {
    flex-direction: column;
    gap: 8px;
}

.product-gallery__no-photo {
    color: #7A6E96;
    font-size: 14px;
    font-weight: 700;
}
