/* ================================================================
   مسار | المتجر — Storefront styles (Massar identity)
   ================================================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-darker: #3730a3;
    --primary-light: #a5b4fc;
    --primary-lighter: #e0e7ff;
    --primary-bg: rgba(99, 102, 241, 0.06);
    --teal: #14b8a6;
    --amber: #f59e0b;
    --rose: #f43f5e;
    --green: #22c55e;
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-gold: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-soft: linear-gradient(165deg, #f8fafc, #eef2ff, #faf5ff);
    --bg-body: #f8fafc;
    --bg-white: #fff;
    --bg-soft: #f1f5f9;
    --bg-dark: #0f172a;
    --text-primary: #0f172a;
    --text-body: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(99, 102, 241, 0.1);
    --border-med: rgba(99, 102, 241, 0.18);
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.05);
    --shadow-md: 0 4px 20px rgba(99, 102, 241, 0.08);
    --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.12);
    --shadow-xl: 0 20px 60px rgba(99, 102, 241, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font: 'Changa', 'Cairo', sans-serif;
    --nav-h: 74px;
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-body);
    background: var(--bg-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
ul { list-style: none; }
::selection { background: var(--primary-lighter); color: var(--primary-darker); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.72rem 1.5rem; border-radius: var(--radius-md); font-weight: 600;
    font-size: 15px; border: 1px solid transparent; transition: var(--transition);
    cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-outline { background: #fff; border-color: var(--border-med); color: var(--primary-dark); }
.btn-outline:hover { background: var(--primary-bg); border-color: var(--primary); }
.btn-ghost { background: var(--bg-soft); color: var(--text-secondary); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-block { width: 100%; }
.btn-lg { padding: 0.9rem 2rem; font-size: 16px; }
.btn-sm { padding: 0.45rem 1rem; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ─── Navbar ─── */
.nav {
    position: sticky; top: 0; z-index: 1000; height: var(--nav-h);
    display: flex; align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-brand { display: flex; align-items: center; gap: 0.65rem; }
.nav-brand-icon {
    width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
    background: var(--gradient-primary); color: #fff; font-size: 18px;
    box-shadow: var(--shadow-md);
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-brand-title { font-weight: 800; font-size: 1.1rem; color: var(--text-primary); }
.nav-brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-links a {
    padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); font-weight: 600;
    color: var(--text-secondary); transition: var(--transition); font-size: 14.5px;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary-dark); background: var(--primary-bg); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.nav-icon-btn {
    position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid;
    place-items: center; background: var(--bg-soft); color: var(--text-secondary);
    border: 1px solid var(--border); transition: var(--transition); font-size: 16px;
}
.nav-icon-btn:hover { background: var(--primary-bg); color: var(--primary-dark); }
.cart-badge {
    position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px;
    padding: 0 5px; border-radius: var(--radius-full); background: var(--rose);
    color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.nav-search { position: relative; }
.nav-search input {
    width: 210px; padding: 0.6rem 2.4rem 0.6rem 1rem; border-radius: var(--radius-full);
    border: 1px solid var(--border-med); background: #fff; outline: none;
    transition: var(--transition); font-size: 14px;
}
.nav-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); width: 250px; }
.nav-search i { position: absolute; top: 50%; right: 1rem; transform: translateY(-50%); color: var(--text-muted); }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 13px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-secondary); font-size: 17px; }

