/*
 * MZ Online Store - storefront theme layer (home page redesign, flash sale, product cards).
 * Loaded after the Ogani style.css in layout/web.blade.php. Plain CSS, no build step:
 * bump the ?v= in the layout after editing so browsers pick up the change.
 * Everything is prefixed `mz-` so it never collides with the template or Tailwind.
 */

:root {
    --mz-primary: #6029c4;
    --mz-primary-700: #4a1f9a;
    --mz-primary-900: #2a0f5e;
    --mz-primary-50: #f4effd;
    --mz-primary-100: #e7dcfa;
    --mz-ink: #17151c;
    --mz-text: #3b3a40;
    --mz-muted: #625f69;
    --mz-line: #ebe7f2;
    --mz-bg: #f7f5fb;
    --mz-deal: #dc2626;
    --mz-deal-700: #b91c1c;
    --mz-deal-50: #fef2f2;
    --mz-amber: #fbbf24;
    --mz-orange-700: #c2410c;
    --mz-green: #15803d;
    --mz-wa: #25d366;
    --mz-wa-dark: #075e54;
    --mz-radius: 16px;
    --mz-shadow: 0 1px 2px rgba(23, 21, 28, .05), 0 6px 18px rgba(23, 21, 28, .06);
    --mz-shadow-lg: 0 16px 36px rgba(42, 15, 94, .16);
    --mz-font-display: 'Rubik', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Generic building blocks ---------- */

.mz-section { padding: 44px 0; }
.mz-section--tint { background: var(--mz-bg); }
.mz-section--tight { padding-top: 20px; }

.mz-sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.mz-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--mz-primary); margin-bottom: 6px; }
.mz-h2 { font-family: var(--mz-font-display); font-size: 28px; font-weight: 800; color: var(--mz-ink); margin: 0; letter-spacing: -.01em; line-height: 1.15; }
.mz-sec-sub { font-size: 15px; line-height: 1.5; color: var(--mz-muted); margin: 6px 0 0; }
.mz-link-all { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: 15px; color: var(--mz-primary); white-space: nowrap; }
.mz-link-all:hover { color: var(--mz-primary-700); text-decoration: none; }
.mz-link-all i { transition: transform .2s; }
.mz-link-all:hover i { transform: translateX(3px); }

