/* ============================================
   Dida Shop - Main Stylesheet (v2)
   ============================================ */

:root {
    /* ✅ Dida Shop Brand — Magenta Purple */
    --brand-color: #AA3CBE;
    --brand-dark:  #8B2D9C;
    --brand-light: #F7E9FA;
    --brand-50:    #FAF3FC;
    --brand-100:   #F0DAF6;
    --brand-200:   #DFB6EC;
    --brand-600:   #9434A8;
    --brand-700:   #7A2A8B;
    --brand-gradient: linear-gradient(135deg, #AA3CBE 0%, #7A2A8B 100%);
    --brand-gradient-soft: linear-gradient(135deg, #F7E9FA 0%, #F0DAF6 100%);

    --text-dark:   #1A1A2E;
    --text-body:   #4A4A6A;
    --text-light:  #8B8BA7;
    --bg-page:     #F8F8FB;
    --bg-card:     #FFFFFF;
    --border-light:#EAEAF2;
    --border-soft: #F1F1F8;

    --shadow-sm:   0 1px 2px rgba(26,26,46,.04), 0 1px 3px rgba(26,26,46,.06);
    --shadow-md:   0 2px 8px rgba(26,26,46,.06), 0 4px 12px rgba(26,26,46,.04);
    --shadow-lg:   0 8px 24px rgba(26,26,46,.08), 0 4px 8px rgba(26,26,46,.04);
    --shadow-brand:0 6px 20px rgba(170,60,190,.25);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --base-font-size: 15px;
}

* { box-sizing: border-box; }

html { font-size: var(--base-font-size); -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    background: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
    overflow-x: hidden;
    max-width: 100vw;
}

img, video, iframe { max-width: 100%; }

/* ✅ Typography scale — Jumia/Noon-tier */
h1, .h1 { font-size: 1.85rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; }
h2, .h2 { font-size: 1.55rem; font-weight: 800; line-height: 1.3;  letter-spacing: -0.01em;  }
h3, .h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.35; }
h4, .h4 { font-size: 1.1rem;  font-weight: 700; line-height: 1.4;  }
h5, .h5 { font-size: 1rem;    font-weight: 700; line-height: 1.45; }
h6, .h6 { font-size: 0.9rem;  font-weight: 700; line-height: 1.5;  }

.text-body-soft { color: var(--text-body); }

.btn { font-size: 0.9rem; font-weight: 700; letter-spacing: 0; }
.btn-lg { font-size: 1rem; padding-block: .7rem; }
.btn-sm { font-size: 0.78rem; }

.fs-1 { font-size: 2rem !important; }
.fs-2 { font-size: 1.6rem !important; }
.fs-3 { font-size: 1.3rem !important; }
.fs-4 { font-size: 1.1rem !important; }
.fs-5 { font-size: 1rem !important; }
.fs-6 { font-size: 0.88rem !important; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-color); }

