/* ==========================================================================
   Jeddah Drain (جدة درين) — High-Conversion RTL Mobile-First Design System
   Optimized for Core Web Vitals (Zero CLS, Fast LCP, WCAG AA/AAA Contrast)
   ========================================================================== */

:root {
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-dark: #0B2545;
  --bg-dark-2: #13315C;
  --text-main: #0F172A;
  --text-muted: #334155;
  --text-light: #F8FAFC;
  --primary: #0B4F6C;
  --primary-hover: #083B52;
  --accent-call: #0284C7;
  --accent-call-hover: #0369A1;
  --accent-wa: #15803D;
  --accent-wa-hover: #166534;
  --border-color: #CBD5E1;
  --border-focus: #0284C7;
  --badge-bg: #E0F2FE;
  --badge-text: #075985;
  --warning-bg: #FEF3C7;
  --warning-text: #92400E;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --max-w: 1180px;
}

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

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  right: 16px;
  background: var(--bg-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: 12px;
}

/* ==========================================================================
   Section A — Compact Header
   ========================================================================== */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 10px;
  padding: 6px 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--bg-dark);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-dark);
  color: #38BDF8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 16px;
}

@media (min-width: 960px) {
  .header-nav {
    display: flex;
  }
}

.header-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 6px;
}

.header-nav a:hover, .header-nav a[aria-current="page"] {
  color: var(--bg-dark);
  background: var(--bg-subtle);
}

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

.header-phone-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-call);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.header-phone-btn:hover {
  background: var(--accent-call-hover);
}

/* Mobile Services Dropdown in Header */
.mobile-menu {
  position: relative;
}
.mobile-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--bg-dark);
}
.mobile-menu summary::-webkit-details-marker {
  display: none;
}
.mobile-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: min(300px, 88vw);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 10px;
  z-index: 200;
  display: grid;
  gap: 4px;
}
.mobile-menu-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.mobile-menu-panel a:hover {
  background: var(--bg-subtle);
}

@media (min-width: 960px) {
  .mobile-menu {
    display: none;
  }
}

/* ==========================================================================
   Section B — Above the Fold (Hero)
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
  color: var(--text-light);
  padding: 24px 0 32px;
  border-bottom: 4px solid #0284C7;
}

.breadcrumb-nav {
  font-size: 0.82rem;
  color: #CBD5E1;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.breadcrumb-nav a {
  color: #93C5FD;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-section {
    padding: 40px 0 48px;
  }
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
  }
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.16);
  color: #E0F2FE;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.hero-h1 {
  font-size: clamp(1.65rem, 4.5vw, 2.45rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #FFFFFF;
}

.hero-subtitle {
  font-size: 1.02rem;
  color: #E2E8F0;
  margin-bottom: 20px;
  max-width: 64ch;
}

.hero-cta-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 520px) {
  .hero-cta-group {
    grid-template-columns: 1fr 1fr;
  }
}

.btn-primary-call, .btn-primary-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  font-weight: 800;
  text-align: center;
  transition: background-color 0.15s ease;
}

.btn-primary-call {
  background: #0284C7;
  color: #FFFFFF;
  border: 2px solid #38BDF8;
}

.btn-primary-call:hover {
  background: #0369A1;
}

.btn-primary-wa {
  background: #15803D;
  color: #FFFFFF;
  border: 2px solid #4ADE80;
}

.btn-primary-wa:hover {
  background: #166534;
}

.hero-quick-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.88rem;
  color: #CBD5E1;
  list-style: none;
}

.hero-quick-points li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-visual-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 10px;
}

.hero-visual-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 360;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Generic Sections & Typography
   ========================================================================== */
.section-block {
  padding: 40px 0;
}

.section-block.bg-alt {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  margin-bottom: 24px;
}

.section-h2 {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 8px;
  line-height: 1.35;
}

.section-lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 72ch;
}

/* ==========================================================================
   Section C — Problem Recognition Cards
   ========================================================================== */
.cards-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .cards-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.problem-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-right: 5px solid var(--accent-call);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.problem-card h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 6px;
}

.problem-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Section D & E — Service Solution & Trust/Transparency
   ========================================================================== */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 860px) {
  .two-col-layout {
    grid-template-columns: 1.3fr 0.7fr;
  }
}

.solution-box, .trust-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.trust-box {
  background: #F0F9FF;
  border-color: #BAE6FD;
}

.check-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.check-list li {
  position: relative;
  padding-right: 28px;
  font-size: 0.96rem;
  color: var(--text-main);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  right: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-call);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Section F — How It Works (Clean Step Badges — Fixes 1. 1 Duplicate Bug)
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-dark);
  color: #38BDF8;
  font-weight: 800;
  font-size: 1rem;
}

