/* ============================================================
   SPCO Logistics — Site Chrome (v2)
   Header · Topbar · Footer · Page-Hero · Section helpers
   ============================================================ */

/* ============================================================
   ACCESSIBILITY — skip link
   ============================================================ */
.skip-link {
  position: absolute;
  inset-inline-start: var(--sp-4);
  top: -40px;
  padding: 8px 14px;
  background: var(--brand);
  color: #FFFFFF;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 8px; color: #FFFFFF; }

/* ============================================================
   0) BETA BANNER — site-wide preview notice
   Color system: Indigo / Violet (industry-standard "preview" tone,
   intentionally distinct from brand Navy + Gold).
   ============================================================ */
.beta-banner {
  background:
    linear-gradient(180deg, #3730A3 0%, #4F46E5 100%);
  color: #FFFFFF;
  font-size: 13px;
  padding: 10px 0;
  position: relative;
  z-index: 100;
  overflow: hidden;
}
.beta-banner::before {
  /* faint diagonal pattern for premium texture */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 12px
    );
  pointer-events: none;
}
.beta-banner::after {
  /* subtle violet accent hairline at the bottom edge */
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(196, 181, 253, 0.75) 50%,
    transparent 100%);
  pointer-events: none;
}
.beta-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  text-align: center;
}
.beta-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #3730A3;
  background: #FFFFFF;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
html[lang="ar"] .beta-badge {
  font-family: var(--font-arabic);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 800;
  padding: 4px 12px;
}
.beta-message {
  color: rgba(255, 255, 255, 0.94);
  font-family: var(--font-arabic);
  font-weight: 500;
  line-height: 1.5;
}
html[lang="en"] .beta-message {
  font-family: var(--font-display);
}
@media (max-width: 640px) {
  .beta-banner { padding: 9px 0; font-size: 12px; }
  .beta-banner .container { gap: 10px; }
  .beta-message { font-size: 12px; }
}
@media (max-width: 420px) {
  /* On very small screens, hide the long message and keep just the badge */
  .beta-message { display: none; }
  .beta-banner .container::after {
    content: 'النسخة التجريبية قيد التطوير';
    font-family: var(--font-arabic);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.92);
  }
  html[lang="en"] .beta-banner .container::after {
    content: 'Preview build — under development';
    font-family: var(--font-display);
  }
}

/* ============================================================
   1) TOP BAR  — slim utility band
   ============================================================ */
.topbar {
  background: var(--c-bg-light);
  color: var(--c-text-secondary);
  font-size: 12px;
  padding: 8px 0;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
}
.topbar a { color: var(--c-text-secondary); }
.topbar a:hover { color: var(--brand); }

.topbar-left,
.topbar-right { display: flex; align-items: center; gap: var(--sp-5); }

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar-item svg {
  width: 12px;
  height: 12px;
  color: var(--brand-light);
  flex-shrink: 0;
}

/* ============================================================
   2) SITE HEADER — sticky with blur
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
/* Fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .site-header { background: #FFFFFF; }
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
}
.brand img { height: 32px; width: auto; }
.brand-mark {
  height: 38px;
  display: flex;
  align-items: center;
}

/* ---------- Main Nav ---------- */
.nav-main {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.nav-main a {
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-secondary);
  border-radius: var(--r-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  position: relative;
}
html[lang="ar"] .nav-main a { font-family: var(--font-arabic); }
.nav-main a:hover { color: var(--brand-light); }
.nav-main a.active { color: var(--brand); font-weight: 600; }
.nav-main a.active::after {
  content: '';
  position: absolute;
  inset-inline-start: 14px;
  inset-inline-end: 14px;
  bottom: -2px;
  height: 2px;
  background: var(--cta);
  border-radius: var(--r-pill);
}

/* ---------- Header CTAs ---------- */
.header-ctas {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 2px;
  background: #FFFFFF;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 6px 10px;
  color: var(--c-text-secondary);
  cursor: pointer;
  border-radius: var(--r-sm);
  letter-spacing: 0.08em;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lang-switch button:hover { color: var(--brand); }
.lang-switch button.active {
  background: var(--brand);
  color: #FFFFFF;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--c-text-primary);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.mobile-toggle:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ---------- Mobile Nav ---------- */
@media (max-width: 980px) {
  .nav-main {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-4);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    gap: 0;
  }
  .nav-main.open { display: flex; }
  .nav-main a {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-main a:last-child { border-bottom: none; }
  .nav-main a.active::after { display: none; }
  .mobile-toggle { display: inline-flex; }
  .topbar-left .topbar-item.hide-mobile { display: none; }
  .header-ctas .btn-text { display: none; }
}

/* ============================================================
   3) FOOTER — light, professional
   ============================================================ */
.site-footer {
  background: var(--c-bg-light);
  color: var(--c-text-secondary);
  padding: var(--sp-20) 0 var(--sp-6);
  position: relative;
  border-top: 1px solid var(--border);
}
/* subtle brand-gold hairline on top — luxury detail */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--c-brand-gold),
    transparent);
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-12);
}
@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-col h4 {
  color: var(--c-text-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}
html[lang="ar"] .footer-col h4 {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 14px;
}
.footer-col h4::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brand);
  margin-top: 8px;
  border-radius: var(--r-pill);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  color: var(--c-text-secondary);
  font-size: 14px;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-col a:hover { color: var(--brand); }