.text-brand { color: var(--brand-color) !important; }
.bg-brand { background-color: var(--brand-color) !important; }
.bg-brand-light { background-color: var(--brand-light) !important; }
.border-brand { border-color: var(--brand-color) !important; }
.bg-brand-gradient { background: var(--brand-gradient) !important; color:#fff; }

/* ✅ Premium buttons — gradient fill, soft shadow, lift on hover */
.btn-brand {
    background: var(--brand-gradient);
    color: #fff;
    border: 1px solid transparent;
    transition: all .2s ease;
    box-shadow: 0 4px 12px rgba(170,60,190,.22);
}
.btn-brand:hover, .btn-brand:focus {
    background: linear-gradient(135deg, #9434A8 0%, #6A2179 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(170,60,190,.32);
    transform: translateY(-1px);
}
.btn-brand:active { transform: translateY(0); }

.btn-outline-brand {
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
    background: transparent;
    transition: all .2s ease;
    font-weight: 700;
}
.btn-outline-brand:hover, .btn-outline-brand:focus {
    background: var(--brand-color);
    color: #fff;
    box-shadow: 0 6px 18px rgba(170,60,190,.25);
}

.hover-brand:hover { color: var(--brand-color) !important; }

.brand-text { font-size: 1.4rem; }

/* ✅ Helpers */
.shadow-card { box-shadow: var(--shadow-md); }
.shadow-card-lg { box-shadow: var(--shadow-lg); }
.shadow-brand { box-shadow: var(--shadow-brand); }
.rounded-card { border-radius: var(--radius-lg); }
.word-break { word-break: break-all; }

/* ============ Announcement Bar ============ */
.announcement-bar {
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0;
}

/* ============ Header ============ */
.main-header { z-index: 1020; box-shadow: var(--shadow-sm); }
.main-header .nav-link { font-size: 0.9rem; font-weight: 600; padding-inline: 1rem; }
.main-header .nav-link:hover { color: var(--brand-color) !important; }
.top-bar { font-size: 0.8rem; background: #fff !important; border-bottom: 1px solid var(--border-soft); }

/* Logo container — never let it collapse */
.navbar-brand img { display: block; max-height: 44px; width: auto; }
@media (max-width: 575px) {
    .navbar-brand img { max-height: 36px; }
}

/* ============ Hero Slider — Premium ============ */
.hero-slider { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md); }
.hero-slider picture { display: block; line-height: 0; }
.hero-slider .carousel-item img,
.hero-slider .carousel-item .banner-img {
    width: 100%;
    height: 440px;             /* fixed height = no CLS */
    object-fit: cover;         /* never distort */
    object-position: center;
    border-radius: 0;
    display: block;
}
.hero-slider .banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 2.5rem 3rem;
    background: linear-gradient(90deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.6) 45%, rgba(255,255,255,.05) 75%, transparent 100%);
}
[dir="rtl"] .hero-slider .banner-overlay {
    background: linear-gradient(-90deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.6) 45%, rgba(255,255,255,.05) 75%, transparent 100%);
}
.hero-slider .banner-text { max-width: 55%; }
.hero-slider .banner-title {
    font-size: 2.2rem !important;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--text-dark);
}
.hero-slider .banner-subtitle {
    font-size: 1.05rem !important;
    color: var(--text-body);
    line-height: 1.55;
}
.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next { width: 6%; opacity: 0; transition: opacity .2s; }
.hero-slider:hover .carousel-control-prev,
.hero-slider:hover .carousel-control-next { opacity: 1; }
.hero-slider .carousel-indicators [data-bs-target] {
    width: 28px; height: 4px; border-radius: 4px; background: rgba(170,60,190,.35);
}
.hero-slider .carousel-indicators .active { background: var(--brand-color); }

@media (max-width: 991px) {
    .hero-slider .carousel-item img,
    .hero-slider .carousel-item .banner-img { height: 360px; }
}
@media (max-width: 767px) {
    /* Mobile banners use a portrait crop. If the admin uploaded a real mobile
       image (via <picture><source>), it's already optimized for this height. */
    .hero-slider .carousel-item img,
    .hero-slider .carousel-item .banner-img { height: 380px; }
    .hero-slider .banner-overlay {
        padding: 1.25rem 1.5rem;
        background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.7) 50%, rgba(255,255,255,.15) 100%);
        /* Anchor text to the top so the product/scene below stays visible */
        align-items: flex-start;
        padding-top: 1.5rem;
    }
    .hero-slider .banner-text { max-width: 100%; }
    .hero-slider .banner-title    { font-size: 1.25rem !important; }
    .hero-slider .banner-subtitle { font-size: .85rem  !important; }
    .hero-slider .carousel-control-prev,
    .hero-slider .carousel-control-next { display: none; } /* touch users swipe */
}
@media (max-width: 480px) {
    .hero-slider .carousel-item img,
    .hero-slider .carousel-item .banner-img { height: 340px; }
}

/* ============ Trust Section — Premium ============ */
.trust-section {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-soft);
}
.trust-item {
    text-align: center;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--border-soft);
    transition: background .2s;
}
.trust-item:last-child { border-right: 0; }
.trust-item:hover { background: var(--brand-50); }
.trust-icon {
    font-size: 1.8rem;
    color: var(--brand-color);
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    background: var(--brand-light);
    border-radius: 50%;
}
.trust-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text-dark); }
.trust-desc { font-size: 0.8rem; color: var(--text-light); margin: 0; }
@media (max-width: 575px) {
    .trust-item { padding: 1rem .5rem; }
    .trust-icon { width: 44px; height: 44px; font-size: 1.4rem; }
    .trust-title { font-size: .85rem; }
    .trust-desc { font-size: .72rem; }
}