.mz-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 2px solid transparent; font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .1s; }
.mz-btn:hover { text-decoration: none; }
.mz-btn:active { transform: scale(.98); }
.mz-btn:focus-visible, .mz-tab:focus-visible, .mz-card a:focus-visible, .mz-brand:focus-visible, .mz-cat:focus-visible, .mz-rail__btn:focus-visible { outline: 3px solid var(--mz-amber); outline-offset: 2px; }
.mz-btn--primary { background: var(--mz-primary); color: #fff; }
.mz-btn--primary:hover { background: var(--mz-primary-700); color: #fff; }
.mz-btn--soft { background: var(--mz-primary-50); color: var(--mz-primary-700); }
.mz-btn--soft:hover { background: var(--mz-primary); color: #fff; }
.mz-btn--deal { background: var(--mz-deal); color: #fff; }
.mz-btn--deal:hover { background: var(--mz-deal-700); color: #fff; }
.mz-btn--white { background: #fff; color: var(--mz-primary-900); }
.mz-btn--white:hover { background: var(--mz-primary-50); color: var(--mz-primary-900); }
.mz-btn--wa { background: var(--mz-wa); color: #053b34; }
.mz-btn--wa:hover { background: #1ebe5a; color: #053b34; }
.mz-btn--block { display: flex; width: 100%; }
.mz-btn--lg { min-height: 50px; padding: 12px 26px; font-size: 16px; }

/* ---------- Trust strip ---------- */

.mz-trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mz-trust__item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--mz-line); border-radius: 14px; padding: 14px 16px; }
.mz-trust__item .mz-trust__icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--mz-primary-50); color: var(--mz-primary); font-size: 20px; }
.mz-trust__item strong { display: block; font-size: 14px; line-height: 1.25; color: var(--mz-ink); }
.mz-trust__item div span { display: block; font-size: 12px; line-height: 1.35; color: var(--mz-muted); }

/* ---------- Product card ---------- */

.mz-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

.mz-card { position: relative; display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--mz-line); border-radius: var(--mz-radius); overflow: hidden; transition: box-shadow .25s, transform .25s, border-color .25s; }
.mz-card:hover { box-shadow: var(--mz-shadow-lg); transform: translateY(-3px); border-color: var(--mz-primary-100); }
.mz-card__media { position: relative; display: block; aspect-ratio: 1 / 1; padding: 16px; background: radial-gradient(circle at 50% 38%, #fff 0%, #f3f0f9 100%); }
.mz-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .35s; }
.mz-card:hover .mz-card__media img { transform: scale(1.04); }
.mz-card__badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.mz-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.2; letter-spacing: .01em; }
.mz-badge--deal { background: var(--mz-deal); color: #fff; }
.mz-badge--flash { background: var(--mz-amber); color: #3b1d00; }
.mz-badge--soldout { background: var(--mz-ink); color: #fff; }
.mz-badge--free { background: #dcfce7; color: #14532d; }

.mz-card__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.mz-card__brand { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mz-primary); }
.mz-card__title { margin: 0; font-family: var(--mz-font-display); font-size: 15px; font-weight: 500; line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mz-card__title a { color: var(--mz-ink); font-weight: 500; }
.mz-card__title a:hover { color: var(--mz-primary); text-decoration: none; }
.mz-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is clickable */
.mz-card__cta { position: relative; z-index: 2; margin-top: auto; padding-top: 6px; }
.mz-card__cta form { margin: 0; }

.mz-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.mz-price__now { font-family: var(--mz-font-display); font-size: 19px; font-weight: 700; color: var(--mz-ink); font-variant-numeric: tabular-nums; }
.mz-card--deal .mz-price__now { color: var(--mz-deal); }
.mz-price__was { font-size: 13px; color: var(--mz-muted); }
.mz-save { margin: 0; font-size: 12px; font-weight: 700; color: var(--mz-green); }

.mz-stock { font-size: 12px; font-weight: 700; color: var(--mz-text); }
.mz-stock--low { color: var(--mz-deal); }
.mz-stock__bar { height: 8px; margin-top: 4px; border-radius: 999px; background: #fde4e4; overflow: hidden; }
.mz-stock__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f97316, var(--mz-deal)); }

.mz-card--soldout .mz-card__media img { opacity: .55; filter: grayscale(.4); }

/* ---------- Flash sale ---------- */

.mz-flash { padding: 36px 0 12px; }
.mz-flash__box { position: relative; overflow: hidden; border-radius: 24px; padding: 26px; color: #fff;
    background:
        radial-gradient(circle at 88% -10%, rgba(249, 115, 22, .55), transparent 42%),
        radial-gradient(circle at -5% 110%, rgba(220, 38, 38, .5), transparent 40%),
        linear-gradient(135deg, var(--mz-primary-900) 0%, var(--mz-primary) 62%, #7b2bd1 100%);
    box-shadow: 0 22px 44px rgba(42, 15, 94, .28); }
.mz-flash__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.mz-flash__title { display: flex; align-items: center; gap: 14px; }
.mz-flash__bolt { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--mz-amber); color: var(--mz-primary-900); font-size: 28px; box-shadow: 0 0 0 6px rgba(251, 191, 36, .22); animation: mz-pulse 1.8s ease-in-out infinite; }
.mz-flash__title h2 { margin: 0; font-family: var(--mz-font-display); font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; color: #fff; }
.mz-flash__title p { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: #ece4fb; }

.mz-countdown { display: flex; align-items: center; gap: 6px; }
.mz-countdown__label { margin-right: 6px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #fde68a; }
.mz-countdown__unit { min-width: 58px; padding: 6px 6px 5px; border-radius: 12px; background: #fff; color: var(--mz-ink); text-align: center; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.mz-countdown__unit b { display: block; font-family: var(--mz-font-display); font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mz-countdown__unit small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mz-muted); }
.mz-countdown__sep { font-size: 22px; font-weight: 800; color: rgba(255, 255, 255, .75); }

.mz-rail-wrap { position: relative; }
.mz-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .45) transparent; -webkit-overflow-scrolling: touch; }
.mz-rail > * { scroll-snap-align: start; }
.mz-rail .mz-card:hover { transform: none; }
.mz-rail__btn { position: absolute; top: 38%; z-index: 3; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--mz-primary); font-size: 22px; cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.mz-rail__btn--prev { left: -14px; }
.mz-rail__btn--next { right: -14px; }

@keyframes mz-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(251, 191, 36, .22); }
    50% { box-shadow: 0 0 0 12px rgba(251, 191, 36, .08); }
}

/* Flash sale announcement bar (every page while a sale is live) */
.mz-topbar { background: linear-gradient(90deg, var(--mz-deal-700), var(--mz-orange-700)); }
.mz-topbar a { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; min-height: 40px; padding: 7px 16px; color: #fff; font-size: 14px; font-weight: 700; text-align: center; }
.mz-topbar a:hover { color: #fff; text-decoration: none; }
.mz-topbar i.fa-bolt { color: #fde68a; }
.mz-topbar__timer { padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .22); font-family: var(--mz-font-display); font-variant-numeric: tabular-nums; }
.mz-topbar__cta { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Phone tabs ---------- */

.mz-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: var(--mz-primary-50); }
.mz-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--mz-primary-700); font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .2s, color .2s; }
.mz-tab i { font-size: 17px; }
.mz-tab:hover { background: var(--mz-primary-100); }
.mz-tab.is-active { background: var(--mz-primary); color: #fff; box-shadow: 0 6px 14px rgba(96, 41, 196, .3); }
.mz-tab-panel[hidden] { display: none; }
.mz-empty { padding: 36px 16px; text-align: center; color: var(--mz-muted); }

/* ---------- Brands & categories ---------- */

.mz-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.mz-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; padding: 16px 10px; border: 1px solid var(--mz-line); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }
.mz-brand img { display: block; width: auto; max-width: 100%; height: 44px; object-fit: contain; }
.mz-brand span { font-size: 13px; font-weight: 700; color: var(--mz-ink); }
.mz-brand:hover { border-color: var(--mz-primary); box-shadow: var(--mz-shadow); transform: translateY(-2px); text-decoration: none; }

.mz-cats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.mz-cat { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px 16px; border: 1px solid var(--mz-line); border-radius: 18px; background: linear-gradient(180deg, #fff 0%, var(--mz-primary-50) 100%); text-align: center; transition: border-color .2s, box-shadow .2s, transform .2s; }
.mz-cat__img { display: grid; place-items: center; width: 100px; height: 100px; border-radius: 50%; background: #fff; box-shadow: 0 6px 16px rgba(42, 15, 94, .1); overflow: hidden; }
.mz-cat__img img { display: block; width: 74%; height: 74%; object-fit: contain; transition: transform .3s; }
.mz-cat span { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--mz-ink); }
.mz-cat:hover { border-color: var(--mz-primary); box-shadow: var(--mz-shadow); transform: translateY(-2px); text-decoration: none; }
.mz-cat:hover .mz-cat__img img { transform: scale(1.08); }

/* ---------- Promo cards (sell your phone / WhatsApp help) ---------- */

.mz-promos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mz-promos--single { grid-template-columns: 1fr; }
.mz-promo { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 190px; padding: 28px; border-radius: 22px; overflow: hidden; }
.mz-promo h3 { position: relative; margin: 0; font-family: var(--mz-font-display); font-size: 24px; font-weight: 800; line-height: 1.2; }
.mz-promo p { position: relative; margin: 0 0 6px; max-width: 440px; font-size: 15px; line-height: 1.5; }
.mz-promo .mz-btn { position: relative; }
.mz-promo__art { position: absolute; right: 18px; bottom: -28px; font-size: 170px; line-height: 1; opacity: .14; transform: rotate(-12deg); pointer-events: none; }
.mz-promo--sell { background: linear-gradient(135deg, #fff7e6 0%, #ffe3b3 100%); color: #3b2300; }
.mz-promo--sell h3 { color: #3b2300; }
.mz-promo--sell p { color: #5c3b0a; }
.mz-promo--sell .mz-promo__art { color: #b45309; opacity: .2; }
.mz-promo--wa { background: linear-gradient(135deg, var(--mz-wa-dark) 0%, #0b7d6b 100%); color: #fff; }
.mz-promo--wa h3 { color: #fff; }
.mz-promo--wa p { color: #d7f5ec; }
.mz-promo .mz-eyebrow { position: relative; margin: 0; }
.mz-promo--sell .mz-eyebrow { color: #92400e; }
.mz-promo--wa .mz-eyebrow { color: #a7f3d0; }

/* ---------- Floating WhatsApp ---------- */

.mz-wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--mz-wa); color: #fff; font-size: 30px; box-shadow: 0 10px 24px rgba(37, 211, 102, .45); transition: transform .2s; }
.mz-wa-float:hover, .mz-wa-float:focus { color: #fff; transform: scale(1.07); text-decoration: none; }
.mz-wa-float:focus-visible { outline: 3px solid var(--mz-primary); outline-offset: 3px; }

/* ---------- Product page flash box ---------- */

.mz-pdp-flash { margin: 4px 0 14px; border: 1px solid #fecaca; border-radius: 14px; overflow: hidden; }
.mz-pdp-flash__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; background: linear-gradient(90deg, var(--mz-deal-700), var(--mz-orange-700)); color: #fff; font-weight: 700; }
.mz-pdp-flash__top i.fa-bolt { color: #fde68a; margin-right: 4px; }
.mz-pdp-flash__timer { font-family: var(--mz-font-display); font-variant-numeric: tabular-nums; }
.mz-pdp-flash__body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px; background: var(--mz-deal-50); color: var(--mz-deal-700); font-size: 14px; font-weight: 700; }
.mz-pdp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.mz-pdp-price__was { font-size: 18px; font-weight: 400; color: var(--mz-muted); }
.mz-pdp-price--deal #price_now { color: var(--mz-deal); }

/* ---------- Home hero (banner slider from Admin -> Banners) ---------- */

.mz-hero-fallback { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 300px; padding: 36px; border-radius: 18px; color: #fff;
    background: radial-gradient(circle at 85% 20%, rgba(249, 115, 22, .45), transparent 45%), linear-gradient(135deg, var(--mz-primary-900), var(--mz-primary)); }
.mz-hero-fallback h2 { margin: 0; font-family: var(--mz-font-display); font-size: 36px; font-weight: 800; line-height: 1.1; color: #fff; }
.mz-hero-fallback p { margin: 0; max-width: 460px; font-size: 16px; color: #ece4fb; }
.banner__slider.mz-hero-slider { border-radius: 18px; overflow: hidden; box-shadow: var(--mz-shadow); }
.banner__slider.mz-hero-slider .item img { display: block; width: 100%; height: auto; }
.banner__slider.mz-hero-slider .owl-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 4px; }
.banner__slider.mz-hero-slider .owl-dots button.owl-dot { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.banner__slider.mz-hero-slider .owl-dots button.owl-dot span { display: block; width: 9px; height: 9px; border-radius: 999px; background: rgba(23, 21, 28, .3); transition: width .2s, background-color .2s; }
.banner__slider.mz-hero-slider .owl-dots button.owl-dot.active span { width: 24px; background: var(--mz-primary); }

/* On phones keep the category list folded on the home page so banners and deals show first
   (tap "All Categories" to open it; main.js toggles it). */
@media (max-width: 991px) {
    .hero:not(.hero-normal) .hero__categories ul { display: none; }
    /* The template anchors the mobile menu button to `.header .container`, but this header uses
       .container-fluid, so the button was positioned against the page and covered the flash-sale bar. */
    .header .container-fluid { position: relative; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
    .mz-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    .mz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mz-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mz-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mz-promos { grid-template-columns: 1fr; }
    .mz-rail__btn { display: none; }
}

@media (max-width: 767px) {
    .mz-section { padding: 30px 0; }
    .mz-h2 { font-size: 23px; }
    .mz-flash { padding-top: 22px; }
    .mz-flash__box { padding: 20px 16px; border-radius: 20px; }
    .mz-flash__title h2 { font-size: 24px; }
    .mz-flash__bolt { width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
    .mz-countdown__unit { min-width: 50px; }
    .mz-countdown__unit b { font-size: 20px; }
    .mz-flash .mz-rail { grid-auto-columns: 46%; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; }
    .mz-promo { padding: 22px; min-height: 0; }
    .mz-promo h3 { font-size: 21px; }
    .mz-hero-fallback { min-height: 220px; padding: 24px; }
    .mz-hero-fallback h2 { font-size: 28px; }
}

@media (max-width: 575px) {
    .mz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mz-card__media { padding: 10px; }
    .mz-card__body { padding: 10px 10px 12px; gap: 5px; }
    .mz-card__title { font-size: 14px; }
    .mz-price__now { font-size: 16px; }
    .mz-price__was { font-size: 12px; }
    .mz-card .mz-btn { min-height: 40px; padding: 8px 10px; font-size: 13px; }
    .mz-trust { gap: 8px; }
    .mz-trust__item { padding: 10px; gap: 10px; }
    .mz-trust__item .mz-trust__icon { width: 38px; height: 38px; font-size: 17px; }
    .mz-trust__item strong { font-size: 13px; }
    .mz-cats { gap: 8px; }
    .mz-cat { padding: 12px 6px; border-radius: 14px; }
    .mz-cat__img { width: 72px; height: 72px; }
    .mz-cat span { font-size: 12px; }
    .mz-brands { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .mz-brand { min-height: 88px; padding: 12px 6px; }
    .mz-brand img { height: 34px; }
    .mz-tabs { display: flex; width: 100%; }
    .mz-tab { flex: 1; justify-content: center; padding: 8px 10px; }
    .mz-wa-float { width: 52px; height: 52px; font-size: 27px; right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .mz-flash__bolt { animation: none; }
    .mz-card, .mz-card__media img, .mz-brand, .mz-cat, .mz-cat__img img, .mz-wa-float, .mz-link-all i { transition: none; }
    .mz-card:hover, .mz-brand:hover, .mz-cat:hover { transform: none; }
    .mz-card:hover .mz-card__media img, .mz-cat:hover .mz-cat__img img { transform: none; }
}
