/* =====================================================================
   Storefront round 4: the redesigned product page ("product_page").
   Loaded only on the product page while the switch is on. The buy box, order
   bar and WhatsApp button approved in round 2 are untouched; this styles the
   gallery, the title area, the information tabs and the product rows.
   Swiping, zooming and opening move with transform or native scrolling only.
   ===================================================================== */

.tw-i {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Breadcrumbs ---------- */
.tw-pd-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}

.tw-pd-crumbs li + li::before {
    content: "›";
    margin-right: 6px;
    color: #b3b8c1;
}

.tw-pd-crumbs a {
    color: inherit;
}

.tw-pd-crumbs a:hover {
    color: var(--primary);
}

.tw-pd-crumbs [aria-current] {
    color: var(--text);
    font-weight: 600;
}

/* ---------- Gallery: one photo wide, swipe to the next ---------- */
.gallery-main.tw-pg {
    background: #fff;
}

.tw-pg #galleryMainImg {
    display: none !important;
}

.tw-pg-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.tw-pg-track::-webkit-scrollbar {
    display: none;
}

.tw-pg-slide {
    flex: 0 0 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    cursor: zoom-in;
}

.tw-pg-slide[hidden] {
    display: none;
}

.tw-pg-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tw-pg-count {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(15, 17, 21, .6);
    font-size: 12px;
    color: #fff;
    transform: translateX(-50%);
    pointer-events: none;
}

.tw-pg-zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--text);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
    pointer-events: none;
}

.tw-pg-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    cursor: pointer;
}

.tw-pg-prev {
    left: 10px;
}

.tw-pg-next {
    right: 10px;
}

.tw-pg.is-video .tw-pg-track,
.tw-pg.is-video .tw-pg-count,
.tw-pg.is-video .tw-pg-nav,
.tw-pg.is-video .tw-pg-zoom {
    display: none;
}

@media (hover: hover) and (min-width: 992px) {
    .tw-pg-nav {
        display: grid;
        opacity: 0;
        transition: opacity .2s ease;
    }

    .tw-pg:hover .tw-pg-nav,
    .tw-pg-nav:focus-visible {
        opacity: 1;
    }
}

/* ---------- Photo viewer (tap a photo) ---------- */
.tw-lb {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    background: #0f1115;
    color: #fff;
}

.tw-lb[hidden] {
    display: none;
}

.tw-lb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 16px;
    font-size: 14px;
}

.tw-lb-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.tw-lb-track {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.tw-lb-track::-webkit-scrollbar {
    display: none;
}

.tw-lb-track.is-zoomed {
    overflow-x: hidden;
}

.tw-lb-fig {
    flex: 0 0 100%;
    display: grid;
    place-items: center;
    margin: 0;
    overflow: hidden;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    touch-action: pan-x pan-y pinch-zoom;
}

.tw-lb-fig img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: var(--zx, 50%) var(--zy, 50%);
    transition: transform .25s ease;
    cursor: zoom-in;
}

.tw-lb-fig.is-zoomed img {
    transform: scale(2.4);
    cursor: zoom-out;
}

.tw-lb-fig.is-panning img {
    transition: none;
}

.tw-lb-hint {
    padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
    text-align: center;
    color: rgba(255, 255, 255, .7);
}

html.tw-lb-open,
html.tw-lb-open body {
    overflow: hidden;
}

html.tw-lb-open #gcc-toggle,
html.tw-lb-open .tw-sticky-buy {
    visibility: hidden;
}

/* ---------- Title area ---------- */
.tw-pd-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 4px 12px 4px 8px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), .08);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

.tw-pd-brand:hover {
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), .14);
}

.tw-pd-brand .tw-i {
    width: 16px;
    height: 16px;
}

.tw-pd-rating {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 4px 0 14px;
    font-size: 13px;
    color: var(--muted);
}

.tw-pd-rating .product-rating {
    margin: 0;
    color: #f5a623;
}

.tw-pd-rating strong {
    color: var(--text);
}

.tw-pd-rating:hover span:last-child {
    color: var(--primary);
    text-decoration: underline;
}

.tw-pd-save {
    display: inline-block;
    margin: -6px 0 16px;
    padding: 3px 10px;
    border-radius: 6px;
    background: #e8f6ee;
    font-size: 13px;
    font-weight: 700;
    color: #0a7f43;
}

/* Sizes and colours as clear chips. */
.tw-product-page .weight-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tw-product-page .weight-btn {
    min-height: 42px;
    padding: 8px 16px;
    border: 1.5px solid #dfe1e5;
    border-radius: 999px;
    font-weight: 600;
    color: var(--text);
}

.tw-product-page .weight-btn:hover {
    border-color: var(--primary);
    background: #fff;
    color: var(--primary);
}

.tw-product-page .weight-btn.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), .08);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.tw-product-page .weight-btn.is-out-of-stock {
    border-style: dashed;
    color: #9aa1ab;
    text-decoration: line-through;
}

.tw-product-page .color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.tw-product-page .btn-clear-option {
    margin-top: 8px;
}

.tw-product-page .qty-selector {
    border-radius: 999px;
}

.tw-product-page .qty-btn {
    min-width: 42px;
    min-height: 42px;
}

/* ---------- Delivery box ---------- */
.tw-pd-delivery {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #e8e9ec;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
}

.tw-pd-delivery-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--text);
}

.tw-pd-delivery-head .tw-i {
    color: var(--primary);
}

.tw-pd-delivery ul {
    margin: 0 0 8px;
    padding-left: 26px;
    color: #444;
    line-height: 1.7;
}