/* ============ Section Title — Premium ============ */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    position: relative;
    letter-spacing: -.01em;
}
/* Centered with brand accent underline */
.section-title.text-center::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--brand-gradient);
    border-radius: 3px;
}
/* Section header bar (with view-all) */
.section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: .75rem 1.25rem;
    background: #fff;
    border-radius: var(--radius);
    border-right: 4px solid var(--brand-color);
    box-shadow: var(--shadow-sm);
}
[dir="ltr"] .section-bar { border-right: 0; border-left: 4px solid var(--brand-color); }
.section-bar h2 { margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--text-dark); }
.section-bar .section-icon { color: var(--brand-color); margin-inline-end: .5rem; }
.section-bar .view-all {
    color: var(--brand-color);
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
}
.section-bar .view-all:hover { color: var(--brand-dark); }

/* ============ Categories — Premium ============ */
.category-item {
    display: block;
    text-align: center;
    padding: 1rem .85rem;
    background: #fff;
    border-radius: var(--radius-lg);
    transition: all .25s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
    position: relative;
    overflow: hidden;
}
.category-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity .25s;
    z-index: 0;
}
.category-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-200);
}
.category-item:hover .category-name { color: var(--brand-color); }
.category-img-wrap {
    width: 88px;
    height: 88px;
    margin: 0 auto 0.7rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--brand-light);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(170,60,190,.12);
    position: relative;
    z-index: 1;
}
.category-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.category-item:hover .category-img-wrap img { transform: scale(1.08); }
.category-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.92rem;
    transition: color .2s;
    position: relative;
    z-index: 1;
}
@media (max-width: 575px) {
    .category-img-wrap { width: 72px; height: 72px; }
    .category-name { font-size: .82rem; }
}

/* ============ Product Card — Premium Jumia/Noon-tier ============ */
.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .25s ease;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid var(--border-soft);
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-200);
}
.product-card > a:first-child { padding: .75rem .75rem 0; display: block; }
.product-card > .mt-auto { padding: 0 .75rem .75rem; margin-top: auto; }

.product-img-wrap {
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--radius);
    background: #FAFAFC;
    margin-bottom: .65rem;
    position: relative;
}
.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.product-card:hover .product-img { transform: scale(1.06); }

/* Discount badge — premium */
.discount-badge {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(220,38,38,.3);
    letter-spacing: -.01em;
}

/* New: Free shipping badge */
.free-shipping-badge {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 0.68rem;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(16,185,129,.25);
}

.quick-view-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.18) 80%, rgba(0,0,0,.45) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s;
    padding: 0 0 12px;
}
.product-card:hover .quick-view-overlay { opacity: 1; }
.quick-view-overlay .btn { font-size: .72rem; padding: 5px 12px; }

.product-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.4rem;
    line-height: 1.45;
    height: 2.65em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    letter-spacing: -.005em;
}
.product-card:hover .product-title { color: var(--brand-color); }

.stars-wrap { font-size: 0.72rem; color: #f59e0b; }
.sales-count { font-size: 0.7rem; color: var(--text-light); }

.price-wrap { margin-bottom: 0.5rem; display:flex; align-items:baseline; flex-wrap:wrap; gap:.4rem; }
.price-wrap .price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-color);
    letter-spacing: -.015em;
    line-height: 1.1;
}
.price-wrap .currency { font-size: 0.75rem; font-weight: 600; color: var(--brand-color); }
.price-wrap .old-price {
    color: var(--text-light);
    text-decoration: line-through;
    text-decoration-color: rgba(139,139,167,.6);
    font-size: 0.82rem;
    font-weight: 500;
}

