/* EagleStore — Butterfly Modern Sport UI */

:root {
  --egale-bg: #ffffff;
  --egale-surface: #f6f6f7;
  --egale-elev: #ffffff;
  --egale-text: #0a0a0a;
  --egale-muted: #6b7280;
  --egale-border: #e5e7eb;
  --egale-accent: #e91e8c;
  --egale-accent-dim: rgba(233, 30, 140, 0.12);
  --egale-glow: rgba(233, 30, 140, 0.2);
  --egale-radius: 14px;
  --egale-radius-sm: 10px;
  --egale-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  --egale-font: "DM Sans", system-ui, sans-serif;
  --egale-display: "Outfit", "DM Sans", system-ui, sans-serif;
  --egale-ticker-h: 34px;
  --egale-topbar-h: 52px;
  --egale-nav-h: 64px;
  --egale-safe: env(safe-area-inset-bottom, 0);
  --egale-transition: 0.2s ease;
}
[data-theme="dark"] {
  --egale-bg: #0b0b0c;
  --egale-surface: #121214;
  --egale-elev: #18181b;
  --egale-text: #fafafa;
  --egale-muted: #9ca3af;
  --egale-border: #27272a;
  --egale-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
  --egale-accent-dim: rgba(233, 30, 140, 0.2);
  --egale-glow: rgba(233, 30, 140, 0.25);
}
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body.egale-body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--egale-font), "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--egale-text);
  background: var(--egale-bg);
  transition: background var(--egale-transition), color var(--egale-transition);
}
.egale-body.has-mobile-nav .egale-main,
.app-shell.has-mobile-nav {
  padding-bottom: calc(var(--egale-nav-h) + var(--egale-safe) + 8px);
}
body.admin.has-mobile-nav .admin-main {
  padding-bottom: calc(var(--egale-nav-h) + var(--egale-safe) + 32px);
}
.egale-main { padding: 0 16px 24px; max-width: 1200px; margin: 0 auto; }

/* Ticker */
.egale-ticker {
  height: var(--egale-ticker-h);
  background: var(--egale-surface);
  border-bottom: 1px solid var(--egale-border);
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  color: var(--egale-text);
}
.egale-ticker-track {
  display: inline-block;
  padding: 6px 0;
  animation: egale-ticker 32s linear infinite;
}
[data-dir="rtl"] .egale-ticker-track { animation-name: egale-ticker-rtl; }
@keyframes egale-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes egale-ticker-rtl { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Topbar */
.egale-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: var(--egale-topbar-h);
  max-width: 100%;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--egale-bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--egale-border);
}
.egale-brand {
  font-family: var(--egale-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--egale-text);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(42%, 12rem);
}
.egale-topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.egale-topbar-actions::-webkit-scrollbar { height: 3px; }
.egale-topbar-actions::-webkit-scrollbar-thumb { background: var(--egale-border); border-radius: 3px; }
.egale-topbar-tight { font-size: 12px; }
.egale-topbar-icoGroup {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.egale-topbar-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--egale-border);
  background: var(--egale-elev);
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--egale-text);
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.egale-topbar-ico:hover { border-color: var(--egale-accent); background: var(--egale-accent-dim); color: var(--egale-accent); }
.egale-topbar .egale-lang { flex: 0 0 auto; font-size: 12px; }
.egale-topbar .egale-link-small { white-space: nowrap; }
@media (min-width: 480px) {
  .egale-brand { font-size: 1.1rem; max-width: min(50%, 14rem); }
  .egale-topbar { padding: 8px 14px; }
}
@media (min-width: 700px) {
  .egale-brand { max-width: none; overflow: visible; text-overflow: clip; }
}
.egale-notif-navlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  line-height: 1;
  padding: 4px 2px;
  border-radius: 10px;
  color: var(--egale-text);
}
.egale-notif-navlink:hover { background: var(--egale-accent-dim); color: var(--egale-accent); }
.egale-notif-ico { font-size: 1.2rem; }
.egale-notif-badge,
.egale-mnav-badge {
  min-width: 1.15rem;
  min-height: 1.1rem;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--egale-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.egale-notif-navlink .egale-notif-badge { margin-inline-start: -1px; }
.egale-nav-ico-wrap {
  position: relative;
  display: inline-block;
  line-height: 1;
}
.egale-mnav-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -6px;
  z-index: 1;
  box-shadow: 0 0 0 2px var(--egale-elev);
}
.egale-link-small { font-size: 13px; color: var(--egale-muted); text-decoration: none; }
.egale-link-small:hover { color: var(--egale-accent); }
.egale-lang { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.egale-lang a { color: var(--egale-muted); text-decoration: none; }
.egale-lang a.is-active { color: var(--egale-accent); font-weight: 600; }
.egale-dot { opacity: 0.3; }
.egale-theme-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--egale-border);
  background: var(--egale-elev);
  color: var(--egale-text);
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.egale-theme-btn:hover { border-color: var(--egale-accent); box-shadow: 0 0 0 3px var(--egale-accent-dim); }

