/* es-shell:v2 — رأس وذيل العميل. يُحمَّل من <head> حتى لا تومض الصفحة بلا تنسيق */
:root {
    --es-violet: #7c3aed;
    --es-violet-deep: #5b21b6;
    --es-ink: #0b1220;
    --es-muted: #64748b;
    --es-line: #e2e8f0;
    --es-wash: #f8fafc;
}
.es-impersonate {
    background: #fef3c7; color: #92400e; text-align: center;
    padding: 10px 16px; font-size: 13px; font-weight: 700; border-bottom: 2px solid #f59e0b;
}
.es-impersonate a {
    display: inline-block; margin-inline-start: 12px; background: #ef4444; color: #fff;
    padding: 5px 14px; border-radius: 8px; text-decoration: none; font-weight: 800;
}
.es-shell {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(15,23,42,.05);
}
.es-rail {
    position: relative;
    height: 3px;
    overflow: hidden;
    background: linear-gradient(to left, #ede9fe, #ddd6fe 40%, #f5f3ff);
}
.es-rail span {
    position: absolute;
    inset-block: 0;
    width: 38%;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, #7c3aed 22%, #c4b5fd 50%, #7c3aed 78%, transparent);
    box-shadow: 0 0 14px rgba(124, 58, 237, .55);
    animation: esRail 3.6s ease-in-out infinite alternate;
}
@keyframes esRail {
    from { inset-inline-start: -10%; }
    to   { inset-inline-start: 72%; }
}
.es-bar {
    max-width: 1440px; margin: 0 auto; padding: 0 20px;
    height: 72px; display: flex; align-items: center; gap: 18px;
}
.es-brand {
    display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0;
}
.es-brand img {
    width: 40px; height: 40px; object-fit: contain; border-radius: 11px;
    background: #f5f3ff; padding: 4px;
}
.es-wordmark {
    font-size: 21px; font-weight: 900; color: var(--es-ink); letter-spacing: -.4px; line-height: 1;
}
.es-wordmark span { color: var(--es-violet); }
.es-links { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.es-links a {
    display: flex; align-items: center; gap: 7px;
    text-decoration: none; color: var(--es-muted); font-weight: 800; font-size: 13.5px;
    padding: 8px 12px; border-radius: 10px;
}
.es-links a i { font-size: 18px; line-height: 1; }
.es-links a:hover { color: var(--es-ink); background: var(--es-wash); }
.es-links a.is-on { color: var(--es-violet); background: #f5f3ff; }
.es-search { flex: 1; min-width: 0; max-width: 560px; position: relative; margin-inline: auto; }
.es-search[hidden] { display: none !important; }
.es-search form {
    display: flex; align-items: center; gap: 8px;
    background: var(--es-wash); border: 1px solid var(--es-line); border-radius: 999px;
    padding: 0 6px 0 16px; height: 46px; transition: border-color .2s, box-shadow .2s;
}
.es-search form:focus-within {
    border-color: var(--es-violet);
    box-shadow: 0 0 0 4px rgba(124,58,237,.14);
    background: #fff;
}
.es-search i { color: var(--es-violet); font-size: 18px; }
.es-search input {
    flex: 1; border: 0; background: transparent; outline: none;
    font: 700 14px Tajawal, sans-serif; color: var(--es-ink); min-width: 0;
}
.es-drop {
    position: absolute; top: calc(100% + 8px); inset-inline: 0;
    background: #fff; border-radius: 18px; padding: 8px 0;
    box-shadow: 0 22px 50px rgba(15,23,42,.18); border: 1px solid #f1f5f9;
    max-height: min(70vh, 420px); overflow-y: auto; z-index: 50; color: var(--es-ink);
}
.es-drop[hidden] { display: none; }
.es-drop h5 {
    margin: 0; padding: 8px 16px 4px; font-size: 11px; font-weight: 800;
    color: var(--es-muted); letter-spacing: .4px;
}
.es-hit {
    display: flex; align-items: center; gap: 12px; padding: 9px 16px;
    text-decoration: none; color: inherit;
}
.es-hit:hover { background: #f8fafc; }
.es-hit img, .es-hit .ph-thumb {
    width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #f1f5f9; flex-shrink: 0;
}
.es-hit .ph-thumb { display: flex; align-items: center; justify-content: center; color: var(--es-violet); font-size: 20px; }
.es-hit b { display: block; font-size: 13.5px; font-weight: 800; }
.es-hit small { color: var(--es-muted); font-size: 12px; font-weight: 700; }
.es-hit .es-price { margin-inline-start: auto; font-weight: 900; color: var(--es-violet); font-size: 13px; white-space: nowrap; }
.es-drop .es-empty { padding: 22px 16px; text-align: center; color: var(--es-muted); font-weight: 700; font-size: 13px; }
.es-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-inline-start: auto; }
.es-loc {
    display: flex; align-items: center; gap: 6px; background: var(--es-wash);
    border: 1px solid var(--es-line); border-radius: 12px; padding: 8px 12px;
    font: 800 13px Tajawal, sans-serif; color: var(--es-violet); cursor: pointer; max-width: 140px;
}
.es-loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-icon {
    position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: var(--es-wash); border: 1px solid var(--es-line); border-radius: 12px;
    color: #475569; text-decoration: none; font-size: 22px;
}
.es-icon:hover { color: var(--es-violet); background: #f5f3ff; }
.es-cart {
    background: linear-gradient(135deg, var(--es-violet), var(--es-violet-deep));
    border: 0; color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.32);
}
.es-cart:hover { color: #fff; filter: brightness(1.06); }
.es-badge {
    position: absolute; top: -6px; inset-inline-end: -6px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 900;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.es-badge[hidden] { display: none !important; }
.es-login {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--es-violet), var(--es-violet-deep));
    color: #fff; text-decoration: none; font-weight: 800; font-size: 13px;
    padding: 10px 16px; border-radius: 12px; box-shadow: 0 4px 14px rgba(124,58,237,.25);
}
.es-user { position: relative; }
.es-user > button {
    display: flex; align-items: center; gap: 8px; background: var(--es-wash);
    border: 1px solid var(--es-line); border-radius: 12px; padding: 5px 12px 5px 6px;
    cursor: pointer; font: 800 13px Tajawal, sans-serif; color: var(--es-ink);
}
.es-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.es-user > button span {
    max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.es-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
    background: #fff; min-width: 220px; border-radius: 14px; padding: 8px;
    box-shadow: 0 18px 40px rgba(15,23,42,.14); border: 1px solid #f1f5f9; z-index: 1100;
}
.es-menu[hidden] { display: none; }
.es-menu a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    color: #334155; text-decoration: none; font-size: 13px; font-weight: 700; border-radius: 10px;
}
.es-menu a:hover { background: var(--es-wash); color: var(--es-violet); }
.es-menu a.is-out { color: #ef4444; }
.es-menu a.is-out:hover { background: #fef2f2; color: #ef4444; }
.es-menu i { font-size: 18px; color: var(--es-violet); }
.es-menu a.is-out i { color: #ef4444; }
.es-tabbar { display: none; }

.es-foot {
    background: #0b1220;
    color: #cbd5e1;
    margin-top: 48px;
    padding: 0 0 28px;
    border-top: 3px solid #7c3aed;
}
.es-foot-cta {
    max-width: 1440px; margin: 0 auto; padding: 28px 24px 0;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.es-foot-cta strong { display: block; color: #fff; font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.es-foot-cta span { font-size: 14px; font-weight: 600; color: #94a3b8; }
.es-foot-cta a {
    background: #7c3aed; color: #fff; text-decoration: none; font-weight: 800;
    padding: 12px 22px; border-radius: 12px; white-space: nowrap;
    box-shadow: 0 8px 20px rgba(124,58,237,.35);
}
.es-foot-cta a:hover { background: #6d28d9; }
.es-foot-grid {
    max-width: 1440px; margin: 0 auto; padding: 36px 24px 8px;
    display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px;
}
.es-foot-brand { font-size: 24px; font-weight: 900; color: #fff; margin-bottom: 10px; }
.es-foot-brand span { color: #a78bfa; }
.es-foot-grid p { margin: 0 0 8px; font-size: 14px; line-height: 1.7; color: #94a3b8; font-weight: 600; }
.es-foot-grid h4 { margin: 0 0 12px; color: #fff; font-size: 14px; font-weight: 800; }
.es-foot-grid a {
    display: block; color: #94a3b8; text-decoration: none; font-size: 14px; font-weight: 700;
    padding: 4px 0;
}
.es-foot-grid a:hover { color: #fff; }
.es-foot-grid .ph { color: #a78bfa; margin-inline-end: 6px; }
.es-foot-copy {
    max-width: 1440px; margin: 20px auto 0; padding: 18px 24px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: 12.5px; color: #64748b; font-weight: 700;
}

.es-partner {
    max-width: 720px; margin: 40px auto 60px; padding: 0 20px;
}
.es-partner h1 { font-size: 28px; font-weight: 900; color: var(--es-ink); margin: 0 0 8px; }
.es-partner .lead { color: var(--es-muted); font-weight: 700; margin-bottom: 24px; }
.es-partner form {
    background: #fff; border: 1px solid var(--es-line); border-radius: 20px;
    padding: 28px; box-shadow: 0 12px 40px rgba(15,23,42,.06);
    display: grid; gap: 14px;
}
.es-partner label { font-size: 13px; font-weight: 800; color: #334155; display: block; margin-bottom: 6px; }
.es-partner input, .es-partner select, .es-partner textarea {
    width: 100%; border: 1px solid var(--es-line); border-radius: 12px;
    padding: 12px 14px; font: 700 14px Tajawal, sans-serif; color: var(--es-ink);
    background: var(--es-wash); box-sizing: border-box;
}
.es-partner input:focus, .es-partner select:focus, .es-partner textarea:focus {
    outline: none; border-color: var(--es-violet); background: #fff;
    box-shadow: 0 0 0 4px rgba(124,58,237,.12);
}
.es-partner .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.es-partner .hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.es-partner button {
    background: linear-gradient(135deg, var(--es-violet), var(--es-violet-deep));
    color: #fff; border: 0; border-radius: 12px; padding: 14px 20px;
    font: 800 15px Tajawal, sans-serif; cursor: pointer;
    box-shadow: 0 8px 20px rgba(124,58,237,.3);
}
.es-partner .ok {
    background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
    padding: 14px 16px; border-radius: 12px; font-weight: 800;
}
.es-partner .err { color: #b91c1c; font-size: 12.5px; font-weight: 700; }

.es-hub { max-width: 880px; margin: 48px auto 70px; padding: 0 20px; }
.es-hub h1 { font-size: 30px; font-weight: 900; color: var(--es-ink); margin: 0 0 8px; }
.es-hub > .lead { color: var(--es-muted); font-weight: 700; margin-bottom: 28px; max-width: 36em; }
.es-hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.es-hub-card {
    display: block; background: #fff; border: 1px solid var(--es-line);
    border-radius: 22px; padding: 28px 26px; text-decoration: none; color: inherit;
    box-shadow: 0 12px 40px rgba(15,23,42,.06); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.es-hub-card:hover { transform: translateY(-3px); border-color: #ddd6fe; box-shadow: 0 18px 44px rgba(124,58,237,.12); }
.es-hub-card i { font-size: 34px; color: var(--es-violet); }
.es-hub-card h2 { font-size: 20px; font-weight: 900; margin: 14px 0 8px; color: var(--es-ink); }
.es-hub-card p { margin: 0; color: var(--es-muted); font-weight: 700; line-height: 1.7; font-size: 14px; }
.es-hub-card em { display: inline-block; margin-top: 16px; color: var(--es-violet); font-style: normal; font-weight: 800; font-size: 13px; }

@media (max-width: 1100px) {
    .es-links { display: none; }
    .es-user > button span { display: none; }
}
@media (max-width: 860px) {
    .es-bar { height: auto; min-height: 60px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
    .es-wordmark { font-size: 18px; }
    .es-shell:not(.is-home) .es-search {
        display: block !important;
        flex: 1 1 100%;
        max-width: none;
        order: 8;
    }
    .es-loc span { max-width: 72px; }
    .es-login { padding: 8px 12px; }
    .es-tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; bottom: 0; inset-inline: 0; z-index: 1100;
        background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
        border-top: 1px solid var(--es-line);
        padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    }
    .es-tabbar a {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        text-decoration: none; color: var(--es-muted); font-size: 11px; font-weight: 800; padding: 6px 0;
    }
    .es-tabbar a i { font-size: 22px; }
    .es-tabbar a.is-on { color: var(--es-violet); }
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    .es-foot { margin-top: 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
    .es-foot-grid { grid-template-columns: 1fr 1fr; padding-top: 24px; }
    .es-partner .row { grid-template-columns: 1fr; }
    .es-hub-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .es-search form, .es-icon { transition: none; }
    .es-rail span { animation: none; inset-inline-start: 30%; width: 40%; }
}