/* ─── Flash alerts ─── */
.flash {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md); margin: 1rem auto; font-weight: 600; font-size: 14.5px;
    border: 1px solid transparent;
}
.flash-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ─── Hero ─── */
.hero {
    background: var(--gradient-soft); border-bottom: 1px solid var(--border);
    padding: 3.5rem 0; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12), transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.1), transparent 45%);
    pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; position: relative; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem;
    border-radius: var(--radius-full); background: var(--primary-bg); color: var(--primary-dark);
    font-weight: 700; font-size: 13px; border: 1px solid var(--border-med); margin-bottom: 1.25rem;
}
.hero h1 { font-size: 2.6rem; line-height: 1.25; font-weight: 800; color: var(--text-primary); margin-bottom: 1rem; }
.hero h1 span { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.05rem; color: var(--text-secondary); max-width: 540px; margin-bottom: 1.75rem; }
.hero-cta { display: flex; gap: 0.85rem; flex-wrap: wrap; }
.hero-visual {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.hero-tile {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.25rem; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 0.6rem;
}
.hero-tile:nth-child(1) { transform: translateY(-10px); }
.hero-tile:nth-child(4) { transform: translateY(10px); }
.hero-tile i { font-size: 1.4rem; color: var(--primary); }
.hero-tile strong { font-size: 0.95rem; color: var(--text-primary); }
.hero-tile small { color: var(--text-muted); font-size: 12px; }

/* ─── Sections ─── */
.sec { padding: 3rem 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.sec-head h2 { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); }
.sec-head p { color: var(--text-muted); font-size: 14px; margin-top: 0.2rem; }
.sec-head a { color: var(--primary-dark); font-weight: 700; font-size: 14px; }

/* ─── Category cards ─── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.cat-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.25rem 1rem; text-align: center; transition: var(--transition);
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-med); }
.cat-card .cat-ic {
    width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
    background: var(--primary-bg); color: var(--primary); font-size: 1.35rem;
}
.cat-card strong { font-size: 14px; color: var(--text-primary); }
.cat-card small { color: var(--text-muted); font-size: 12px; }

/* ─── Product grid / card ─── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.prod-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; transition: var(--transition); display: flex; flex-direction: column;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-med); }
.prod-media { position: relative; aspect-ratio: 1 / 1; background: var(--bg-soft); overflow: hidden; }
.prod-media img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.prod-card:hover .prod-media img { transform: scale(1.06); }
.prod-tag {
    position: absolute; top: 0.7rem; right: 0.7rem; padding: 0.25rem 0.65rem; border-radius: var(--radius-full);
    background: var(--rose); color: #fff; font-size: 11px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.prod-tag.soft { background: var(--primary); }
.prod-out {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.prod-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.prod-cat { font-size: 11.5px; color: var(--primary); font-weight: 600; }
.prod-brand { font-size: 11px; color: var(--text-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.prod-brand i { font-size: 10px; }
.prod-title { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.45; }
.prod-title:hover { color: var(--primary-dark); }
.prod-price { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.prod-price .now { font-size: 1.1rem; font-weight: 800; color: var(--primary-dark); }
.prod-price .old { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }
.prod-actions { margin-top: 0.5rem; }

/* ─── Shop layout ─── */
.shop-layout { display: grid; grid-template-columns: 250px 1fr; gap: 1.75rem; align-items: start; }
.filter-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem; position: sticky; top: calc(var(--nav-h) + 1rem); }
.filter-box h3 { font-size: 1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.85rem; }
.filter-list { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-list a {
    display: flex; justify-content: space-between; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 600; transition: var(--transition);
}
.filter-list a:hover { background: var(--primary-bg); color: var(--primary-dark); }
.filter-list a.active { background: var(--gradient-primary); color: #fff; }
.filter-list a span { font-size: 12px; opacity: 0.8; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.toolbar .count { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.toolbar select {
    padding: 0.55rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-med);
    background: #fff; outline: none; font-weight: 600; color: var(--text-secondary);
}

/* ─── Product page ─── */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 13px; color: var(--text-muted); padding: 1rem 0; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary-dark); }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.gallery-main { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-soft); aspect-ratio: 1/1; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 0.6rem; margin-top: 0.75rem; flex-wrap: wrap; }
.gallery-thumbs img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--border); cursor: pointer; transition: var(--transition); }
.gallery-thumbs img:hover, .gallery-thumbs img.active { border-color: var(--primary); }
.pd-title { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); line-height: 1.35; }
.pd-meta { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0; flex-wrap: wrap; }
.pd-meta .chip { font-size: 12.5px; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: var(--radius-full); background: var(--primary-bg); color: var(--primary-dark); }
.pd-meta .chip.ok { background: #ecfdf5; color: #047857; }
.pd-meta .chip.no { background: #fef2f2; color: #b91c1c; }
.pd-price { display: flex; align-items: baseline; gap: 0.75rem; margin: 1rem 0; }
.pd-price .now { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.pd-price .old { font-size: 1.1rem; color: var(--text-muted); text-decoration: line-through; }
.pd-desc { color: var(--text-secondary); margin-bottom: 1.5rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-med); border-radius: var(--radius-md); overflow: hidden; background: #fff; }
.qty button { width: 42px; height: 46px; background: var(--bg-soft); border: none; font-size: 18px; color: var(--text-secondary); }
.qty button:hover { background: var(--primary-bg); color: var(--primary-dark); }
.qty input { width: 60px; height: 46px; border: none; text-align: center; font-weight: 700; font-size: 16px; outline: none; }
.pd-buy { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pd-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.85rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.pd-feature { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); font-size: 13.5px; font-weight: 600; }
.pd-feature i { color: var(--primary); font-size: 1.1rem; }
.tabs { margin-top: 2.5rem; }
.tabs-nav { display: flex; gap: 0.5rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tabs-nav button { padding: 0.7rem 1.2rem; background: none; border: none; font-weight: 700; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: 15px; }
.tabs-nav button.active { color: var(--primary-dark); border-color: var(--primary); }
.tab-pane { display: none; color: var(--text-secondary); line-height: 1.9; }
.tab-pane.active { display: block; }

/* ─── Cart ─── */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.75rem; align-items: start; }
.cart-table { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--border); }
.cart-row:last-child { border-bottom: none; }
.cart-row img { width: 90px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-row .c-title { font-weight: 700; color: var(--text-primary); }
.cart-row .c-price { color: var(--primary-dark); font-weight: 700; }
.cart-row .c-line { font-weight: 800; color: var(--text-primary); min-width: 90px; text-align: left; }
.cart-remove { background: none; border: none; color: #ef4444; font-size: 1.1rem; padding: 0.4rem; }
.summary { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.35rem; position: sticky; top: calc(var(--nav-h) + 1rem); }
.summary h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); margin-bottom: 1rem; }
.summary-line { display: flex; justify-content: space-between; padding: 0.6rem 0; color: var(--text-secondary); font-weight: 600; font-size: 14.5px; }
.summary-line.total { border-top: 2px dashed var(--border-med); margin-top: 0.5rem; padding-top: 0.9rem; font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.summary .btn { margin-top: 1rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.empty i { font-size: 3.5rem; color: var(--primary-light); margin-bottom: 1rem; }

/* ─── Checkout / forms ─── */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 0.4rem; }
.field label .req { color: var(--rose); }
.field input, .field select, .field textarea {
    width: 100%; padding: 0.7rem 0.95rem; border: 1px solid var(--border-med); border-radius: var(--radius-md);
    background: #fff; outline: none; transition: var(--transition); font-size: 14.5px; color: var(--text-body);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.field .err { color: var(--rose); font-size: 12.5px; margin-top: 0.3rem; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.card + .card { margin-top: 1.25rem; }
.card h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); margin-bottom: 1.15rem; display: flex; align-items: center; gap: 0.5rem; }
.card h3 i { color: var(--primary); }
.checkout-item { display: flex; gap: 0.75rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.checkout-item:last-child { border-bottom: none; }
.checkout-item img { width: 50px; height: 50px; border-radius: var(--radius-sm); object-fit: cover; }
.checkout-item .ci-info { flex: 1; }
.checkout-item .ci-info strong { display: block; font-size: 13.5px; color: var(--text-primary); font-weight: 700; }
.checkout-item .ci-info small { color: var(--text-muted); font-size: 12px; }
.pay-option { display: flex; align-items: center; gap: 0.65rem; padding: 0.9rem; border: 2px solid var(--primary); background: var(--primary-bg); border-radius: var(--radius-md); font-weight: 700; color: var(--primary-dark); }

/* ─── Success ─── */
.success-box { max-width: 640px; margin: 3rem auto; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2.5rem; box-shadow: var(--shadow-lg); }
.success-ic { width: 84px; height: 84px; border-radius: var(--radius-full); background: #ecfdf5; color: var(--green); font-size: 2.4rem; display: grid; place-items: center; margin: 0 auto 1.25rem; }
.success-box h1 { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.5rem; }
.success-box p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.order-code { display: inline-block; padding: 0.6rem 1.25rem; background: var(--primary-bg); border: 1px dashed var(--border-med); border-radius: var(--radius-md); font-weight: 800; color: var(--primary-dark); letter-spacing: 1px; }

/* ─── Feature strip ─── */
.features-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.feature-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem; display: flex; align-items: center; gap: 0.85rem; }
.feature-item i { font-size: 1.5rem; color: var(--primary); }
.feature-item strong { display: block; font-size: 14px; color: var(--text-primary); }
.feature-item small { color: var(--text-muted); font-size: 12px; }

/* ─── Pagination ─── */
.pager { display: flex; justify-content: center; gap: 0.4rem; margin-top: 2rem; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 40px; height: 40px; padding: 0 0.6rem; display: grid; place-items: center;
    border-radius: var(--radius-sm); border: 1px solid var(--border-med); font-weight: 700;
    color: var(--text-secondary); background: #fff; font-size: 14px;
}
.pager a:hover { background: var(--primary-bg); color: var(--primary-dark); }
.pager .active span, .pager .active { background: var(--gradient-primary); color: #fff; border-color: transparent; }
.pager .disabled { opacity: 0.45; }

/* ─── Footer ─── */
.footer { background: var(--bg-dark); color: #cbd5e1; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer h4 { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.footer p, .footer a { color: #94a3b8; font-size: 14px; line-height: 2; }
.footer a:hover { color: #fff; }
.footer-links { display: flex; flex-direction: column; }
.footer-brand { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1rem; }
.footer-brand .nav-brand-title { color: #fff; }
.footer-socials { display: flex; gap: 0.6rem; margin-top: 1rem; }
.footer-socials a { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.08); display: grid; place-items: center; color: #cbd5e1; }
.footer-socials a:hover { background: var(--primary); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; text-align: center; font-size: 13px; color: #64748b; }
.footer-links .footer-link-btn {
    background: none; border: none; padding: 0; text-align: right; cursor: pointer;
    color: #94a3b8; font-size: 14px; line-height: 2; font-family: var(--font);
}
.footer-links .footer-link-btn:hover { color: #fff; }

/* ─── Toast ─── */
.toast-wrap { position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.6rem; }
.toast {
    display: flex; align-items: center; gap: 0.6rem; background: var(--bg-dark); color: #fff;
    padding: 0.85rem 1.2rem; border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
    font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(12px); transition: var(--transition);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-right: 4px solid var(--green); }
.toast.error { border-right: 4px solid var(--rose); }

/* ─── Reveal ─── */
.reveal { opacity: 0; transform: translateY(20px); transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ─── My Orders / تتبّع الطلب ─── */
.page-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.page-head-ic {
    flex: none; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
    background: var(--gradient-primary); color: #fff; font-size: 22px; box-shadow: var(--shadow-md);
}
.page-head h1 { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); line-height: 1.25; }
.page-head p { color: var(--text-muted); font-size: 14px; }
.page-head > form, .page-head .page-head-action { margin-inline-start: auto; }
.form-field { display: flex; flex-direction: column; gap: 0.45rem; text-align: right; }
.form-field label { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.form-field input {
    width: 100%; height: 50px; padding: 0 1rem; border-radius: var(--radius-md);
    border: 1.5px solid var(--border-med); background: #fff; color: var(--text-body);
    font-size: 16px; outline: none; transition: var(--transition);
}
.form-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.field-error { color: var(--rose); font-size: 12.5px; font-weight: 600; }

.orders-lookup {
    max-width: 480px; margin: 1rem auto 3rem; text-align: center;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 2.25rem 2rem; box-shadow: var(--shadow-lg);
}
.orders-lookup-ic {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 20px; display: grid;
    place-items: center; background: var(--gradient-primary); color: #fff; font-size: 26px;
    box-shadow: var(--shadow-md);
}
.orders-lookup h3 { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.4rem; }
.orders-lookup p { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 1.5rem; }
.orders-lookup-form { display: flex; flex-direction: column; gap: 1.1rem; }

/* ─── Customer auth ─── */
.auth-box {
    max-width: 460px; margin: 1rem auto 3rem; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 2.25rem 2rem; box-shadow: var(--shadow-lg);
}
.auth-ic {
    width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 20px; display: grid;
    place-items: center; background: var(--gradient-primary); color: #fff; font-size: 26px;
    box-shadow: var(--shadow-md);
}
.auth-box h1 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); text-align: center; }
.auth-box .auth-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin: 0.35rem 0 1.6rem; }
.auth-box .form-field { margin-bottom: 1rem; }
.auth-remember { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 14px; font-weight: 600; color: var(--text-secondary); margin: 0.25rem 0 1.25rem; cursor: pointer; }
.auth-remember input { width: 18px; height: 18px; accent-color: var(--primary); }
.auth-alt { text-align: center; margin-top: 1.35rem; font-size: 14px; color: var(--text-secondary); }
.auth-alt a { color: var(--primary-dark); font-weight: 700; }
.auth-alt a:hover { text-decoration: underline; }

.my-orders-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 1.25rem;
}
.my-orders-sub { color: var(--text-secondary); font-weight: 600; font-size: 14.5px; }
.my-orders-sub strong { color: var(--primary-dark); }

.orders-list { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 3rem; }
.order-card {
    display: grid; grid-template-columns: 76px 1fr auto; gap: 1rem; align-items: center;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 0.9rem 1rem; transition: var(--transition); box-shadow: var(--shadow-sm);
}
.order-card:hover { transform: translateY(-3px); border-color: var(--border-med); box-shadow: var(--shadow-lg); }
.order-thumb {
    width: 76px; height: 76px; border-radius: var(--radius-md); overflow: hidden; flex: none;
    background: var(--bg-soft); display: grid; place-items: center; color: var(--primary-light); font-size: 1.5rem;
}
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-main { min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.order-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.order-num { font-weight: 800; color: var(--text-primary); font-size: 15.5px; letter-spacing: 0.5px; }
.order-date { color: var(--text-muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.order-sub { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 12.5px; font-weight: 600; flex-wrap: wrap; }
.order-sub i { color: var(--primary-light); }
.order-sub .dot-sep { color: var(--border-med); }
.mini-track { display: flex; gap: 5px; max-width: 260px; margin-top: 0.1rem; }
.mini-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--border-med); }
.mini-dot.on { background: var(--gradient-primary); }
.order-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.order-total { font-weight: 800; color: var(--primary-dark); font-size: 1.15rem; white-space: nowrap; }
.track-cta { color: var(--primary-dark); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 0.4rem; }
.track-cta i { transition: transform 0.2s ease; }
.order-card:hover .track-cta i { transform: translateX(-3px); }
.ci-thumb {
    width: 50px; height: 50px; border-radius: var(--radius-sm); flex: none; display: grid; place-items: center;
    background: var(--bg-soft); color: var(--primary-light); font-size: 1.1rem; overflow: hidden;
}
.ci-thumb img { width: 100%; height: 100%; object-fit: cover; }

.status-pill {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full); font-weight: 700; font-size: 12.5px; white-space: nowrap;
}
.status-pill-lg { padding: 0.55rem 1.1rem; font-size: 14px; }

.order-detail { margin-bottom: 3rem; }
.order-detail-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem; box-shadow: var(--shadow-sm);
}
.order-detail-label { display: block; color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.order-detail-num { display: block; font-size: 1.35rem; font-weight: 800; color: var(--text-primary); letter-spacing: 1px; }
.order-detail-id { display: flex; align-items: center; gap: 0.9rem; }
.order-detail-ic {
    width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; flex: none;
    background: var(--gradient-primary); color: #fff; font-size: 20px; box-shadow: var(--shadow-md);
}
.order-panel + .order-detail-grid { margin-top: 1.25rem; }

.track { position: relative; display: flex; margin: 1.5rem 0; }
.track-line, .track-fill { position: absolute; top: 20px; right: 10%; height: 3px; border-radius: 2px; }
.track-line { left: 10%; background: var(--border-med); }
.track-fill { width: calc(80% * var(--p, 0)); background: var(--gradient-primary); }
.track-step { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.track-step .dot {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; border: 2px solid var(--border-med); color: var(--text-muted);
    font-size: 15px; transition: var(--transition);
}
.track-step.done .dot { background: var(--gradient-primary); border-color: transparent; color: #fff; }
.track-step.current .dot { border-color: var(--primary); color: var(--primary-dark); box-shadow: 0 0 0 5px var(--primary-bg); }
.track-step .lbl { font-size: 12px; font-weight: 700; color: var(--text-muted); text-align: center; }
.track-step.done .lbl, .track-step.current .lbl { color: var(--primary-dark); }

.track-cancelled {
    display: flex; align-items: center; gap: 0.85rem; margin: 1.25rem 0;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-lg);
    padding: 1.1rem 1.35rem; color: #b91c1c;
}
.track-cancelled i { font-size: 1.6rem; }
.track-cancelled strong { display: block; font-weight: 800; }
.track-cancelled p { font-size: 13.5px; margin: 0; }

.order-detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.order-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.35rem; box-shadow: var(--shadow-sm); }
.order-panel h4 {
    font-size: 1.05rem; font-weight: 800; color: var(--text-primary); margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.order-panel h4 i { color: var(--primary); }
.order-summary { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.info-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-muted); font-weight: 600; flex: none; }
.info-row strong { color: var(--text-primary); font-weight: 700; text-align: left; }
.order-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .shop-layout { grid-template-columns: 1fr; }
    .filter-box { position: static; }
    .cart-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .product-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links {
        position: fixed; top: var(--nav-h); right: 0; left: 0; flex-direction: column;
        background: #fff; padding: 1rem; gap: 0.25rem; border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg); transform: translateY(-130%); transition: var(--transition); align-items: stretch;
    }
    .nav-links.open { transform: none; }
    .nav-links a { padding: 0.75rem 1rem; }
    .nav-toggle { display: grid; }
    .nav-search { display: none; }
    .hero h1 { font-size: 2rem; }
    .form-row { grid-template-columns: 1fr; }
    .cart-row { grid-template-columns: 70px 1fr; }
    .cart-row .c-line { text-align: right; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   Mobile App Shell (PWA) — يظهر على الجوال فقط
   ================================================================ */
:root { --appnav-h: 60px; --safe-b: env(safe-area-inset-bottom, 0px); }

html { -webkit-text-size-adjust: 100%; }
.appnav { display: none; }
.cat-select { display: none; }

/* بحث كامل الشاشة */
.search-overlay {
    position: fixed; inset: 0; z-index: 1300;
    background: rgba(248, 250, 252, 0.98);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    display: flex; flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
    animation: overlayIn 0.22s ease;
}
.search-overlay[hidden] { display: none; }
@keyframes overlayIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.search-overlay-bar {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); background: #fff;
}
.search-overlay-bar form { flex: 1; position: relative; display: flex; align-items: center; gap: 0.5rem; }
.search-overlay-bar form > i { position: absolute; right: 1rem; color: var(--text-muted); pointer-events: none; }
.search-overlay-bar input {
    flex: 1; font-size: 16px; padding: 0.75rem 2.6rem 0.75rem 0.9rem;
    border: 1px solid var(--border-med); border-radius: var(--radius-md);
    outline: none; background: var(--bg-soft); color: var(--text-body);
}
.search-overlay-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); background: #fff; }
.search-close {
    width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text-secondary); font-size: 17px;
    display: grid; place-items: center; flex: none;
}
.search-overlay-body { padding: 1.25rem 1rem; overflow-y: auto; }
.search-overlay-hint { font-weight: 700; color: var(--text-muted); font-size: 13px; margin-bottom: 0.85rem; }
.search-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.search-chip {
    padding: 0.5rem 0.9rem; border-radius: var(--radius-full); background: #fff;
    border: 1px solid var(--border-med); color: var(--text-secondary); font-weight: 600; font-size: 13.5px;
}
.search-chip:active { background: var(--primary-bg); color: var(--primary-dark); }
body.no-scroll { overflow: hidden; }

@media (max-width: 768px) {
    html, body { overscroll-behavior-y: contain; }
    body.app-shell { padding-bottom: calc(var(--appnav-h) + var(--safe-b) + 6px); }
    * { -webkit-tap-highlight-color: transparent; }

    /* شريط التطبيق العلوي */
    .nav { height: 58px; }
    .nav .wrap { padding: 0 1rem; }
    .nav-brand-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
    .nav-brand-title { font-size: 1rem; }
    .nav-brand-sub { display: none; }
    .nav-search { display: none; }
    .nav-toggle, .nav-icon-btn { width: 42px; height: 42px; }
    .wrap { padding: 0 1rem; }

    /* الشريط السفلي */
    .appnav {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
        height: calc(var(--appnav-h) + var(--safe-b));
        padding-bottom: var(--safe-b);
        background: rgba(255, 255, 255, 0.94);
        -webkit-backdrop-filter: blur(18px) saturate(1.7);
        backdrop-filter: blur(18px) saturate(1.7);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.07);
    }
    .appnav-item {
        position: relative; display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 3px; min-height: 44px;
        font-size: 10.5px; font-weight: 600; color: var(--text-muted);
        background: none; border: none; padding: 0; transition: color 0.2s ease;
    }
    .appnav-item i { font-size: 19px; transition: transform 0.2s ease; }
    .appnav-item.active { color: var(--primary-dark); }
    .appnav-item.active i { transform: translateY(-1px) scale(1.06); }
    .appnav-item:active { color: var(--primary); }
    .appnav-badge {
        position: absolute; top: 3px; right: calc(50% - 22px);
        min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-full);
        background: var(--rose); color: #fff; font-size: 10px; font-weight: 700;
        display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
    }

    /* الهيرو */
    .hero { padding: 1.75rem 0 1.5rem; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 0.95rem; margin-bottom: 1.25rem; }
    .hero-badge { font-size: 12px; margin-bottom: 0.9rem; }
    .hero-visual { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
    .hero-tile { padding: 0.9rem; border-radius: var(--radius-md); }
    .hero-tile:nth-child(1), .hero-tile:nth-child(4) { transform: none; }
    .hero-tile i { font-size: 1.2rem; }
    .hero-tile strong { font-size: 0.85rem; }
    .hero-cta { gap: 0.6rem; }
    .hero-cta .btn { flex: 1; }

    /* الأقسام */
    .sec { padding: 1.75rem 0; }
    .sec-head { margin-bottom: 1.1rem; align-items: center; }
    .sec-head h2 { font-size: 1.3rem; }
    .sec-head p { display: none; }

    /* التصنيفات — دروب ليست على الجوال */
    .cat-grid { display: none; }
    .cat-select {
        display: flex; align-items: center; position: relative; margin-bottom: 1rem;
    }
    .cat-select select {
        width: 100%; height: 50px; appearance: none; -webkit-appearance: none;
        padding: 0 2.9rem 0 2.55rem; line-height: 50px;
        border: 1.5px solid var(--border-med); border-radius: var(--radius-md);
        background: #fff; font-weight: 700; color: var(--text-primary); font-size: 15px;
        outline: none; box-shadow: var(--shadow-sm); text-overflow: ellipsis; cursor: pointer;
    }
    .cat-select select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
    .cat-select-ic { position: absolute; right: 1rem; color: var(--primary); pointer-events: none; font-size: 16px; line-height: 1; }
    .cat-select-arrow { position: absolute; left: 1.05rem; color: var(--text-muted); pointer-events: none; font-size: 12.5px; line-height: 1; }

    /* إخفاء فلتر التصنيف الجانبي على الجوال (يُستبدل بالدروب ليست) */
    .shop-layout > aside { display: none; }
    .toolbar select { height: 46px; padding-top: 0; padding-bottom: 0; }

    /* المنتجات — عمودان */
    .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
    .prod-body { padding: 0.7rem; gap: 0.3rem; }
    .prod-cat { font-size: 10.5px; }
    .prod-title { font-size: 13.5px; line-height: 1.4; }
    .prod-price .now { font-size: 1rem; }
    .prod-price .old { font-size: 11.5px; }
    .prod-card .btn { font-size: 12px; padding: 0.5rem; border-radius: var(--radius-sm); }
    .prod-tag { font-size: 10px; padding: 0.2rem 0.5rem; }
    .prod-card:hover { transform: none; }
    .prod-card:hover .prod-media img { transform: none; }

    /* الأدوات */
    .toolbar { gap: 0.6rem; }
    .toolbar select { flex: 1; }

    /* صفحة المنتج */
    .breadcrumb { padding: 0.75rem 0; font-size: 12px; }
    .pd-title { font-size: 1.4rem; }
    .pd-price .now { font-size: 1.6rem; }
    .pd-buy { flex-direction: column; align-items: stretch; }
    .pd-buy .btn { width: 100%; }
    .qty { justify-content: space-between; width: 100%; }
    .qty input { width: 100%; }
    .gallery-thumbs img { width: 60px; height: 60px; }
    .tabs-nav { overflow-x: auto; }
    .tabs-nav button { flex: none; }

    /* السلة والدفع */
    .cart-row { grid-template-columns: 64px 1fr; gap: 0.75rem; padding: 0.85rem; }
    .cart-row img { width: 64px; height: 64px; }
    .summary, .card { padding: 1.1rem; }

    /* طلباتي */
    .page-head { gap: 0.75rem; margin-bottom: 1.25rem; }
    .page-head-ic { width: 48px; height: 48px; border-radius: 15px; font-size: 19px; }
    .page-head h1 { font-size: 1.4rem; }
    .page-head p { font-size: 13px; }
    .orders-lookup { padding: 1.75rem 1.35rem; }
    .order-card { grid-template-columns: 60px 1fr; gap: 0.75rem 0.85rem; }
    .order-thumb { width: 60px; height: 60px; }
    .order-side {
        grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between;
        border-top: 1px dashed var(--border-med); padding-top: 0.6rem;
    }
    .order-detail-grid { grid-template-columns: 1fr; }
    .order-detail-head { padding: 1.1rem 1.15rem; }
    .order-detail-num { font-size: 1.15rem; }
    .track-step .dot { width: 36px; height: 36px; font-size: 13px; }
    .track-step .lbl { font-size: 10.5px; }
    .track-line, .track-fill { top: 17px; }

    /* الفوتر */
    .footer { padding: 2rem 0 1.5rem; margin-top: 2rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }

    /* التوست فوق الشريط السفلي */
    .toast-wrap { bottom: calc(var(--appnav-h) + var(--safe-b) + 0.75rem); left: 1rem; right: 1rem; }
    .toast { justify-content: center; }
}

@media (max-width: 360px) {
    .prod-grid { gap: 0.5rem; }
    .hero h1 { font-size: 1.5rem; }
}

/* نمط التطبيق المثبّت (Added to home screen) */
@media (display-mode: standalone) {
    .nav { height: auto; min-height: 58px; padding-top: env(safe-area-inset-top, 0px); }
}

@media (prefers-reduced-motion: reduce) {
    .search-overlay { animation: none; }
    .appnav-item i { transition: none; }
}