.step-card h3 {
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--bg-dark);
}

.step-card p {
  font-size: 0.94rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Section G — Pricing Transparency & Optional Quick WhatsApp Helper
   ========================================================================== */
.pricing-wa-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 860px) {
  .pricing-wa-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pricing-card, .wa-helper-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.wa-helper-card {
  border-top: 4px solid var(--accent-wa);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--bg-dark);
}

.form-control {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--text-main);
  background: #FFFFFF;
}

textarea.form-control {
  min-height: 82px;
  resize: vertical;
}

.form-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}

.btn-submit-wa {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-wa);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit-wa:hover {
  background: var(--accent-wa-hover);
}

/* ==========================================================================
   Section H — Service Area (Jeddah Neighborhoods)
   ========================================================================== */
.neighborhood-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  list-style: none;
}

.neighborhood-pills li {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--bg-dark);
}

/* ==========================================================================
   Section I — FAQ (Accessible Details/Summary)
   ========================================================================== */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 18px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--bg-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-call);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 18px 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-top: 1px solid var(--bg-subtle);
  padding-top: 12px;
}

/* ==========================================================================
   Section J — Final CTA Banner
   ========================================================================== */
.final-cta-banner {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.final-cta-banner h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  margin-bottom: 10px;
}

.final-cta-banner p {
  color: #E2E8F0;
  max-width: 60ch;
  margin: 0 auto 20px;
}

.final-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   Section K — Related Services (2-4 Focused Cards) & Homepage Directory
   ========================================================================== */
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 680px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.related-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-card:hover {
  border-color: var(--accent-call);
  transform: translateY(-2px);
}

.related-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 6px;
}

.related-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.related-link-text {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-call);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background: #0F172A;
  color: #CBD5E1;
  padding: 40px 0 32px;
  margin-top: 24px;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.footer-title {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: #CBD5E1;
  display: inline-block;
  padding: 2px 0;
}

.footer-links a:hover {
  color: #38BDF8;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: #94A3B8;
}

/* ==========================================================================
   Sticky Bottom Mobile CTA Bar (Safe Area Aware, >=48px Touch Targets)
   ========================================================================== */
.sticky-mobile-bar {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  z-index: 999;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.1);
}

@media (min-width: 900px) {
  .sticky-mobile-bar {
    display: none;
  }
}

.sticky-btn-call, .sticky-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.95rem;
  color: #FFFFFF;
  text-align: center;
}

.sticky-btn-call {
  background: var(--accent-call);
}

.sticky-btn-wa {
  background: var(--accent-wa);
}


/* ==========================================================================
   V2 Mobile Above-the-Fold CRO & Responsive Image Enhancements
   Ensures H1, City, Problem/Solution, Call CTA, WhatsApp CTA, and Hero Photo
   are all visible in the first mobile viewport (320px - 414px)
   ========================================================================== */
.hero-visual-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 6px;
  overflow: hidden;
}

.hero-visual-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.hero-visual-caption {
  font-size: 0.76rem;
  color: #CBD5E1;
  text-align: center;
  margin-top: 5px;
  line-height: 1.35;
}

@media (max-width: 859px) {
  .header-inner {
    min-height: 52px;
    padding: 4px 0;
  }
  .brand-logo {
    font-size: 1.02rem;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .header-phone-btn, .mobile-menu summary {
    min-height: 44px;
    padding: 6px 10px;
    font-size: 0.84rem;
  }
  .hero-section {
    padding: 12px 0 18px;
  }
  .breadcrumb-nav {
    font-size: 0.76rem;
    margin-bottom: 6px;
  }
  .hero-badges {
    gap: 6px;
    margin-bottom: 6px;
  }
  .badge-pill {
    padding: 3px 9px;
    font-size: 0.75rem;
  }
  .hero-h1 {
    font-size: clamp(1.38rem, 5vw, 1.75rem);
    margin-bottom: 6px;
    line-height: 1.25;
  }
  .hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.48;
    margin-bottom: 10px;
  }
  .hero-cta-group {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .btn-primary-call, .btn-primary-wa {
    min-height: 46px;
    padding: 8px 8px;
    font-size: 0.84rem;
    gap: 5px;
    border-radius: var(--radius-sm);
  }
  .btn-primary-call svg, .btn-primary-wa svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  .hero-grid {
    gap: 10px;
  }
  .hero-quick-points {
    font-size: 0.78rem;
    gap: 6px 12px;
    margin-top: 4px;
  }
}

@media (max-width: 359px) {
  .hero-cta-group {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .btn-primary-call, .btn-primary-wa {
    min-height: 44px;
    font-size: 0.86rem;
  }
}


@media (max-width: 899px) {
  body {
    padding-bottom: 0;
  }
  .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}
