:root {
    --admin-main: var(--primary-color, #22381f);
    --admin-hover: #162614;
    --admin-light: rgba(34, 56, 31, 0.05);
    --admin-soft: rgba(34, 56, 31, 0.12);
    --admin-glow: rgba(34, 56, 31, 0.25);
    --gray-bg: #f8fafc;
    --gray-border: #e2e8f0;
    --gray-text: #64748b;
    --dark-text: #0f172a;
    --discount-red: #ef4444;
    --gold: #f59e0b;
    --card-shadow: 0 18px 40px -15px rgba(0, 0, 0, 0.07);
}

body {
    background-color: #fafbfc;
    color: var(--dark-text);
}

.product-detail-wrapper {
    /* #main-content is a flex column and `margin: 0 auto` disables stretch,
       so without an explicit width this wrapper shrink-wraps its content.
       The active tab panel then decided the page width (and, through the
       1:1 gallery, the product card's height) — switching tabs resized it.
       width: 100% makes it always fill up to max-width, independent of
       which tab is open. */
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 20px 18px 75px;
}

/* Breadcrumb */
.breadcrumb-nav {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--gray-text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    padding: 9px 18px;
    border-radius: 50px;
    border: 1px solid var(--gray-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    width: fit-content;
}

.breadcrumb-nav a {
    color: var(--gray-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-nav a:hover {
    color: var(--admin-main);
}

.breadcrumb-nav .sep {
    font-size: 0.72rem;
    color: #cbd5e1;
}

/* ========================================================
   Product Wrapper (الحجم المتوازن الوسط بدون مبالغة)
   ======================================================== */
.product-wrapper {
    background: #ffffff;
    border-radius: 28px;
    padding: 34px 32px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: var(--card-shadow);
}

.product-wrapper.row {
    margin-left: 0;
    margin-right: 0;
}

/* Gallery Section */
.product-image-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--gray-border);
    background: #fff;
}

.product-image-container .carousel-inner,
.product-image-container .carousel-item {
    width: 100%;
    height: 100%;
}

.product-image-container .carousel-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-image-container:hover .carousel-inner img {
    transform: scale(1.05);
}

.carousel-control-prev,
.carousel-control-next {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(6px);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.7);
    opacity: 0.85;
    transition: all 0.25s ease;
}

.carousel-control-prev { left: 14px; }
.carousel-control-next { right: 14px; }

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: var(--admin-main) !important;
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    filter: brightness(0) invert(1);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(0.2);
    width: 17px;
    height: 17px;
}

.gallery-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    max-width: 460px;
    margin-inline: auto;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb-item {
    width: 74px;
    height: 74px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    padding: 0;
    font: inherit;
}

.gallery-thumb-item:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: 2px;
}

.gallery-thumb-item.active,
.gallery-thumb-item:hover {
    border-color: var(--admin-main);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--admin-glow);
}

/* Gallery zoom trigger — the whole main image is a real <button>, so
   clicking/tapping it (or reaching it with the keyboard) opens the
   lightbox. A subtle magnifier badge in the corner signals it's zoomable
   without shouting over the product photo itself. */
.gallery-zoom-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    position: relative;
}

.gallery-zoom-icon {
    position: absolute;
    bottom: 14px;
    inset-inline-end: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    color: var(--admin-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.product-image-container:hover .gallery-zoom-icon,
.gallery-zoom-trigger:focus-visible .gallery-zoom-icon {
    opacity: 1;
    transform: translateY(0);
}

.gallery-zoom-trigger:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: -2px;
}

/* No product/gallery image at all, or a broken URL caught by onerror —
   the same tasteful neutral fallback everywhere (never the browser's
   broken-image icon). */
.carousel-item.img-fallback,
.pd-gallery-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-bg);
    color: #cbd5e1;
    font-size: 3.5rem;
}

/* ============ Lightbox ============ */
.pd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-lightbox[hidden] { display: none; }

.pd-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 10, 0.92);
    backdrop-filter: blur(4px);
}

