@font-face {
    font-family: "Cairo";
    src: url("../../fonts/Cairo-VariableFont_slnt\,wght.ttf") format("truetype");
    font-weight: 100 700;
    font-style: normal;
}

/* ==========================================================
   MUZN - general style
   Palette: #EBEBEB  #010103  #6968FC  #3E3E3E
   ========================================================== */
:root {
    --c-white: #FFFFFF;
    --c-black: #08090D;
    --c-light: #F7F7F7;
    --c-dark: #0A0B10;
    --c-primary: #6968FC;
    --c-gray: #3E3E3E;

    --bg: var(--c-light);
    --surface: var(--c-light);
    --text: var(--c-dark);
    --muted: var(--c-gray);
    --primary: var(--c-primary);
    --on-primary: #ffffff;
    --border: color-mix(in srgb, var(--c-gray) 12%, transparent);
    --shadow: 0 6px 24px rgba(1, 1, 3, .08);
    --radius: 14px;
    --container: 1200px;
}

[data-theme="dark"] {
    --bg: var(--c-dark);
    --surface: var(--c-dark);
    --text: var(--c-light);
    --muted: color-mix(in srgb, var(--c-light) 65%, var(--c-gray));
    --border: color-mix(in srgb, var(--c-light) 8%, transparent);
    --shadow: 0 6px 24px rgba(0, 0, 0, .5);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Cairo', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background .25s, color .25s;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3 {
    line-height: 1.25;
    margin: 0 0 .5em;
}

.container {
    width: min(100% - 32px, var(--container));
    margin-inline: auto;
}

/* icons */
.icon {
    width: 20px;
    height: 20px;
}

.icon.sm {
    width: 14px;
    height: 14px;
}

[data-theme="dark"] .only-dark {
    display: inline-flex;
}

[data-theme="dark"] .only-light {
    display: none;
}

[data-theme="light"] .only-light {
    display: inline-flex;
}

[data-theme="light"] .only-dark {
    display: none;
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: .2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-outline {
    border-color: var(--border);
    background: transparent;
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

/* header */
.site-header {
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}


.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 68px;
}

.brand img {
    height: 42px;
    width: auto;
}

.brand-text {
    color: var(--primary);
    font-size: 22px;
    letter-spacing: 1px;
}

.nav-auth {
    display: none;
}

.main-nav {
    display: flex;
    gap: 28px;
    margin-inline: auto;
}

.main-nav a {
    position: relative;
    padding: 6px 0;
    font-weight: 500;
}

.main-nav a.active {
    color: var(--primary);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    inset-inline: 50%;
    bottom: 0;
    width: 12px;
    height: 3px;
    border-radius: 3px;
    background: var(--primary);
    transform: translateX(50%);
}

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

.actions {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: .2s;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.icon-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.icon-btn .dot {
    position: absolute;
    top: 0px;
    inset-inline-start: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    background: #e11;
    border-radius: 99px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #FFFFFF;
}

.icon-btn .badge {
    position: absolute;
    top: -5px;
    inset-inline-start: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary);
    color: #fff;
    border-radius: 99px;
    font-size: 10px;
    display: grid;
    place-items: center;
}

.icon-btn span {
    display: inline-flex;
}

.user-chip {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.user-chip img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
}

.user-chip .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: start;
}

.user-chip b {
    font-size: 13px;
    font-weight: 500;
}

.user-chip small {
    font-size: 10px;
    color: var(--muted);
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

/* category bar */
.cat-bar {
    border-top: 1px solid var(--border);
}

.cat-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 50px;
}

.cat-nav>li {
    position: relative;
}

.cat-nav>li.push {
    margin-inline-start: auto;
}

.cat-nav>li>a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    font-size: 15px;
}

.cat-nav>li:hover>a {
    color: var(--primary);
}

.cat-nav .sub {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    min-width: 160px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: .2s;
}

.cat-nav li:hover>.sub {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.sub a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
}

.sub a:hover {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}

/* sections / cards */
.section {
    padding: 48px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-head h2 {
    font-size: 26px;
    margin: 0;
}

.section-head a {
    color: var(--primary);
    font-weight: 500;
}

.page-title {
    padding: 40px 0 8px;
}

.page-title h1 {
    font-size: 32px;
    margin: 0;
}

.page-title p {
    color: var(--muted);
    margin: 6px 0 0;
}

.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: .25s;
}

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

