:root {
  --bg: #0a0a0a;
  --panel: #ffffff;
  --ink: #ffffff;
  --ink-dark: #0a0a0a;
  --muted: #b5b5b5;
  --muted-dark: #5a5a5a;
  --line: rgba(255, 255, 255, 0.12);
  --line-dark: rgba(0, 0, 0, 0.1);
  --radius: 14px;
  --checker: 8px;
  --maxw: 1280px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Cairo", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- header ---------- */
.site-header {
  background: #000;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px clamp(14px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: invert(1) contrast(1.08);
  mix-blend-mode: screen;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: "Bebas Neue", "Cairo", sans-serif;
  font-size: 22px;
  letter-spacing: 0.16em;
  direction: ltr;
}
.brand-tag {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--ink-dark);
  border-color: var(--ink);
  transform: translateY(-1px);
}
.btn-ghost svg { width: 16px; height: 16px; }
.header-checker {
  height: 6px;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: var(--checker) var(--checker);
  background-position: 0 0, 0 calc(var(--checker) / 2), calc(var(--checker) / 2) calc(var(--checker) / -2), calc(var(--checker) / -2) 0;
  opacity: 0.7;
}

/* ---------- layout ---------- */
.layout {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px clamp(14px, 3vw, 28px);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  min-height: 0;
}
.map-card, .branches-card {
  background: var(--panel);
  color: var(--ink-dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border: 1px solid var(--line-dark);
}
.map-card {
  height: calc(100vh - 200px);
  min-height: 480px;
  position: relative;
}
#map {
  width: 100%;
  height: 100%;
}

/* ---------- branches ---------- */
.branches-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 480px;
}
.branches-head {
  background: #000;
  color: var(--ink);
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.branches-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: 4px 4px;
  background-position: 0 0, 0 2px, 2px -2px, -2px 0;
  opacity: 0.55;
}
.branches-head h2 {
  margin: 0;
  font-family: "Bebas Neue", "Cairo", sans-serif;
  font-size: 24px;
  letter-spacing: 0.1em;
}
.branches-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.branches-ul {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.branches-ul li {
  position: relative;
  background: #f6f6f7;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  min-height: 52px;
  transition: background .15s ease, transform .15s ease;
}
.branches-ul li:last-child { margin-bottom: 0; }
.branches-ul li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 5px 5px;
  background-position: 0 0, 0 2.5px, 2.5px -2.5px, -2.5px 0;
  pointer-events: none;
  z-index: 1;
}
.branches-ul li:hover,
.branches-ul li:active {
  background: #0a0a0a;
  transform: translateY(-1px);
}
.branches-ul li:hover::before,
.branches-ul li:active::before {
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
}
.branches-ul li button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 22px 12px 14px;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: #0a0a0a !important;
  text-align: right;
  cursor: pointer;
  transition: color .15s ease;
}
.branches-ul li:hover button,
.branches-ul li:active button { color: #fff !important; }
.branches-ul li button::after {
  content: "←";
  font-size: 18px;
  line-height: 1;
  opacity: 0.5;
  transition: transform .15s ease, opacity .15s ease;
  flex-shrink: 0;
}
.branches-ul li:hover button::after,
.branches-ul li:active button::after { transform: translateX(-4px); opacity: 1; }

/* custom scrollbar */
.branches-ul::-webkit-scrollbar { width: 6px; }
.branches-ul::-webkit-scrollbar-track { background: transparent; }
.branches-ul::-webkit-scrollbar-thumb { background: #0a0a0a; border-radius: 3px; }

/* ---------- leaflet overrides ---------- */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 4px 4px 4px 4px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  background: #fff;
  color: #0a0a0a;
}
.leaflet-popup-content {
  font-family: "Cairo", sans-serif;
  margin: 12px 14px;
  line-height: 1.55;
}
.leaflet-popup-content b {
  font-family: "Bebas Neue", "Cairo", sans-serif;
  letter-spacing: 0.08em;
  font-size: 18px !important;
}
.leaflet-popup-content a {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 14px;
  background: #0a0a0a;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}
.leaflet-popup-content a:hover { background: #333; }
.leaflet-popup-tip { background: #fff; }

/* ---------- footer ---------- */
.site-foot {
  background: #000;
  color: var(--muted);
  text-align: center;
  padding: 18px 16px 22px;
  border-top: 1px solid var(--line);
}
.foot-checker {
  width: 80px;
  height: 6px;
  margin: 0 auto 12px;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: 6px 6px;
  background-position: 0 0, 0 3px, 3px -3px, -3px 0;
  opacity: 0.55;
}
.site-foot small {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-foot a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.site-foot a:hover { border-color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .map-card { height: 55vh; min-height: 360px; }
  .branches-card { height: auto; min-height: 0; max-height: none; }
  .branches-ul { overflow-y: visible; flex: 0 1 auto; }
}
@media (max-width: 520px) {
  .header-inner { gap: 8px; }
  .brand-logo { width: 42px; height: 42px; }
  .brand-name { font-size: 18px; }
  .brand-tag { font-size: 11px; }
  .btn-ghost span { display: none; }
  .btn-ghost { padding: 8px; }
}
