/**
 * Jarawan Mull — modern homepage layer (loads after homepage.css)
 * Clean e‑commerce look: strong typography, soft surfaces, confident CTAs
 * (Cairo is linked from index.php head.)
 */

:root {
    --jm-font: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    --jm-ink: #0f172a;
    --jm-ink-muted: #64748b;
    --jm-surface: #ffffff;
    --jm-surface-2: #f1f5f9;
    --jm-border: rgba(15, 23, 42, 0.08);
    --jm-primary: #0d6efd;
    --jm-primary-dark: #084298;
    --jm-accent: #f97316;
    --jm-radius: 16px;
    --jm-radius-lg: 24px;
    --jm-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --jm-shadow-hover: 0 16px 40px rgba(15, 23, 42, 0.12);
    --jm-max: 1280px;
}

/* React replaces static markup */
body.react-homepage-active .static-content {
    display: none !important;
}

.homepage-app {
    font-family: var(--jm-font);
    color: var(--jm-ink);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 35%, #f8fafc 100%);
    overflow-x: hidden;
}

@keyframes jm-fade-up {
    from {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.homepage-app .jm-animate-in {
    animation: jm-fade-up 0.55s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .homepage-app .jm-animate-in {
        animation: none;
    }
}

/* ——— Hero ——— */
.hero-banner.hero-banner--modern {
    position: relative;
}

.homepage-app .hero-banner,
.static-content .hero-banner {
    position: relative;
    min-height: clamp(280px, 52vh, 560px);
    display: flex;
    align-items: center;
    padding: clamp(2rem, 5vw, 4rem) 1rem;
    border-radius: 0 0 var(--jm-radius-lg) var(--jm-radius-lg);
    overflow: hidden;
    background: linear-gradient(125deg, #0d6efd 0%, #2563eb 42%, #6366f1 78%, #f97316 120%) !important;
    color: #fff;
    box-shadow: var(--jm-shadow-hover);
}

.homepage-app .hero-banner::after,
.static-content .hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(249, 115, 22, 0.25), transparent 50%);
    pointer-events: none;
}

.homepage-app .hero-content,
.static-content .hero-content {
    position: relative;
    z-index: 2;
    max-width: var(--jm-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
}

@media (max-width: 900px) {
    .homepage-app .hero-content,
    .static-content .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .homepage-app .hero-buttons,
    .static-content .hero-buttons {
        justify-content: center;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}

.hero-title {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem !important;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem) !important;
    line-height: 1.65 !important;
    opacity: 0.94 !important;
    max-width: 36ch;
    margin-bottom: 1.5rem !important;
}

@media (max-width: 900px) {
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

.hero-buttons .btn,
.homepage-app .hero-buttons .btn {
    border-radius: 999px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.hero-buttons .btn-primary {
    background: #fff !important;
    color: var(--jm-primary-dark) !important;
}

.hero-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
}

.hero-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(280px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    font-size: clamp(4rem, 12vw, 6.5rem) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ——— Trust strip ——— */
.promo-bar {
    max-width: var(--jm-max);
    margin: -2rem auto 0;
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .promo-bar {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -1rem;
    }
}

.promo-bar .promo-item {
    background: var(--jm-surface);
    border-radius: var(--jm-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--jm-shadow);
    border: 1px solid var(--jm-border);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.promo-bar .promo-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--jm-shadow-hover);
}

.promo-bar .promo-item > i {
    font-size: 1.35rem;
    color: var(--jm-primary);
    margin-top: 0.15rem;
}

.promo-bar .promo-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--jm-ink);
}

.promo-bar .promo-item p {
    font-size: 0.78rem;
    margin: 0;
    color: var(--jm-ink-muted);
    line-height: 1.4;
}

/* ——— Homepage stats strip ——— */
.jm-stats-strip {
    max-width: var(--jm-max);
    margin: 0 auto;
    padding: 0.35rem 1rem 0.25rem;
}

.jm-stats-strip__inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.jm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 5.5rem;
    padding: 0.85rem 0.5rem;
    background: linear-gradient(165deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid var(--jm-border);
    border-radius: var(--jm-radius);
    box-shadow: var(--jm-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jm-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--jm-shadow-hover);
}

.jm-stat__value {
    font-size: clamp(1.2rem, 2.8vw, 1.65rem);
    font-weight: 800;
    color: var(--jm-primary-dark);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.jm-stat__suffix {
    font-size: 0.55em;
    font-weight: 700;
    opacity: 0.88;
}

.jm-stat__label {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--jm-ink-muted);
    line-height: 1.3;
}

.jm-stat__icon {
    margin-bottom: 0.4rem;
    font-size: 1.25rem;
    color: var(--jm-primary);
    opacity: 0.9;
}

@media (max-width: 640px) {
    .jm-stats-strip__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ——— Section header accent (shared) ——— */
.jm-section-head h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.35rem;
}

.jm-section-head h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--jm-primary), var(--jm-accent));
}