.stock-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.stock-in  { background: #d1fae5; color: #065f46; }
.stock-out { background: #fee2e2; color: #991b1b; }

.add-to-cart-btn {
    width: 100%;
    padding: 0.55rem .9rem;
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.82rem;
    transition: all .2s;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(170,60,190,.18);
    letter-spacing: -.005em;
}
.add-to-cart-btn:hover { box-shadow: 0 6px 14px rgba(170,60,190,.30); transform: translateY(-1px); }
.add-to-cart-btn:active { transform: translateY(0); }
.add-to-cart-btn:disabled { background: #d1d5db; color:#6b7280; cursor: not-allowed; box-shadow: none; }

/* ============ Product Page ============ */
.product-title-large {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
}
.main-img {
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #f5f5f5;
}
.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    border-radius: 6px;
}
.thumb-img:hover, .thumb-img.active { border-color: var(--brand-color); }

/* ============ Cart Page ============ */
.cart-container, .summary-box, .checkout-container { background: #fff; }

/* ✅ Premium payment-method cards */
.payment-method-card {
    cursor: pointer;
    transition: all .2s ease;
    border-color: var(--border-light) !important;
    background: #fff;
}
.payment-method-card:hover {
    border-color: var(--brand-200) !important;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.payment-method-card.pm-active {
    border-color: var(--brand-color) !important;
    background: var(--brand-50);
    box-shadow: 0 6px 18px rgba(170,60,190,.15);
}
.payment-method-card .pm-inline-info { display: none; }
.payment-method-card.pm-active .pm-inline-info { display: block; }

/* ✅ Pagination — Brand */
.pagination .page-link {
    color: var(--brand-color);
    border: 1px solid var(--border-light);
    padding: .5rem .9rem;
    font-weight: 600;
    margin-inline: 2px;
    border-radius: 8px !important;
}
.pagination .page-link:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
    border-color: var(--brand-200);
}
.pagination .page-item.active .page-link {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(170,60,190,.25);
}
.pagination .page-item.disabled .page-link { color: var(--text-light); background: transparent; }

/* ============ Reviews / Testimonials (Pro Card) ============ */
.review-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.25s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.review-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.review-img-wrap {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
}
.review-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.review-card:hover .review-img-wrap img { transform: scale(1.05); }
.review-zoom-icon {
    position: absolute;
    bottom: 8px;
    inset-inline-end: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.review-card:hover .review-zoom-icon { opacity: 1; }

.review-body {
    padding: 0.75rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.review-name { font-size: 0.85rem; color: var(--text-dark); }
.review-stars { font-size: 0.75rem; color: #f59e0b; }
.review-text {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.review-date { color: var(--text-light); font-size: 0.7rem; }

/* legacy: keep old testimonial-card class working */
.testimonial-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.25s;
    background: #fff;
    aspect-ratio: 1/1;
    cursor: pointer;
    position: relative;
}
.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.testimonial-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.testimonial-card:hover img { transform: scale(1.05); }

/* ============ Footer ============ */
.site-footer { background: #1a1a1a; font-size: 0.85rem; }
.site-footer h5 { font-size: 1.1rem; }
.site-footer h6 { font-size: 0.95rem; }
.site-footer a:hover { color: var(--brand-color) !important; }

/* ============ WhatsApp Float ============ */
/* z-index hierarchy:
   - mobile-bottom-nav: 1040
   - whatsapp-float:    1041 (above MBN so it stays tappable)
   - sticky-add-cart-mobile: 1042 (above MBN + WA on product page)
   - bootstrap modals: 1050+
*/
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    inset-inline-end: 25px;
    width: 56px;
    height: 56px;
    background: #25d366;
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 1041;
    transition: transform 0.2s;
    text-decoration: none;
    will-change: transform;
}
.whatsapp-float:hover { transform: scale(1.1); color: #fff; }

@media (max-width: 767.98px) {
    /* ✅ يجلس فوق mobile-bottom-nav (≈ 64px) + هامش لتجنّب التداخل */
    .whatsapp-float {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        inset-inline-end: 14px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* ============ Toast (Add to Cart success) ============ */
.toast-success-cart {
    background: #fff;
    border: 1px solid #d1fae5;
    border-inline-start: 4px solid #10b981;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 250px;
    max-width: 320px;
    margin-bottom: 0.5rem;
    animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ Sticky Add to Cart (mobile) ============ */
.sticky-add-cart-mobile {
    position: fixed;
    /* ✅ يجلس فوق mobile-bottom-nav (≈ 64px) — ويبقى تحت modals */
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    z-index: 1042;
    display: none;
}
@media (max-width: 767.98px) {
    .sticky-add-cart-mobile.show { display: flex; gap: 0.5rem; align-items: center; }
    /* عند ظهور Sticky Add To Cart، خبّي زر واتساب لتجنّب التداخل */
    body.has-sticky-cart .whatsapp-float { display: none; }
}
/* خبّي Sticky Add To Cart على الديسكتوب نهائياً */
@media (min-width: 768px) {
    .sticky-add-cart-mobile,
    .sticky-add-cart-mobile.show { display: none !important; }
}

/* ============ Live Sales Popup (Premium — Jumia/Noon style) ============ */
.lsp-toast {
    position: fixed;
    /* Desktop: أسفل-يسار، فوق زر واتساب */
    bottom: 96px;
    inset-inline-start: 24px;
    inset-inline-end: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
    background: #fff;
    border-radius: 16px;
    padding: 12px 36px 12px 12px;
    box-shadow: 0 12px 36px rgba(20, 6, 30, 0.18),
                0 2px 8px rgba(170, 60, 190, 0.08);
    border: 1px solid rgba(170, 60, 190, 0.12);
    border-inline-start: 4px solid var(--brand-color, #AA3CBE);
    z-index: 1031; /* فوق whatsapp-float (1030) لكن أقل من modals */
    opacity: 0;
    transform: translateY(28px) scale(.96);
    transition: transform .42s cubic-bezier(.18,.89,.32,1.28),
                opacity .35s ease;
    pointer-events: auto;
    font-family: inherit;
    direction: rtl;
    text-align: right;
}
[dir="ltr"] .lsp-toast { direction: ltr; text-align: left; padding: 12px 12px 12px 36px; }

.lsp-toast.lsp-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lsp-toast[hidden] { display: none; }

.lsp-toast .lsp-thumb {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(170,60,190,.08), rgba(170,60,190,.02));
    border: 1px solid rgba(170, 60, 190, 0.15);
}
.lsp-toast .lsp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lsp-toast .lsp-badge {
    position: absolute;
    bottom: -2px;
    inset-inline-end: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.lsp-toast .lsp-body {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
}
.lsp-toast .lsp-line1 {
    font-size: .92rem;
    color: #111;
    font-weight: 600;
}
.lsp-toast .lsp-line1 strong {
    color: #111;
    font-weight: 800;
}
.lsp-toast .lsp-line1 .lsp-from { color: #6b7280; font-weight: 500; }
.lsp-toast .lsp-line1 .lsp-city {
    color: var(--brand-color, #AA3CBE);
    font-weight: 700;
}
.lsp-toast .lsp-line2 {
    font-size: .82rem;
    color: #4b5563;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lsp-toast .lsp-line2 .lsp-product { font-weight: 700; color: #1f2937; }
.lsp-toast .lsp-line3 {
    font-size: .72rem;
    color: #9ca3af;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lsp-toast .lsp-line3 i { font-size: .72rem; }
.lsp-toast .lsp-verified {
    color: #059669;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.08);
    padding: 1px 7px;
    border-radius: 99px;
    font-size: .65rem;
}

.lsp-toast .lsp-close {
    position: absolute;
    top: 6px;
    inset-inline-end: 8px;
    background: transparent;
    border: 0;
    color: #9ca3af;
    width: 24px;
    height: 24px;
    line-height: 1;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    padding: 0;
}
.lsp-toast .lsp-close:hover { background: #f3f4f6; color: #374151; }

@media (hover: hover) {
    .lsp-toast:hover { box-shadow: 0 16px 44px rgba(20, 6, 30, 0.22); }
}

/* Mobile: bottom-center, full width with margins, above mobile-bottom-nav (64px) + whatsapp-float (78px) */
@media (max-width: 600px) {
    .lsp-toast {
        bottom: 138px;             /* فوق whatsapp-float (78px) + هامش */
        inset-inline-start: 10px;
        inset-inline-end: 10px;
        width: auto;
        max-width: none;
        padding: 10px 32px 10px 10px;
        gap: 10px;
        border-radius: 14px;
    }
    [dir="ltr"] .lsp-toast { padding: 10px 10px 10px 32px; }
    .lsp-toast .lsp-thumb { width: 48px; height: 48px; border-radius: 10px; }
    .lsp-toast .lsp-line1 { font-size: .85rem; }
    .lsp-toast .lsp-line2 { font-size: .76rem; }
    .lsp-toast .lsp-line3 { font-size: .68rem; }
}

/* احترام prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .lsp-toast { transition: opacity .2s ease; transform: none; }
    .lsp-toast.lsp-show { transform: none; }
}

/* ============ Lightbox ============ */
#imageLightbox .modal-content {
    background: #000;
    border-radius: 0;
}
@media (min-width: 768px) {
    #imageLightbox .modal-content { background: rgba(0,0,0,0.95); border-radius: 12px; }
}
#imageLightbox .modal-body {
    padding: 0;
    min-height: 75vh;
}
#imageLightbox img#lbImage {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
    cursor: zoom-in;
    user-select: none;
}
#imageLightbox img#lbImage.zoomed { transform: scale(1.6); cursor: zoom-out; }
#imageLightbox .btn-close-white {
    background-color: rgba(255,255,255,0.15);
    border-radius: 50%;
    padding: 0.5rem;
    opacity: 1;
}
#lbPrev, #lbNext {
    background: rgba(255,255,255,0.95);
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
}
#lbPrev:hover, #lbNext:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}
#lbCounter {
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

@media (max-width: 600px) {
    #lbPrev, #lbNext {
        width: 40px !important;
        height: 40px !important;
    }
    #imageLightbox img#lbImage { max-height: 70vh; }
}

/* ============ Misc ============ */
.alert-brand-light { background: var(--brand-light); color: var(--text-dark); }
.last-border-0:last-child { border: 0 !important; }
.transition-all { transition: all 0.2s; }
.hover-shadow:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important; }
.hover-bg-light:hover { background: #f8f9fa; }

[dir="rtl"] .form-floating > label {
    right: 0.75rem;
    left: auto;
    transform-origin: 100% 0;
}

/* lazy loading placeholder */
img[loading="lazy"] {
    background: #f5f5f5;
}

/* ============================================================
   DIDASHOP FIXES & IMPROVEMENTS (v3 patch)
   ============================================================ */

/* ===== Banner Button Fix — z-index & pointer-events ===== */
.banner-btn,
.hero-btn,
.slider-btn {
    position: relative;
    z-index: 50;
    pointer-events: auto !important;
}

/* Overlay must NOT block clicks */
.banner-overlay,
.hero-slider .banner-overlay {
    pointer-events: none;
}

/* But the text+button inside should receive clicks */
.banner-overlay .banner-text,
.banner-overlay .banner-btn {
    pointer-events: auto;
}

/* Any pseudo overlays */
.banner::before,
.hero::before,
.slider::before {
    pointer-events: none;
}

/* Make the carousel item wrapper non-blocking */
.hero-slider .carousel-item > .position-relative {
    pointer-events: auto;
}

/* ===== Search Autocomplete ===== */
.search-autocomplete-wrap {
    position: relative;
}

.search-suggest-box {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1100;
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.search-suggest-box.open {
    display: block;
}

.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.search-suggest-item:last-child {
    border-bottom: none;
}

.search-suggest-item:hover,
.search-suggest-item.active {
    background: var(--brand-light);
    color: var(--text-dark);
}

.search-suggest-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.search-suggest-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-suggest-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-color);
    white-space: nowrap;
}

.search-suggest-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Product Gallery Improvements ===== */
.thumb-wrap {
    display: inline-block;
}

.thumb-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    border-radius: 8px;
}

.thumb-img:hover,
.thumb-img.active {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.main-img-wrap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    cursor: zoom-in;
}

/* ===== UI Improvements ===== */

/* Slightly reduced font on product cards */
.product-title {
    font-size: 0.875rem;
}

.price-wrap .price {
    font-size: 1rem;
}

/* Better add-to-cart button */
.add-to-cart-btn {
    padding: 0.55rem;
    font-size: 0.82rem;
    border-radius: 20px;
    transition: all 0.2s;
}

/* Product card hover effect */
.product-card {
    border: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
    border-color: var(--brand-light);
}

/* Better spacing */
.section-title {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
}

/* ===== Reviews improvements ===== */
.review-card {
    border: 1px solid var(--border-light);
}

/* ===== Canonical/SEO canonical meta tag helpers ===== */
/* No CSS needed for SEO */


/* ============================================================
   ⭐ PREMIUM UPGRADES — Phase 1 (overrides legacy v3 patch)
   ============================================================ */

/* Section title final — left-aligned by default, centered if .text-center */
.section-title { font-size: 1.5rem; margin-bottom: 1.25rem; }
.section-title.text-center { text-align: center; }

/* ============ Premium Breadcrumb ============ */
.breadcrumb {
    background: #fff !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 14px !important;
    padding: .8rem 1.25rem !important;
    font-size: .88rem;
    box-shadow: var(--shadow-sm);
}
.breadcrumb-item { font-weight: 600; }
.breadcrumb-item a { color: var(--text-body); }
.breadcrumb-item a:hover { color: var(--brand-color); }
.breadcrumb-item.active { color: var(--brand-color) !important; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }

/* ============ Promo Strip (between sections) ============ */
.promo-strip {
    background: var(--brand-gradient);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-brand);
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.promo-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,.25), transparent 50%);
    pointer-events: none;
}
.promo-strip h3 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.promo-strip p { margin: .25rem 0 0; opacity: .9; font-size: .92rem; }
.promo-strip .btn { background: #fff; color: var(--brand-color); border: 0; font-weight: 800; }
.promo-strip .btn:hover { background: #FAF3FC; color: var(--brand-dark); }

/* ============ Flash Deal Countdown (visual only) ============ */
.flash-bar {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE4D6 100%);
    border: 1px solid #FFD4B3;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}
.flash-bar h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #c2410c;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.flash-bar h2 i { animation: flash-pulse 1.2s ease-in-out infinite; }
@keyframes flash-pulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.15); }
}
.flash-bar .countdown { display: flex; align-items: center; gap: .35rem; font-weight: 700; }
.flash-bar .countdown .seg {
    background: #1A1A2E;
    color: #fff;
    min-width: 38px;
    padding: .4rem .25rem;
    border-radius: 6px;
    text-align: center;
    font-size: .95rem;
    font-variant-numeric: tabular-nums;
}
.flash-bar .countdown .sep { color: #1A1A2E; font-weight: 800; }
@media (max-width:575px) {
    .flash-bar h2 { font-size: 1rem; }
    .flash-bar .countdown .seg { min-width: 32px; padding: .3rem .25rem; font-size: .85rem; }
}

/* ============ Footer Polish ============ */
.site-footer {
    background: #15152A !important;
    color: #C5C5DA;
    font-size: .88rem;
}
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer h5 { color: #fff; font-size: 1.05rem; }
.site-footer h6 { color: #fff; font-size: .95rem; }
.site-footer a { color: #C5C5DA; transition: color .2s; }
.site-footer a:hover { color: var(--brand-200) !important; }
.site-footer .text-white-50 { color: #9F9FB8 !important; }

/* ============ Empty States ============ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state .empty-icon {
    width: 96px; height: 96px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    font-size: 2.5rem;
}

/* ============ Toast Refinement ============ */
.toast-success-cart {
    background: #fff;
    border: 1px solid #d1fae5;
    border-inline-start: 4px solid #10b981;
    border-radius: 12px;
    padding: .85rem 1rem;
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    max-width: 320px;
    margin-bottom: .5rem;
    font-weight: 600;
}

/* ============ Product Page Title Refinement ============ */
.product-title-large {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    letter-spacing: -.015em;
}
@media (min-width: 768px) { .product-title-large { font-size: 1.85rem; } }

/* ============ Form Controls — brand-tinted focus ============ */
.form-control:focus, .form-select:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 .2rem rgba(170,60,190,.12);
}

/* ============ Container max-widths for wide screens ============ */
@media (min-width: 1400px) {
    .container { max-width: 1280px; }
}

/* ============================================================
   📱 PHASE 2 — Mobile UX hardening (header / footer / MBN / forms)
   ============================================================ */

/* Header search input doesn't overflow on small viewports */
@media (max-width: 575.98px) {
    .main-header .container { padding-inline: 12px; }
    .main-header .search-autocomplete-wrap .form-control { font-size: 0.92rem; }
    .main-header .search-autocomplete-wrap .btn { padding-inline: 14px; }
    .navbar-brand img { max-height: 34px; }
}

/* Top bar hidden on small screens (already d-none d-md-block) — ensure no leftover space */
.top-bar { line-height: 1.4; }

/* Offcanvas mobile menu — full readable width on phones */
@media (max-width: 575.98px) {
    .offcanvas.offcanvas-start { max-width: 86vw; }
}

/* Product card — never let image overflow the rounded card on small screens */
.product-img-wrap img,
.category-img-wrap img,
.review-img-wrap img { max-width: 100%; max-height: 100%; }

/* Prevent breadcrumbs from forcing horizontal scroll */
.breadcrumb { flex-wrap: wrap; row-gap: .25rem; }

/* Checkout form spacing on mobile */
@media (max-width: 767.98px) {
    .checkout-container { padding: 1rem !important; border-radius: 14px !important; }
    .checkout-container .form-floating > label { font-size: .85rem; }
    .checkout-container h3 { font-size: 1.1rem !important; }
    .summary-box { padding: 1rem !important; border-radius: 14px !important; position: static !important; }
    .summary-box .fs-2 { font-size: 1.35rem !important; }
    .payment-method-card { padding: 1rem !important; }
    .payment-method-card .payment-icon { width: 44px !important; height: 44px !important; }
    .payment-method-card .pm-radio { transform: scale(1.2) !important; }
}

/* Cart page — qty control + remove button comfortable touch targets */
@media (max-width: 575.98px) {
    .cart-item .qty-control { max-width: 130px; }
    .cart-item .qty-control .btn { width: 30px !important; height: 30px !important; }
    .cart-item img { max-height: 96px; object-fit: cover; }
}

/* Product page — actions stacking + spacing for mobile */
@media (max-width: 575.98px) {
    .product-title-large { font-size: 1.2rem !important; }
    .price-section { padding: 1rem !important; }
    .price-section .fs-1 { font-size: 1.55rem !important; }
    .purchase-section .btn { font-size: .95rem !important; }
    .trust-info-box { padding: 1rem !important; }
    .trust-info-box .row .col-6 { font-size: .82rem; }
}

/* Footer mobile spacing — avoid overlap with mobile-bottom-nav (handled by body padding) */
@media (max-width: 767.98px) {
    .site-footer { margin-bottom: 0; padding-bottom: 1.25rem; font-size: .82rem; }
    .site-footer h2, .site-footer h3, .site-footer h5, .site-footer h6 { font-size: 1rem; }
    .site-footer .col-md-4, .site-footer .col-md-3, .site-footer .col-md-2 { text-align: start; }
}

/* Mobile Bottom Nav — extra safety against horizontal overflow + iOS safe area */
.mobile-bottom-nav { overflow: hidden; box-sizing: border-box; }
.mobile-bottom-nav .mbn-item { min-width: 0; }
.mobile-bottom-nav .mbn-item span {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Hero slider — fixed height on phones to prevent over-tall banners */
@media (max-width: 575.98px) {
    .hero-slider .carousel-item img { height: 220px; }
    .hero-slider .banner-overlay { padding: 1rem 1.25rem; }
    .hero-slider .banner-title { font-size: 1.1rem !important; }
    .hero-slider .banner-subtitle { font-size: .8rem !important; }
    .hero-slider .banner-btn { padding: .55rem 1.1rem !important; font-size: .85rem !important; }
}

/* Buttons — comfortable touch targets on mobile (44px+) */
@media (max-width: 767.98px) {
    .btn, .form-control, .form-select { min-height: 42px; }
    .btn-sm { min-height: 36px; }
    .btn.rounded-circle { min-height: 0; }
}

/* Tables responsive on mobile */
@media (max-width: 575.98px) {
    .table-responsive table { font-size: .82rem; }
    .table-responsive th, .table-responsive td { padding: .4rem .35rem; }
}

/* Toast positioning — don't collide with WA float / MBN on mobile */
@media (max-width: 767.98px) {
    #toastContainer { top: 70px !important; }
}

/* Prevent any element from causing horizontal scroll (defensive — without breaking Bootstrap gutters) */
@media (max-width: 575.98px) {
    .container { max-width: 100%; padding-inline: 12px; }
}

/* ── Wishlist button on product cards ──────────────────── */
.product-card { position: relative; }
.product-wl-btn {
    position: absolute; top: 8px; inset-inline-start: 8px; z-index: 5;
    width: 34px; height: 34px; border-radius: 50%;
    border: none; background: rgba(255,255,255,.9);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; color: #aaa; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.12); transition: color .2s, background .2s;
}
.product-wl-btn:hover, .product-wl-btn.active { color: #e74c3c; background: #fff; }