.footer-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.footer-brand img {
  height: 48px;
  width: auto;
  margin-bottom: 0;
}
.footer-tagline {
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}
html[lang="ar"] .footer-tagline { font-family: var(--font-arabic); }

.footer-addr {
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-text-secondary);
}
.footer-addr strong { color: var(--c-text-primary); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  margin-top: var(--sp-4);
}
.footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text-primary);
  font-weight: 500;
}
.footer-contact a:hover { color: var(--brand); }
.footer-contact svg {
  width: 14px;
  height: 14px;
  color: var(--brand-light);
  flex-shrink: 0;
}

/* ---------- Footer Form ---------- */
.footer-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.footer-form input,
.footer-form select {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--c-text-primary);
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
html[lang="ar"] .footer-form input,
html[lang="ar"] .footer-form select { font-family: var(--font-arabic); }

.footer-form input::placeholder { color: var(--c-text-secondary); opacity: 0.7; }
.footer-form input:focus,
.footer-form select:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}
.footer-form select option {
  background: #FFFFFF;
  color: var(--c-text-primary);
}
.footer-form .btn { margin-top: 4px; }
.footer-form .btn-gold {
  background: var(--brand);
  color: #FFFFFF;
}
.footer-form .btn-gold:hover { background: var(--brand-hover); color: #FFFFFF; }

/* ---------- Footer Bottom ---------- */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--c-text-secondary);
  flex-wrap: wrap;
}
.footer-bottom a { color: var(--c-text-secondary); }
.footer-bottom a:hover { color: var(--brand); }
.footer-bottom-right { display: flex; gap: var(--sp-5); flex-wrap: wrap; }

/* ============================================================
   4) PAGE HERO — inner pages, light
   ============================================================ */
.page-hero {
  background: #FFFFFF;
  color: var(--c-text-primary);
  padding: calc(var(--sp-16) + var(--sp-4)) 0 var(--sp-16);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.08), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(59, 130, 246, 0.06), transparent 55%);
  pointer-events: none;
}
.page-hero::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--c-brand-gold),
    transparent);
  opacity: 0.4;
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }

.page-hero .breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.page-hero .breadcrumb a { color: var(--c-text-secondary); }
.page-hero .breadcrumb a:hover { color: var(--brand); }
.page-hero .breadcrumb .sep { color: var(--border-strong); }

.page-hero h1 {
  color: var(--c-text-primary);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 700;
  max-width: 800px;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}
.page-hero .lede {
  color: var(--c-text-secondary);
  font-size: 18px;
  max-width: 680px;
  line-height: 1.7;
}
.page-hero .eyebrow { color: var(--brand); }
.page-hero .eyebrow::before { background: var(--brand); }

/* ============================================================
   5) SECTION HEADING — shared rhythm
   ============================================================ */
.section-head {
  max-width: 760px;
  margin-bottom: var(--sp-12);
}
.section-head h2 {
  font-size: clamp(28px, 3vw, 40px);
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.section-head p {
  color: var(--c-text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

/* ============================================================
   6) LANGUAGE UTILITIES
   ============================================================ */
html[lang="ar"] .en-only { display: none; }
html[lang="en"] .ar-only { display: none; }
html[dir="rtl"] .nav-main a.active::after {
  inset-inline-start: 14px;
  inset-inline-end: 14px;
}
html[dir="rtl"] .eyebrow::before { margin-left: 0; }