/* ——— How it works ——— */
.jm-how {
    background: var(--jm-surface);
    border-block: 1px solid var(--jm-border);
}

.jm-how__inner {
    max-width: var(--jm-max);
    margin: 0 auto;
}

.jm-how__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.jm-how-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.75rem;
    padding: 1.1rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 55%);
    border: 1px solid var(--jm-border);
    border-radius: var(--jm-radius);
    box-shadow: var(--jm-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jm-how-card:hover {
    border-color: rgba(13, 110, 253, 0.22);
    box-shadow: var(--jm-shadow-hover);
}

.jm-how-card__step {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--jm-primary), #6366f1);
    flex-shrink: 0;
}

.jm-how-card__body h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--jm-ink);
}

.jm-how-card__body p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--jm-ink-muted);
}

.jm-how-card__ico {
    font-size: 1.15rem;
    color: var(--jm-primary);
    opacity: 0.55;
    align-self: center;
}

@media (max-width: 900px) {
    .jm-how__grid {
        grid-template-columns: 1fr;
    }

    .jm-how-card {
        grid-template-columns: auto 1fr;
    }

    .jm-how-card__ico {
        display: none;
    }
}

/* ——— Testimonials ——— */
.jm-testimonials {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.jm-testimonials__inner {
    max-width: var(--jm-max);
    margin: 0 auto;
}

.jm-testimonials__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.jm-quote {
    margin: 0;
    padding: 1.15rem 1.1rem;
    background: var(--jm-surface);
    border-radius: var(--jm-radius);
    border: 1px solid var(--jm-border);
    box-shadow: var(--jm-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.jm-quote blockquote {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--jm-ink);
    font-weight: 600;
}

.jm-quote figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    font-size: 0.78rem;
    color: var(--jm-ink-muted);
}

.jm-quote__name {
    font-weight: 700;
    color: var(--jm-ink);
}

.jm-quote__stars {
    margin-inline-start: auto;
    color: #f59e0b;
    letter-spacing: 0.02em;
}

@media (max-width: 900px) {
    .jm-testimonials__grid {
        grid-template-columns: 1fr;
    }
}

/* ——— FAQ ——— */
.jm-faq__inner {
    max-width: 720px;
    margin: 0 auto;
}

.jm-faq__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.jm-faq-item {
    border: 1px solid var(--jm-border);
    border-radius: 12px;
    background: var(--jm-surface);
    overflow: hidden;
    box-shadow: var(--jm-shadow);
}

.jm-faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 0.9rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--jm-ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    user-select: none;
}

.jm-faq-item summary::-webkit-details-marker {
    display: none;
}