.tw-pd-delivery a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    color: var(--primary);
}

.tw-pd-delivery a .tw-i {
    width: 15px;
    height: 15px;
}

/* ---------- Information: accordions on a phone, tabs on a wide screen ---------- */
.tw-info {
    margin-bottom: 24px;
}

.tw-tabs {
    display: none;
}

.tw-info .tw-panel,
.tw-info .product-reviews.tw-panel {
    margin-bottom: 10px;
    padding: 0;
    border-radius: 14px;
    background: #fff;
}

.tw-panel-head {
    margin: 0;
    font-size: 16px;
}

.tw-acc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.tw-acc .tw-i {
    color: var(--muted);
    transition: transform .25s ease;
}

.tw-panel.is-open > .tw-panel-head .tw-acc .tw-i {
    transform: rotate(180deg);
}

/* The section grows from nothing to its own height; closed, its links leave the tab order. */
.tw-panel-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .25s ease;
}

.tw-panel-body > * {
    min-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: visibility 0s linear .25s;
}

.tw-panel.is-open > .tw-panel-body {
    grid-template-rows: 1fr;
}

.tw-panel.is-open > .tw-panel-body > * {
    visibility: visible;
    transition: none;
}

.tw-panel .pd-content {
    padding: 0 18px 18px;
}

.tw-panel .pd-content > :first-child {
    margin-top: 0;
}

.tw-info .product-reviews .tw-panel-body > div {
    padding: 0 18px;
}

.tw-info .product-reviews .reviews-head h2 {
    display: none;
}

@media (min-width: 992px) {
    .tw-tabs {
        display: flex;
        gap: 4px;
        padding: 6px 6px 0;
        border-radius: 14px 14px 0 0;
        border-bottom: 1px solid #eceef1;
        background: #fff;
    }

    .tw-tab {
        min-height: 48px;
        padding: 0 20px;
        border: 0;
        border-bottom: 3px solid transparent;
        background: none;
        font: inherit;
        font-size: 15px;
        font-weight: 700;
        color: var(--muted);
        cursor: pointer;
    }

    .tw-tab:hover {
        color: var(--text);
    }

    .tw-tab.is-active {
        border-bottom-color: var(--primary);
        color: var(--primary);
    }

    .tw-panel-head {
        display: none;
    }

    .tw-info .tw-panel,
    .tw-info .product-reviews.tw-panel {
        margin-bottom: 0;
        border-radius: 0 0 14px 14px;
    }

    .tw-info .tw-panel:not(.is-open) {
        display: none;
    }

    .tw-panel .pd-content,
    .tw-info .product-reviews .tw-panel-body > div {
        padding: 24px 28px 8px;
    }

    .tw-info .product-reviews .tw-panel-body > div {
        padding-bottom: 24px;
    }
}

/* ---------- Product rows ---------- */
.tw-row {
    margin-bottom: 24px;
}

.tw-row[hidden] {
    display: none;
}

.tw-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.tw-row-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.tw-row-head a,
.tw-recent-clear {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    cursor: pointer;
}

.tw-recent-clear {
    color: var(--muted);
}

.tw-row-head .tw-i {
    width: 15px;
    height: 15px;
}

.tw-row-track {
    display: grid;
    grid-auto-columns: 46%;
    grid-auto-flow: column;
    gap: 10px;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.tw-row-track::-webkit-scrollbar {
    display: none;
}

.tw-row-track > * {
    scroll-snap-align: start;
}

/* The listing card, shared with the shop pages. */
.tw-row .product-card.twl-card {
    min-width: 0;
    border-color: #e8e9ec;
    border-radius: 12px;
    background: #fff;
}

.tw-row .twl-thumb {
    background: #f3f4f6;
}

.tw-row .twl-thumb img {
    display: block;
    border-radius: 0;
}

.tw-row .twl-off {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.tw-row .product-body.twl-body {
    gap: 4px;
    text-align: left;
}

.tw-row .product-title.twl-name {
    min-height: 0;
    margin: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.tw-row .twl-name a {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tw-row .twl-rating {
    font-size: 12px;
    color: var(--muted);
}

.tw-row .twl-rating span {
    color: #f5a623;
}

.tw-row .twl-rating em {
    font-style: normal;
}

.tw-row .product-price.twl-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    margin: 0 0 8px;
    font-family: inherit;
}

.tw-row .twl-price strong {
    font-size: 15px;
    color: var(--primary);
}

.tw-row .twl-price del {
    font-size: 12px;
    font-weight: 400;
    color: #9aa1ab;
}

.tw-row .twl-save {
    font-size: 11px;
    font-weight: 700;
    color: var(--secondary);
}

/* Recently viewed: a lighter card, built in the browser. */
.tw-recent-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding-bottom: 10px;
    border: 1px solid #e8e9ec;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    font-size: 13px;
    color: var(--text);
}

.tw-recent-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f3f4f6;
}

.tw-recent-card span {
    display: -webkit-box;
    padding: 0 10px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.tw-recent-card strong {
    padding: 0 10px;
    color: var(--primary);
}

@media (min-width: 768px) {
    .tw-row-track {
        grid-auto-columns: calc((100% - 30px) / 4);
    }
}

@media (min-width: 1200px) {
    .tw-row-track {
        grid-auto-columns: calc((100% - 48px) / 5);
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tw-panel-body,
    .tw-acc .tw-i,
    .tw-lb-fig img,
    .tw-pg-nav {
        transition: none;
    }
}
