/* ===== Chaabi Cash & Tasshilat Aarab — Martil ===== */

:root {
  --orange: #F58220;
  --orange-dark: #D96A0F;
  --orange-light: #FFE7CE;
  --blue: #1e40af;
  --blue-dark: #15317f;
  --blue-light: #E6ECFB;
  --black: #111111;
  --white: #FFFFFF;
  --gray-50: #F7F7F8;
  --gray-200: #E6E6E8;
  --gray-500: #7A7A80;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(17,17,17,0.08);
  --shadow-hover: 0 14px 32px rgba(245,130,32,0.18);
  --font: 'Cairo', 'Tajawal', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Skip link (a11y) ===== */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  background: var(--black);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 999;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ===== Focus visibility ===== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ===== Warning banner (persistent) ===== */
.warning-banner {
  background: var(--black);
  color: var(--white);
  font-size: 0.92rem;
  padding: 10px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.warning-banner.rush {
  background: var(--orange);
  color: var(--black);
  font-weight: 700;
}
.warning-banner .icon { font-size: 1.1rem; }
.warning-banner button.close-banner {
  color: inherit;
  opacity: 0.7;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
}
.warning-banner button.close-banner:hover { opacity: 1; }

/* ===== Header ===== */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--black);
}
.logo .mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.3rem;
  flex-shrink: 0;
}
.logo small {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gray-500);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
nav.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--black);
  transition: background .15s, color .15s;
}
nav.main-nav a:hover { background: var(--orange-light); color: var(--orange-dark); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch button {
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-500);
}
.lang-switch button.active { background: var(--blue); color: var(--white); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn-orange { background: var(--orange); color: var(--white); }
.btn-orange:hover { background: var(--orange-dark); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 2px solid var(--black); color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

.menu-toggle {
  display: none;
  font-size: 1.6rem;
  color: var(--black);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--black) 0%, #1c1c1c 60%, var(--orange-dark) 140%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,130,32,0.35), transparent 70%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 64px 24px 56px;
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(245,130,32,0.18);
  color: var(--orange);
  border: 1px solid rgba(245,130,32,0.4);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--orange); }
.hero p.lead {
  color: #D9D9DC;
  font-size: 1.05rem;
  margin-bottom: 26px;
  max-width: 46ch;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #C9C9CD;
}
.hero-meta div { display: flex; align-items: center; gap: 8px; }
.hero-meta strong { color: var(--white); }

.hero-card {
  background: var(--white);
  color: var(--black);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.hero-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.hero-card p.small { color: var(--gray-500); font-size: 0.85rem; margin-bottom: 16px; }
.hero-card .row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--gray-200); }
.hero-card .row:first-of-type { border-top: none; }
.hero-card .row .ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--orange-light); color: var(--orange-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}
.hero-card .row .txt strong { display: block; font-size: 0.9rem; }
.hero-card .row .txt span { font-size: 0.82rem; color: var(--gray-500); }

/* ===== Section shell ===== */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.eyebrow {
  display: inline-block;
  color: var(--blue);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--gray-500); }

.bg-tint { background: var(--gray-50); }

/* ===== Services ===== */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}
.category-tabs button {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--white);
  transition: all .15s;
}
.category-tabs button:hover { border-color: var(--orange); color: var(--orange-dark); }
.category-tabs button.active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--orange); }
.service-card .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--orange-light); color: var(--orange-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.service-card h4 { font-size: 1.02rem; margin-bottom: 6px; }
.service-card p { font-size: 0.87rem; color: var(--gray-500); }
.service-card .tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 10px;
  border-radius: 999px;
}
.services-note {
  text-align: center;
  margin-top: 30px;
  font-size: 0.85rem;
  color: var(--gray-500);
  font-style: italic;
}