.jm-faq-item summary::after {
    content: '+';
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--jm-primary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.jm-faq-item[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

.jm-faq-item p {
    margin: 0;
    padding: 0 1rem 1rem;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--jm-ink-muted);
}

@media (prefers-reduced-motion: reduce) {
    .jm-faq-item summary::after {
        transition: none;
    }
}

/* ——— Sections ——— */
.homepage-app section,
.static-content .main-content section {
    padding: clamp(2rem, 4vw, 3.25rem) 1rem;
}

.section-header {
    max-width: var(--jm-max);
    margin: 0 auto 1.25rem;
    text-align: center;
}

.section-header h2 {
    font-size: clamp(1.35rem, 3vw, 1.85rem) !important;
    font-weight: 800 !important;
    color: var(--jm-ink);
    margin-bottom: 0.35rem !important;
}

.section-header p {
    font-size: 0.95rem;
    color: var(--jm-ink-muted);
    margin: 0;
}

.container {
    max-width: var(--jm-max) !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* ——— Category tiles ——— */
.categories-grid,
.homepage-app .categories-grid {
    max-width: var(--jm-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.category-item {
    background: var(--jm-surface);
    border-radius: var(--jm-radius);
    border: 1px solid var(--jm-border);
    box-shadow: var(--jm-shadow);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--jm-shadow-hover);
}

.category-item .category-image {
    aspect-ratio: 1;
    overflow: hidden;
}

.category-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.category-item:hover img {
    transform: scale(1.06);
}

.category-item h3 {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

/* ——— Product cards ——— */
.product-card,
.offer-card,
.trending-card {
    font-family: var(--jm-font);
    background: var(--jm-surface) !important;
    border-radius: var(--jm-radius) !important;
    border: 1px solid var(--jm-border) !important;
    box-shadow: var(--jm-shadow) !important;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

.product-card:hover,
.offer-card:hover,
.trending-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--jm-shadow-hover) !important;
}

.product-card .product-image-wrapper,
.product-card .product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--jm-surface-2);
}

.product-card img,
.offer-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details h3,
.product-info h4 {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    margin: 0.65rem 0 0.35rem;
    color: var(--jm-ink);
}

.price .current,
.sale-price {
    font-weight: 800;
    color: var(--jm-primary);
    font-size: 1.05rem;
}

.price .original,
.original-price {
    text-decoration: line-through;
    color: var(--jm-ink-muted);
    font-size: 0.85rem;
    margin-inline-end: 0.35rem;
}

.new-badge,
.discount-badge {
    font-weight: 800;
    border-radius: 8px;
    z-index: 2;
}

/* ——— Banner slider ——— */
.banner-slider-container {
    max-width: var(--jm-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.homepage-banner.swiper-container {
    border-radius: var(--jm-radius-lg);
    overflow: hidden;
    box-shadow: var(--jm-shadow-hover);
    border: 1px solid var(--jm-border);
}

.banner-content-overlay {
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.75) 0%, transparent 100%) !important;
}

/* ——— Flash / offers ——— */
.flash-sale-section {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fff 100%);
    border-block: 1px solid rgba(249, 115, 22, 0.15);
}

.offers-carousel {
    max-width: var(--jm-max);
    margin: 0 auto;
    padding: 0.5rem 1rem 1.5rem;
}

/* ——— Newsletter & CTA ——— */
.newsletter-section,
.cta-section {
    font-family: var(--jm-font);
    border-radius: var(--jm-radius-lg);
    max-width: var(--jm-max);
    margin: 0 auto 2rem;
    padding: clamp(2rem, 4vw, 3rem) 1.5rem !important;
    box-shadow: var(--jm-shadow);
}

.newsletter-form input {
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
}

.newsletter-form .btn,
.cta-section .btn {
    border-radius: 999px !important;
    font-weight: 700 !important;
}

/* ——— Reels / short videos (compact strip) ——— */
.homepage-videos.reels-section {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: clamp(0.55rem, 1.4vw, 0.85rem) max(0.65rem, var(--safe-left)) clamp(0.65rem, 1.6vw, 1rem) max(0.65rem, var(--safe-right));
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
    border-block: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.2);
}

/* Tighter than generic `.static-content .main-content section` padding */
.static-content .main-content .homepage-videos.reels-section,
.homepage-app .homepage-videos.reels-section {
    padding: clamp(0.55rem, 1.4vw, 0.85rem) max(0.65rem, var(--safe-left)) clamp(0.65rem, 1.6vw, 1rem) max(0.65rem, var(--safe-right)) !important;
}