/* Hero + cards */
.egale-hero { padding: 28px 0 8px; }
.egale-hero h1 {
  font-family: var(--egale-display);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.1;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
.egale-hero p { margin: 0; color: var(--egale-muted); }
.egale-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--egale-accent-dim); color: var(--egale-accent); margin-bottom: 12px; }
.egale-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 20px; }
.egale-tile,
.egale-card {
  display: block;
  padding: 18px;
  background: var(--egale-elev);
  border: 1px solid var(--egale-border);
  border-radius: var(--egale-radius);
  box-shadow: var(--egale-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform var(--egale-transition), box-shadow 0.25s ease;
  position: relative; overflow: hidden;
}
.egale-tile:hover,
.egale-card:hover { transform: translateY(-2px); }
.egale-tile .ico { font-size: 1.6rem; }
.egale-tile h3 { margin: 8px 0 4px; font-size: 1rem; }
.egale-tile p { margin: 0; font-size: 13px; color: var(--egale-muted); }
.egale-tile--accent { border-color: color-mix(in srgb, var(--egale-accent) 30%, var(--egale-border)); }
.egale-tile--accent::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear(90deg, var(--egale-accent), #ff4d8d); }

/* Forms */
.egale-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--egale-muted); }
.egale-input, .egale-select, .egale-textarea {
  width: 100%; max-width: 420px;
  padding: 10px 12px;
  border: 1px solid var(--egale-border);
  border-radius: var(--egale-radius-sm);
  background: var(--egale-bg);
  color: var(--egale-text);
  font: inherit;
}
.egale-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px; border: none; border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--egale-text); color: var(--egale-bg);
  transition: transform 0.12s ease, box-shadow 0.2s;
}
.egale-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.egale-btn:hover:not(:disabled) { transform: translateY(-1px); }
.egale-btn--primary { background: var(--egale-accent); color: #fff; box-shadow: 0 8px 24px var(--egale-glow); }
.egale-btn--ghost { background: transparent; color: var(--egale-text); border: 1px solid var(--egale-border); }
.egale-messages { list-style: none; padding: 0; margin: 0 0 12px; }
.egale-messages li { font-size: 14px; padding: 8px 12px; border-radius: var(--egale-radius-sm); }
.egale-err { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.egale-ok { background: rgba(34, 197, 94, 0.12); color: #15803d; }

/* Store grid */
.egale-prod-row { display: flex; flex-wrap: wrap; gap: 16px; }
.egale-prod {
  width: 160px; text-decoration: none; color: inherit; flex: 0 0 auto;
}
.egale-prod-img { border-radius: var(--egale-radius); overflow: hidden; aspect-ratio: 1; background: var(--egale-surface); border: 1px solid var(--egale-border); }
.egale-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.egale-prod h4 { margin: 8px 0 2px; font-size: 0.9rem; }
.egale-prod .price { font-weight: 700; color: var(--egale-accent); }
.egale-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.egale-badge { font-size: 11px; font-weight: 600; background: var(--egale-surface); padding: 2px 8px; border-radius: 6px; color: var(--egale-muted); }
.egale-badge--live { background: var(--egale-accent-dim); color: var(--egale-accent); }

/* Tables */
.egale-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.egale-table th, .egale-table td { padding: 10px; border-bottom: 1px solid var(--egale-border); text-align: start; }
.egale-table th { font-size: 12px; color: var(--egale-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Mobile bottom nav */
.egale-mobile-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0; z-index: 100;
  min-height: calc(var(--egale-nav-h) + var(--egale-safe));
  padding: 4px 6px var(--egale-safe);
  display: flex; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--egale-elev) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--egale-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
}
.egale-nav-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--egale-muted);
  font-size: 9px; font-weight: 600; padding: 4px; border-radius: 10px;
  transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.egale-nav-ico { font-size: 1.25rem; line-height: 1; }
.egale-nav-txt { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.egale-nav-item.is-active { color: var(--egale-accent); background: var(--egale-accent-dim); transform: scale(1.04); }
.egale-nav-item.is-active .egale-nav-ico { filter: drop-shadow(0 1px 2px var(--egale-glow)); }
@media (min-width: 900px) {
  .egale-mobile-nav { max-width: 1200px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; margin-bottom: 0; }
}
.egale-mobile-nav--7 .egale-nav-txt { font-size: 7px; letter-spacing: -0.02em; }
.egale-mobile-nav--7 { padding-left: 2px; padding-right: 2px; }
.egale-mobile-nav--7 .egale-nav-ico { font-size: 1.12rem; }
.egale-mobile-nav--8 .egale-nav-txt { font-size: 6.5px; letter-spacing: -0.04em; }
.egale-mobile-nav--8 { padding-left: 0; padding-right: 0; }
.egale-mobile-nav--8 .egale-nav-ico { font-size: 1.05rem; }

.egale-footer-legal { padding: 20px 16px 0; text-align: center; font-size: 12px; color: var(--egale-muted); }
.egale-body.has-mobile-nav .egale-footer-legal { padding-bottom: 8px; }
.egale-copy { margin: 0; }

/* Page enter animation */
.egale-main[data-page] { animation: egale-fade 0.35s ease; }
@keyframes egale-fade { from { opacity: 0.45; transform: translateY(6px); } to { opacity: 1; transform: none; } }

[dir="rtl"] .egale-ticker { direction: ltr; text-align: left; }

h2.egale-h2 { font-family: var(--egale-display); font-size: 1.3rem; margin: 0 0 12px; }
h3.egale-h3 { font-family: var(--egale-display); font-size: 1.05rem; margin: 20px 0 8px; }
.egale-muted { color: var(--egale-muted); font-size: 0.95rem; }

/* Book page: day schedule grid */
.egale-book-schedule { margin-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--egale-border); }
.egale-sch-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0 12px; }
.egale-sch-toolbar--wrap { align-items: flex-start; }
.egale-sch-dateblock { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; min-width: 0; }
.egale-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.egale-date-row .egale-input[type="date"] { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.egale-date-quickgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.egale-date-quickgroup .egale-btn { padding: 6px 10px; font-size: 13px; }
.egale-sch-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.egale-sch-table { border-collapse: collapse; font-size: 12px; min-width: 100%; background: var(--egale-elev); border-radius: 10px; overflow: hidden; }
.egale-sch-table th,
.egale-sch-table td { border: 1px solid var(--egale-border); padding: 6px 4px; text-align: center; white-space: nowrap; }
.egale-sch-table thead th { background: var(--egale-bg); font-weight: 600; color: var(--egale-muted); }
.egale-sch-table tbody th { text-align: start; padding-inline: 8px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.egale-sch-free { background: transparent; color: var(--egale-muted); }
.egale-sch-busy { background: color-mix(in srgb, var(--egale-accent) 22%, transparent); color: var(--egale-text); font-weight: 600; }
.egale-sch-pending { background: color-mix(in srgb, #c9a227 28%, transparent); color: var(--egale-text); font-weight: 600; }
.egale-sch-highlight { box-shadow: inset 0 0 0 2px var(--egale-accent, #e91e8c); }
.egale-sch-legend { list-style: none; padding: 10px 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px 20px; font-size: 13px; color: var(--egale-muted); }
.egale-sch-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-inline-end: 6px; border: 1px solid var(--egale-border); }
.egale-sch-legend .egale-sch-busy { border: none; width: 16px; height: 16px; }
.egale-sch-legend .egale-sch-pending { border: none; width: 16px; height: 16px; }
.egale-sch-legend .egale-sch-free { background: transparent; border: 1px dashed var(--egale-border); }

/* Notification dot */
.egale-notif-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--egale-accent); vertical-align: super; }

.egale-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 8px 10px 10px;
}
.egale-notif-item__link {
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding-inline-end: 2px;
}
.egale-notif-item__link:hover .egale-prose,
.egale-notif-item__link:hover strong { color: var(--egale-accent); }
.egale-notif-item__dismiss {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
.egale-notif-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-height: 2rem;
  border: 1px solid var(--egale-border);
  background: var(--egale-elev);
  color: var(--egale-muted);
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0 0 2px 0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.egale-notif-dismiss:hover { background: var(--egale-surface); color: var(--egale-accent); border-color: var(--egale-accent); }
.egale-row-space { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.egale-split { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 768px) { .egale-split { flex-direction: row; } }
.egale-prose { color: var(--egale-muted); }
.egale-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.egale-staff-card { padding: 16px; background: var(--egale-elev); border: 1px solid var(--egale-border); border-radius: var(--egale-radius); }
.egale-avatar { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; background: var(--egale-surface); }

.egale-mobile-nav--admin .egale-nav-txt { font-size: 8px; }

.egale-admin-topbar { flex-wrap: wrap; gap: 6px; }
.egale-admin-pill { margin-inline: auto; }

.admin-grid { display: grid; grid-template-columns: 220px 1fr; min-height: 100dvh; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-side { background: var(--egale-elev); border-right: 1px solid var(--egale-border); padding: 16px; }
.admin-side a { display: block; padding: 8px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 14px; }
.admin-side a.is-active, .admin-side a:hover { background: var(--egale-accent-dim); color: var(--egale-accent); }
.admin-main { padding: 20px; max-width: 1100px; }

/* موبايل: قائمة الأدمن + المتجر في صف أفقي علوي قابل للتمرير */
@media (max-width: 800px) {
  .egale-admin-topbar.egale-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .egale-admin-topbar .egale-admin-pill { order: 3; width: 100%; text-align: center; margin: 0; }
  .admin-side {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px 8px 12px;
    margin: 0;
    border-right: none;
    border-bottom: 1px solid var(--egale-border);
    position: sticky;
    top: var(--egale-topbar-h, 52px);
    z-index: 45;
    max-width: 100%;
    scrollbar-width: thin;
  }
  .egale-admin-topbar .egale-brand[href$="index.php"] {
    display: none; /* “← المتجر” يظهر في شريط القائمة */
  }
  /* Grid: القائمة أعلى، المحتوى تحت */
  .admin-side a.admin-nav {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
  }
  .admin-side a.admin-side__back {
    border: 1px solid var(--egale-border);
    background: var(--egale-surface);
  }
  .admin-side a.is-active { box-shadow: inset 0 0 0 1px var(--egale-accent); }
  .admin-grid { align-content: start; }
}
@media (min-width: 801px) {
  .admin-side a.admin-side__back { margin-top: 16px; }
}