.pd-lightbox-stage {
    position: relative;
    z-index: 1;
    width: min(92vw, 900px);
    height: min(86vh, 900px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    animation: pdLightboxIn 0.22s ease;
}

@keyframes pdLightboxIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.pd-lightbox-close {
    position: absolute;
    top: 18px;
    inset-inline-end: 18px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}
.pd-lightbox-close:hover { background: rgba(255,255,255,0.22); }
.pd-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.pd-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.pd-lightbox-nav:hover { background: rgba(255,255,255,0.22); transform: translateY(-50%) scale(1.06); }
.pd-lightbox-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pd-lightbox-prev { inset-inline-start: 16px; }
.pd-lightbox-next { inset-inline-end: 16px; }

@media (max-width: 576px) {
    .pd-lightbox-nav { width: 42px; height: 42px; font-size: 1rem; }
    .pd-lightbox-close { width: 38px; height: 38px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pd-lightbox-stage img { animation: none; }
}

/* ============ Related Products ============
   Section layout is bespoke to this page; the card itself is the
   canonical component from store/templates/store/partials/_product_card.html
   (same one used on Store/Category/Search/Favorites/Home), so it always
   matches pricing, ratings, wishlist and Add-to-Cart everywhere else. */
/* A secondary, compact continuation of the page — never a second storefront.
   Backend caps related_products at 3 (store/views.py), so this is a plain,
   predictable 3-column row: no stretching to fill leftover width, no
   auto-fit/auto-fill guessing a column count from available space. The grid
   itself is capped and centered inside .product-detail-wrapper (max-width
   1220px above) rather than spanning it edge-to-edge, which combined with
   the .pd-title rename above (that rename is the actual fix for "titles the
   size of the page H1") is what keeps these cards visually restrained. */
.related-products-section {
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.related-products-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--dark-text);
    margin-bottom: 20px;
}

.related-products-heading i { color: var(--admin-main); font-size: 1.05rem; }

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    max-width: 860px;
    margin-inline: auto;
}

.related-products-item { min-width: 0; height: 100%; }

/* Tablet: 2 comfortable columns, the 3rd card naturally wraps to its own
   row rather than being squeezed into a 3rd shrinking column. */
@media (max-width: 991px) {
    .related-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        max-width: 620px;
    }
}

/* Phones: a touch-swipeable horizontal carousel — pure CSS scroll-snap,
   no JS/library, no autoplay. The strip scrolls inside itself only
   (overscroll-behavior contains the gesture), so the page never moves
   sideways. Each card is ~62% of the strip, so the next card always peeks
   in from the edge as a visual "swipe for more" cue. The strip bleeds into
   .product-detail-wrapper's side padding (--rp-bleed) so cards slide out to
   the screen edge, while scroll-padding keeps the snapped card aligned with
   the rest of the page content. Card markup/links are untouched. */
@media (max-width: 767px) {
    .related-products-section { --rp-bleed: 18px; }

    .related-products-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: min(62%, 260px);
        gap: 12px;
        max-width: none;
        margin-inline: calc(var(--rp-bleed) * -1);
        padding: 8px var(--rp-bleed) 14px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--rp-bleed);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .related-products-grid::-webkit-scrollbar { display: none; }

    .related-products-item {
        scroll-snap-align: start;
        scroll-snap-stop: normal;
    }
}

@media (max-width: 576px) {
    /* Matches .product-detail-wrapper's phone side padding below. */
    .related-products-section { --rp-bleed: 10px; }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
    .related-products-grid { scroll-behavior: smooth; }
}

/* ============ Mobile sticky purchase bar ============
   Hidden by default (both the HTML `hidden` attribute and this class);
   JS toggles it via IntersectionObserver watching the normal Add to Cart
   button, so it only appears once that button scrolls out of view. */
.pd-sticky-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1040;
    display: none;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(0,0,0,0.09);
    border-top: 1px solid var(--gray-border);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.pd-sticky-bar.is-visible {
    display: flex;
}

/* A tiny delay lets `display` take effect before the transform runs, so
   the slide-up animation actually plays instead of popping in instantly. */
.pd-sticky-bar.is-visible.is-shown {
    transform: translateY(0);
}

.pd-sticky-price {
    flex: none;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.pd-sticky-price-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--admin-main);
}

.pd-sticky-price-currency {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gray-text);
}

.pd-sticky-add-btn {
    height: 48px;
    font-size: 0.98rem;
    border-radius: 14px;
}

/* Reserve room at the bottom of the page while the sticky bar is showing
   so Reviews / Related Products / the footer are never hidden behind it. */
body.has-pd-sticky-bar .product-detail-wrapper {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 992px) {
    /* Desktop always has the normal purchase panel comfortably in view —
       the sticky bar is a mobile/tablet-only pattern. */
    .pd-sticky-bar { display: none !important; }
    body.has-pd-sticky-bar .product-detail-wrapper { padding-bottom: 75px; }
}

@media (prefers-reduced-motion: reduce) {
    .pd-sticky-bar { transition: none; }
}

.gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.meta-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.stock-badge {
    padding: 5px 13px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.in-stock-badge { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.out-stock-badge { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.category-badge {
    background: var(--admin-light);
    color: var(--admin-main);
    border: 1px solid var(--admin-soft);
    padding: 5px 13px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Renamed from the collision-prone ".product-title" (this page's own <style>
   block loads AFTER product_card.css in <head>, so with equal specificity a
   bare ".product-title" here was silently overriding the canonical card's
   title style — including inside every card in "You May Also Like" below,
   which is exactly what made related-product titles render at page-H1 size.
   This page's own product name now has its own, non-colliding class. */
.pd-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--dark-text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

/* Optional Size / Measurement (Product.measurement — translated via
   modeltranslation, see store/translation.py, so it already reads in
   whichever language is active). Secondary to the title: smaller, muted,
   no background, sitting quietly between the name and the wishlist/price
   so it never competes with either. */
.product-measurement-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--gray-text);
}
.product-measurement-detail i {
    font-size: 0.82rem;
    color: var(--gray-text);
    opacity: 0.85;
}

/* Rating row — same calculation as the canonical Product Card
   (product.average_rating / product.active_testimonials_count), just
   presented inline. Clicking jumps to the Reviews section below. */
.product-rating-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    text-decoration: none !important;
    color: var(--dark-text);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}
.product-rating-row:hover .product-rating-value { text-decoration: underline; }
.product-rating-row .stars-outer i { color: var(--gold); font-size: 0.9rem; }
.product-rating-row .stars-outer i + i { margin-inline-start: 1px; }
.product-rating-count { color: var(--gray-text); font-weight: 600; }

/* Compact icon-only wishlist control — sits beside Add to Cart so it
   complements the primary action instead of competing with it. */
.wishlist-icon-btn {
    flex: none;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: #ffffff;
    color: var(--gray-text);
    border: 1.5px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wishlist-icon-btn:hover:not(.is-disabled) {
    border-color: var(--discount-red);
    color: var(--discount-red);
    background: #fff5f5;
    transform: translateY(-2px);
}

.wishlist-icon-btn:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: 2px;
}

.wishlist-icon-btn.active {
    background: #fff1f2;
    border-color: #fecdd3;
    color: var(--discount-red);
}

.wishlist-icon-btn.active i { animation: pdHeartPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes pdHeartPulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Out of stock and not already favorited: kept visible, but greyed out
   and inert — a new add is rejected server-side anyway (see
   store.views.wishlist_toggle). Never applied to a product that's
   already in the wishlist, so removal always stays available. */
.wishlist-icon-btn.is-disabled {
    cursor: not-allowed;
    color: #cbd5e1;
    border-color: var(--gray-border);
    background: #f8fafc;
}
.wishlist-icon-btn.is-disabled:hover {
    transform: none;
    color: #cbd5e1;
    border-color: var(--gray-border);
    background: #f8fafc;
}

@media (prefers-reduced-motion: reduce) {
    .wishlist-icon-btn.active i { animation: none; }
}

/* Price Box */
.price-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 20px;
    background: var(--gray-bg);
    border-radius: 18px;
    border: 1px solid var(--gray-border);
    margin-bottom: 22px;
    width: fit-content;
}

.product-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--admin-main);
    letter-spacing: -0.02em;
    line-height: 1;
}

.old-price-detail {
    font-size: 1.25rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: line-through;
}

.discount-savings-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 11px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
}

/* Quantity Controls */
.pd-qty-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-text);
    margin-bottom: 8px;
}

.qty-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    padding: 6px;
    border-radius: 16px;
    border: 1.5px solid var(--gray-border);
    margin-bottom: 22px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gray-bg);
    color: var(--dark-text);
    border: 1px solid var(--gray-border);
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: none;
}

.qty-btn:hover:not(:disabled) {
    background: var(--admin-main);
    color: #fff;
    border-color: var(--admin-main);
}

.qty-btn:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: 2px;
}

/* A real, typeable quantity input (not just a static counter) — clamped
   and normalized in JS (see the shared quantity logic at the bottom of
   this file), so a manually typed value can never go below 1, above the
   sane ceiling, or be non-numeric. */
.qty-value-input {
    width: 56px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark-text);
    text-align: center;
    -moz-appearance: textfield;
}
.qty-value-input::-webkit-outer-spin-button,
.qty-value-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-value-input:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ========================================================
   Purchase actions — Add to Cart (primary, strongest visual weight) +
   compact Wishlist icon sitting right beside it.
   ======================================================== */