.reels-section__head {
    max-width: var(--jm-max);
    margin: 0 auto 0.45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reels-section__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reels-section__logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f97316, #ec4899, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.reels-section__title {
    margin: 0;
    font-size: clamp(1rem, 2.6vw, 1.25rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.reels-section__sub {
    margin: 0.1rem 0 0;
    font-size: 0.72rem;
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.35;
}

.reels-section__pill {
    flex-shrink: 0;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f172a;
    background: linear-gradient(90deg, #fde68a, #fbbf24);
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.4);
}

.homepage-videos-scroll.reels-scroller {
    max-width: var(--jm-max);
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.45rem;
    padding: 0.15rem 0.15rem 0.35rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.homepage-videos-scroll.reels-scroller::-webkit-scrollbar {
    height: 6px;
}

.homepage-videos-scroll.reels-scroller::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.reels-card {
    flex: 0 0 auto;
    width: 88px;
    scroll-snap-align: start;
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    text-align: center;
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
    color: inherit;
}

@media (min-width: 769px) {
    .reels-card {
        width: 102px;
    }
}

.reels-card__ring {
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(145deg, #f97316, #ec4899, #6366f1, #22d3ee);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reels-card:hover .reels-card__ring,
.reels-card:focus-visible .reels-card__ring {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}

.reels-card:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 4px;
}

.reels-card__inner {
    border-radius: 12px;
    overflow: hidden;
    background: #020617;
}

.reels-card .video-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 177.78%;
    background: #000;
    overflow: hidden;
}

.reels-card .video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.reels-card .video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
    transition: background 0.2s;
    pointer-events: none;
}

.reels-card .video-play-overlay i {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 0.65rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.reels-card__title {
    margin: 0;
    padding: 0.28rem 0.3rem 0.32rem;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.35;
    color: #e2e8f0;
    min-height: 2.35em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

/* ——— Product grids ——— */
.products-grid,
.homepage-app .products-grid {
    max-width: var(--jm-max);
    margin-left: auto;
    margin-right: auto;
    gap: 1.1rem !important;
}

.products-grid > *,
.categories-grid > * {
    min-width: 0;
}

/* ——— Video modals ——— */
.homepage-video-modal {
    font-family: var(--jm-font);
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.homepage-video-modal.show {
    display: flex;
}

.homepage-video-modal .modal-inner {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.homepage-video-modal__title {
    margin: 0 0 0.75rem;
    padding: 0 2.75rem;
    color: #f8fafc;
    font-size: clamp(0.95rem, 2.8vw, 1.2rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    max-width: 36rem;
}

.homepage-video-modal__title:empty {
    display: none;
}

.homepage-video-modal video {
    max-width: 100%;
    max-height: min(78vh, 100dvh);
    width: 100%;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.homepage-video-modal .modal-close {
    position: absolute;
    top: -40px;
    inset-inline-start: 0;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.homepage-video-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ——— Footer ——— */
.footer {
    font-family: var(--jm-font);
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body {
    font-family: var(--jm-font) !important;
    font-size: 15px !important;
    line-height: 1.55 !important;
}

/* ========== Cross-device & phones (homepage + shared) ========== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.homepage-app img,
.static-content .main-content img,
.homepage-app video {
    max-width: 100%;
}

/* Full-bleed banner from homepage.css uses 100vw — causes horizontal scroll on mobile */
@media (max-width: 900px) {
    .banner-slider-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: max(0.75rem, var(--safe-left)) !important;
        padding-right: max(0.75rem, var(--safe-right)) !important;
    }
}

@media (max-width: 768px) {
    :root {
        --jm-radius: 14px;
        --jm-radius-lg: 20px;
    }

    .homepage-app .hero-banner,
    .static-content .hero-banner {
        min-height: min(72vh, 520px);
        padding: max(1.25rem, env(safe-area-inset-top, 0)) 1rem 2rem;
        border-radius: 0 0 var(--jm-radius-lg) var(--jm-radius-lg);
    }

    /* iOS: fixed hero backgrounds jank + crop; use scroll */
    .hero-banner[style*='background-image'],
    .hero-banner.hero-banner--modern[style*='background-image'] {
        background-attachment: scroll !important;
    }

    .homepage-app .hero-content,
    .static-content .hero-content {
        gap: 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 22rem;
        margin-left: auto;
        margin-right: auto;
        gap: 0.65rem !important;
    }

    .hero-buttons .btn,
    .homepage-app .hero-buttons .btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .hero-badge {
        font-size: 0.72rem;
        padding: 0.4rem 0.75rem;
    }

    .promo-bar {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0));
        gap: 0.6rem;
    }

    .homepage-app section,
    .static-content .main-content section {
        padding-left: max(1rem, env(safe-area-inset-left, 0));
        padding-right: max(1rem, env(safe-area-inset-right, 0));
    }

    .newsletter-form,
    .newsletter-section .newsletter-form {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }

    .newsletter-form .btn,
    .newsletter-form button {
        width: 100%;
        min-height: 48px;
    }

    .homepage-video-modal {
        padding: max(1rem, env(safe-area-inset-top, 0)) max(1rem, env(safe-area-inset-right, 0)) max(1rem, env(safe-area-inset-bottom, 0)) max(1rem, env(safe-area-inset-left, 0));
    }

    .homepage-video-modal .modal-close {
        top: max(-36px, env(safe-area-inset-top, 0));
        min-width: 44px;
        min-height: 44px;
    }

    .homepage-video-modal video {
        max-height: min(85vh, 100dvh);
    }
}

@media (max-width: 600px) {
    .promo-bar {
        grid-template-columns: 1fr 1fr;
    }

    .categories-grid,
    .homepage-app .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        gap: 0.65rem;
    }

    .products-grid,
    .homepage-app .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem !important;
    }

    .subcategories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .offers-carousel,
    .trending-carousel,
    .homepage-videos-scroll.reels-scroller,
    .jm-stats-strip {
        padding-left: max(0.5rem, env(safe-area-inset-left, 0));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0));
        scroll-padding-inline: 0.75rem;
    }

    .newsletter-section,
    .cta-section {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
        max-width: none;
        width: auto;
    }
}

@media (max-width: 400px) {
    .promo-bar {
        grid-template-columns: 1fr;
    }

    .promo-bar .promo-item {
        flex-direction: row;
        align-items: center;
    }

    .categories-grid,
    .homepage-app .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-header h2 {
        font-size: 1.2rem !important;
    }
}

/* Short landscape phones / small height */
@media (max-height: 520px) and (orientation: landscape) {
    .homepage-app .hero-banner,
    .static-content .hero-banner {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 1.25rem;
    }

    .hero-illustration {
        display: none;
    }

    .homepage-app .hero-content,
    .static-content .hero-content {
        grid-template-columns: 1fr;
    }
}

/* Coarse pointer: larger tap targets, lighter hover-only motion */
@media (hover: none) and (pointer: coarse) {
    .category-item:hover,
    .product-card:hover,
    .offer-card:hover,
    .trending-card:hover,
    .promo-bar .promo-item:hover,
    .jm-stat:hover,
    .reels-card:hover .reels-card__ring {
        transform: none;
    }

    .product-card .btn-icon,
    .product-card .btn-sm,
    .product-overlay .btn {
        min-width: 44px;
        min-height: 44px;
    }

    .auth-content .auth-submit-btn {
        min-height: 48px;
    }

    .auth-content .auth-link--btn {
        min-height: 44px;
        padding: 0.35rem 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-buttons .btn,
    .category-item,
    .product-card,
    .offer-card,
    .trending-card,
    .promo-bar .promo-item,
    .jm-stat,
    .reels-card__ring {
        transition-duration: 0.01ms !important;
    }

    .hero-buttons .btn:hover,
    .category-item:hover,
    .product-card:hover,
    .offer-card:hover,
    .trending-card:hover,
    .jm-stat:hover,
    .reels-card:hover .reels-card__ring {
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding-top: max(0.35rem, env(safe-area-inset-top, 0));
        padding-left: max(0.5rem, env(safe-area-inset-left, 0));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0));
    }
}