/* ===== Branches ===== */
.branches-layout {
  display: block;
}
.branches-map-wrap {
  margin-bottom: 24px;
}
#branchesMap {
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  z-index: 1;
}
.map-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 8px;
  text-align: center;
}
@media (max-width: 560px) {
  #branchesMap { height: 280px; }
}
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.branch-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  gap: 14px;
}
.branch-card.main { border: 2px solid var(--orange); background: var(--orange-light); }
.branch-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
.branch-card.clickable { cursor: pointer; }
.branch-card .pin {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.05rem;
}
.branch-card.main .pin { background: var(--orange); }
.branch-card h4 { font-size: 0.98rem; margin-bottom: 4px; }
.branch-card p { font-size: 0.85rem; color: var(--gray-500); }
.branch-card .badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--orange-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.branch-card .map-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}
.branch-card .map-link:hover { text-decoration: underline; }
.branch-card .pending-note {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--gray-500);
  font-style: italic;
}
@media (max-width: 560px) {
}

/* ===== Contact strip ===== */
.contact-strip {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 60px;
}
.contact-strip .item { display: flex; gap: 14px; align-items: flex-start; }
.contact-strip .item .ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(245,130,32,0.2); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-strip .item strong { display: block; margin-bottom: 3px; font-size: 0.92rem; }
.contact-strip .item span, .contact-strip .item a { font-size: 0.85rem; color: #C9C9CD; }
.contact-strip .item a:hover { color: var(--orange); }

/* ===== Footer ===== */
footer.site-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 40px 0 24px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.footer-inner .logo { font-size: 1rem; }

/* ===== Chatbot widget ===== */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(245,130,32,0.4);
  z-index: 70;
  transition: transform .15s;
}
.chat-toggle:hover { transform: scale(1.06); }

.chat-window {
  position: fixed;
  bottom: 98px;
  inset-inline-end: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 70;
}
.chat-window.open { display: flex; }
.chat-header {
  background: var(--blue);
  color: var(--white);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header .mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.chat-header div strong { display: block; font-size: 0.92rem; }
.chat-header div span { font-size: 0.75rem; opacity: 0.85; }
.chat-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-line;
}
.chat-bubble.bot { background: var(--white); border: 1px solid var(--gray-200); align-self: flex-start; }
.chat-bubble.user { background: var(--blue); color: var(--white); align-self: flex-end; }
.chat-questions {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--white);
}
.chat-questions button {
  text-align: start;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--black);
  transition: all .15s;
}
.chat-questions button:hover { border-color: var(--orange); background: var(--orange-light); }
.chat-footnote {
  padding: 10px 16px;
  font-size: 0.72rem;
  color: var(--gray-500);
  text-align: center;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
}

/* ===== RTL adjustments ===== */
[dir="rtl"] .hero-eyebrow,
[dir="rtl"] .service-card .tag { direction: rtl; }
[dir="rtl"] .chat-questions button { text-align: right; }

/* Keep phone numbers, emails and time ranges from visually reversing in RTL text */
a[href^="tel:"], a[href^="mailto:"], .bidi-safe {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  nav.main-nav { display: none; }
  .menu-toggle { display: block; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-card { order: -1; }
}
@media (max-width: 560px) {
  .header-inner { padding: 10px 14px; gap: 8px; }
  .logo { font-size: 1.02rem; gap: 7px; }
  .logo .mark { width: 32px; height: 32px; font-size: 1.05rem; }
  .logo small { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn.btn-orange.btn-sm { display: none; }
  .lang-switch button { padding: 6px 9px; font-size: 0.75rem; }
  section { padding: 40px 0; }
  .container { padding: 0 16px; }
  .chat-window { inset-inline-end: 16px; width: calc(100vw - 32px); }
  .chat-toggle { inset-inline-end: 16px; bottom: 16px; width: 52px; height: 52px; font-size: 1.3rem; }
  .contact-strip { padding: 26px; }

  /* Warning banner: smaller and tighter on mobile */
  .warning-banner { padding: 7px 12px; font-size: 0.76rem; gap: 6px; line-height: 1.3; }
  .warning-banner .icon { font-size: 0.9rem; }
  .warning-banner button.close-banner { font-size: 0.95rem; padding: 0 4px; }

  /* Service cards: tighter spacing on mobile */
  .services-grid { gap: 12px; }

  /* Reserve space so the floating chat button never covers footer content */
  footer.site-footer { padding-bottom: 90px; }
}