.purchase-actions-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 8px;
}

.add-cart-btn {
    flex: 1 1 auto;
    min-width: 0;
    height: 58px;
    font-size: 1.08rem;
    font-weight: 700;
    border-radius: 16px;
    background: var(--admin-main) !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 8px 25px var(--admin-soft);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-cart-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.add-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.7s ease;
}

.add-cart-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px var(--admin-soft);
}

.add-cart-btn:hover:not(:disabled)::before {
    left: 100%;
}

.add-cart-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.add-cart-btn:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: 3px;
}

.add-cart-btn:disabled {
    background: #cbd5e1 !important;
    box-shadow: none;
    cursor: not-allowed;
}

/* Loading / success states shared by the normal CTA and the sticky bar's
   CTA (see the shared addProductToCart() JS function). */
.add-cart-btn.is-loading { pointer-events: none; }
.add-cart-btn.is-loading i { animation: pdCartSpin 0.7s linear infinite; }
.add-cart-btn.is-success { background: #059669 !important; }

@keyframes pdCartSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .add-cart-btn.is-loading i { animation: none; }
}

/* Trust Badges Strip */
.trust-badges-strip {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--gray-border);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.84rem;
    color: var(--gray-text);
    font-weight: 600;
}

.trust-item i {
    font-size: 1.15rem;
    color: var(--admin-main);
}

/* Delivery Info Card */
.delivery-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--admin-light);
    border: 1px solid var(--admin-soft);
    border-radius: 16px;
}

.delivery-info-icon {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--admin-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-main);
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.delivery-info-body {
    min-width: 0;
}

.delivery-info-title {
    font-weight: 800;
    font-size: 0.96rem;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.delivery-info-card.is-free .delivery-info-title i {
    color: #059669;
}

.delivery-info-meta {
    margin-top: 3px;
    font-size: 0.84rem;
    color: var(--gray-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.delivery-info-fee {
    color: var(--admin-main);
    font-weight: 800;
}

.delivery-info-dot {
    color: var(--gray-border);
}

@media (max-width: 576px) {
    .delivery-info-card { padding: 14px; gap: 11px; }
    .delivery-info-icon { width: 36px; height: 36px; font-size: 0.95rem; }
}

/* Tabs Section */
.product-tabs-container {
    margin-top: 45px;
    background: #ffffff;
    border-radius: 26px;
    border: 1px solid var(--gray-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.custom-tabs-header {
    display: flex;
    background: var(--gray-bg);
    border-bottom: 1px solid var(--gray-border);
    padding: 10px 14px 0;
    gap: 8px;
}

.custom-tab-button {
    background: transparent;
    border: none;
    padding: 15px 24px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--gray-text);
    cursor: pointer;
    transition: all 0.25s ease;
    border-start-start-radius: 14px;
    border-start-end-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    position: relative;
}

.custom-tab-button:hover {
    color: var(--admin-main);
    background: rgba(255,255,255,0.6);
}

.custom-tab-button:focus-visible {
    outline: 2px solid var(--admin-main);
    outline-offset: -2px;
}

.custom-tab-button.active {
    color: var(--admin-main);
    background: #ffffff;
}

.custom-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 3px;
    background: var(--admin-main);
    border-start-start-radius: 4px;
    border-start-end-radius: 4px;
}

.custom-tab-panel {
    display: none;
    padding: 36px;
    animation: fadeInTab 0.3s ease;
}

.custom-tab-panel.active { display: block; }

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Shipping Info (Shipping & Returns tab) */
.shipping-info-block {
    max-width: 800px;
    margin-bottom: 22px;
    padding: 22px 26px;
    background: var(--admin-light);
    border: 1px solid var(--admin-soft);
    border-radius: 18px;
}

.shipping-info-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark-text);
    margin: 0 0 14px;
}

.shipping-info-heading i {
    color: var(--admin-main);
}

.shipping-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shipping-info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--dark-text);
}

.shipping-info-list li i {
    color: var(--admin-main);
    width: 18px;
    text-align: center;
}

.shipping-returns-link-row {
    margin-bottom: 18px;
}

.shipping-returns-link-row a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--admin-main);
    text-decoration: none;
}

.shipping-returns-link-row a:hover {
    text-decoration: underline;
}

/* Return Policy Container */
.policy-container {
    background: var(--gray-bg);
    border: 1px dashed var(--gray-border);
    border-radius: 18px;
    padding: 26px;
    max-width: 800px;
}