.product .thumb {
    height: 170px;
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 64px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.product .thumb img {
    height: 128px;
    object-fit: cover;
}

.product .info {
    padding: 16px;
}

/* name: max 1 line */
.product h3 {
    font-size: 16px;
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* description: max 3 lines */
.product .desc {
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
    margin: 0 0 10px;
    min-height: 5.4em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product .rate {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.product .rate .star {
    color: #FFB400;
}

.product .price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
}

.product .price strong {
    font-size: 20px;
    color: var(--primary);
}

.product .price strong small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.product .old {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 13px;
}

.product .disc {
    color: #22C55E;
    font-size: 13px;
    font-weight: 600;
}

/* forms */
.form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
}

.field textarea {
    resize: vertical;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.chips a {
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.chips a.on,
.chips a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* footer */
.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 22px 0;
    color: var(--muted);
    font-size: 14px;
}

.foot nav {
    display: flex;
    gap: 18px;
}

.foot a:hover {
    color: var(--primary);
}

/* responsive */
@media (max-width: 960px) {
    .menu-toggle {
        display: block;
    }

    .main-nav,
    .user-chip .meta,
    .actions .guest-btn {
        display: none;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 0;
    }

    .main-nav.open {
        display: flex;
        order: 5;
        width: 100%;
        flex-direction: column;
        gap: 4px;
        padding-bottom: 12px;
    }

    .main-nav.open a::after {
        display: none;
    }

    /* sign in / sign up live inside the opened mobile menu */
    .main-nav.open .nav-auth {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .main-nav.open .nav-auth .btn {
        justify-content: center;
        text-align: center;
        padding: 10px 12px;
    }

    .cat-bar {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .cat-nav>li.push {
        margin-inline-start: 0;
    }

    .cat-nav>li>a {
        white-space: nowrap;
    }
}

/* header: guest buttons + user dropdown */
.btn-sm {
    padding: 6px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    min-width: 180px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: .2s;
    z-index: 60;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}

@media (max-width: 480px) {
    .actions .btn-sm {
        padding: 5px 10px;
        font-size: 13px;
    }
}


/* ---- Password field with show/hide eye (pw_input()) ---- */
.pw {
    position: relative;
    direction: ltr;
}

.field .pw input {
    padding-right: 48px;
}

.pw-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 6px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s;
}

.pw-toggle:hover,
.pw-toggle:focus-visible {
    color: var(--text);
}

.pw-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 8px;
}

.pw-toggle svg {
    width: 20px;
    height: 20px;
}

.pw-toggle .pw-eye-off,
.pw.is-visible .pw-toggle .pw-eye {
    display: none;
}

.pw.is-visible .pw-toggle .pw-eye-off {
    display: block;
}

/* ---- 6-box password / code input (wallet password, top-up code) ---- */
.otp-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.otp {
    --otp-size: clamp(38px, 12vw, 56px);
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 2vw, 10px);
    width: 100%;
    margin: 0 auto;
}

/* every box is a perfect square; the selector beats ".field input" (width:100%) */
.field .otp > input.otp-box:not([type="checkbox"]):not([type="radio"]) {
    flex: 0 0 var(--otp-size);
    box-sizing: border-box;
    width: var(--otp-size);
    height: var(--otp-size);
    min-width: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
}


/* Shared MUZN footer */
.site-footer {
    margin-top: 56px;
    padding: 48px 0 20px;
    background: #000000;
    color: var(--text);
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 42px;
    padding-bottom: 42px;
}

.footer-logo {
    display: inline-flex;
    margin-bottom: 12px;
}

.footer-logo img {
    width: 76px;
    height: auto;
    object-fit: contain;
}

.footer-brand p,
.footer-column p {
    color: color-mix(in srgb, var(--c-light) 65%, var(--c-gray));
    font-size: 14px;
    line-height: 1.9;
    margin: 0;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.footer-column h3 {
    font-size: 17px;
    margin: 0 0 8px;
    color: #F7F7F7;
}

.footer-column>a {
    color: color-mix(in srgb, var(--c-light) 65%, var(--c-gray));
    font-size: 14px;
    transition: color .2s;
}

.footer-column>a:hover,
.footer-legal a:hover {
    color: var(--primary);
}

.footer-contact p,
.footer-contact>a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-symbol {
    color: var(--primary);
    display: inline-flex;
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 1px;
}

.footer-symbol svg {
    width: 100%;
    height: 100%;
}

.footer-socials a svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    border-top: 1px solid color-mix(in srgb, var(--c-light) 8%, transparent);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-socials {
    display: flex;
    gap: 10px;
    direction: ltr;
}

.footer-socials a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--c-light) 8%, transparent);
    background: #000000;
    color: #F7F7F7;
    font-weight: 700;
}

.footer-socials a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: color-mix(in srgb, var(--c-light) 65%, var(--c-gray));
    font-size: 13px;
}

.footer-legal a {
    color: inherit;
}

.legal-page {
    width: min(100% - 32px, 900px);
    margin: 48px auto 64px;
    min-height: 42vh;
}

.legal-page h1 {
    color: var(--primary);
    font-size: clamp(26px, 4vw, 36px);
    margin-bottom: 8px;
}

.legal-page .legal-updated {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 14px;
}

.legal-page h2 {
    font-size: 19px;
    margin: 25px 0 8px;
}

.legal-page p,
.legal-page li {
    color: var(--muted);
    line-height: 1.95;
}

.legal-page ul {
    list-style: disc;
    padding-inline-start: 24px;
}

@media (max-width: 850px) {
    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 24px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding-top: 32px;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 26px 16px;
    }

    .footer-brand,
    .footer-contact {
        grid-column: 1 / -1;
    }

    .footer-legal {
        line-height: 1.9;
    }
}
/* Gateway OTP countdown */
.gw-timer { margin: 6px 0 12px; font-size: .92rem; color: var(--muted, #666); }
.gw-timer b { font-variant-numeric: tabular-nums; color: inherit; }
.gw-timer.is-expired { color: #c0392b; font-weight: 600; }
[data-gw-resend][disabled], [data-gw-confirm][disabled] { opacity: .55; cursor: not-allowed; }

/* phone with a fixed +218 prefix (shared) */
.phone-group { display: flex; align-items: stretch; }
.phone-prefix { display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px 0 0 12px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--muted); font-weight: 600; white-space: nowrap; }
.field .phone-group input:not([type="checkbox"]):not([type="radio"]) { flex: 1; min-width: 0; border-radius: 0 12px 12px 0; border-inline-start: 0; }

/* "يمكن تقسيطه" tag: top corner of the store product card (admin buttons use the opposite corner) */
.product { position: relative; }

.product .pc-installment {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 2;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