.policy-badge-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    padding: 7px 16px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.policy-badge-box.returnable {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.policy-badge-box.non-returnable {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.policy-text-desc {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--gray-text);
}

/* ========================================================
   REELS SHOWCASE (3 فيديوهات ممتدة على الديسكتوب بدون أزرار ولا صوت)
   ======================================================== */
.tab-reels-container {
    width: 100%;
}

.tab-reels-header {
    text-align: center;
    margin-bottom: 26px;
}

.tab-reels-header .reels-pill-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-light);
    color: var(--admin-main);
    padding: 7px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--admin-soft);
}

.tab-reels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    align-items: center;
}

.tab-reel-card {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 22px;
    overflow: hidden;
    background: #020617;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
    border: 2px solid var(--gray-border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.tab-reels-grid:hover .tab-reel-card {
    opacity: 0.85;
    filter: brightness(0.95);
}

.tab-reels-grid:hover .tab-reel-card:hover {
    opacity: 1;
    filter: brightness(1.04);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
    border-color: var(--admin-main);
}

.tab-reel-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reel-ambient-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.35);
    border-radius: 22px;
    z-index: 1;
}

/* Testimonial & Review Section */
.testimonial-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 26px;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid var(--gray-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--admin-main), var(--admin-hover));
    color: #ffffff;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px var(--admin-glow);
}

.review-input-box {
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--gray-border);
    padding: 28px;
    box-shadow: var(--card-shadow);
    margin-bottom: 35px;
}

.submit-review-btn {
    background: var(--admin-main) !important;
    color: white !important;
    border: none;
    padding: 13px 30px;
    border-radius: 13px;
    font-weight: 700;
    font-size: 0.98rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px var(--admin-glow);
    cursor: pointer;
}

.submit-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--admin-glow);
    background: var(--admin-hover) !important;
}

.rating-wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

/* Kept in the tab order and screen-reader tree (visually-hidden, not
   display:none) so keyboard users can reach and select a rating. */
.rating-wrapper input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.rating-wrapper label {
    cursor: pointer;
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23cbd5e1'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
    border-radius: 4px;
}

.rating-wrapper input:checked ~ label,
.rating-wrapper label:hover,
.rating-wrapper label:hover ~ label {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") !important;
    transform: scale(1.15);
}

.rating-wrapper input:focus-visible + label {
    outline: 2px solid var(--admin-main);
    outline-offset: 2px;
}

.visually-hidden-seo {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ========================================================
   Overflow guard for products that have videos.
   #main-content (main.html) is a flex COLUMN, and this wrapper has
   `margin: 0 auto`. Auto margins on the cross axis disable
   `align-self: stretch`, so the wrapper is sized shrink-to-fit, i.e.
   never narrower than its min-content width. The extra nowrap
   "Product Videos" tab button (and the 76vw reel cards when that tab
   is open) push that min-content past the phone viewport, widening the
   whole product card. min-width: 0 on the inner boxes and an explicit
   width below 992px stop intrinsic content widths from leaking up.
   ======================================================== */
.product-wrapper > [class*="col-"],
.product-tabs-container,
.custom-tab-panel,
.tab-reels-container {
    min-width: 0;
    max-width: 100%;
}

.tab-reel-card video {
    max-width: 100%;
}

/* Responsiveness */
@media (max-width: 991px) {
    .product-detail-wrapper {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .product-wrapper { padding: 24px; }
    .pd-title { font-size: 1.75rem; }
    .tab-reels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (max-width: 576px) {
    .product-detail-wrapper { padding: 14px 10px 45px; }
    .product-wrapper { padding: 18px 14px; border-radius: 22px; }
    .pd-title { font-size: 1.45rem; }
    .price-container { width: 100%; justify-content: space-between; padding: 12px 16px; }
    .product-price { font-size: 1.55rem; }
    .qty-wrapper { width: 100%; justify-content: space-between; }
    .trust-badges-strip { flex-direction: column; gap: 10px; }
    .custom-tabs-header {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .custom-tabs-header::-webkit-scrollbar { display: none; }
    .custom-tab-button { white-space: nowrap; padding: 13px 18px; font-size: 0.9rem; }
    .custom-tab-panel { padding: 22px 14px; }
    .review-input-box { padding: 20px 16px; }

    .tab-reels-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 14px;
        justify-content: flex-start;
    }
    .tab-reels-grid::-webkit-scrollbar { display: none; }
    .tab-reel-card {
        flex: 0 0 76vw;
        max-width: 300px;
        scroll-snap-align: center;
        border-radius: 18px;
    }
}
