/**
 * Base & Layout Stylesheet - WordPress Edition
 * English Primary (LTR) with seamless Arabic (RTL) & Google Translate Support
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

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

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

body {
  font-family: var(--font-english);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-body);
  background-color: var(--bg-body);
  direction: ltr;
  text-align: left;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* RTL Support (for Arabic via Google Translate or native Arabic) */
html[lang="ar"],
html[lang="ar"] body,
body.rtl,
[dir="rtl"] {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
}

/* Adjustments for WordPress Admin Bar */
body.admin-bar .site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* Base Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: var(--space-4);
  color: var(--text-body);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-secondary-hover);
}

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-fluid {
  width: 100%;
  padding-inline: var(--space-6);
}

/* Section Header Utility */
.section-header {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  background-color: var(--color-secondary-light);
  color: var(--color-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
  border: 1px solid rgba(0, 152, 234, 0.2);
}

.section-title {
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  position: relative;
}

.section-title span {
  color: var(--color-secondary);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Top Bar */
.site-topbar {
  background-color: var(--color-primary-dark);
  color: var(--text-light);
  font-size: var(--text-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: 8px;
  position: relative;
  z-index: 1001;
}

.site-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.topbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition-fast);
}

.topbar-item:hover {
  color: var(--color-secondary);
}

.topbar-item svg {
  width: 14px;
  height: 14px;
  fill: var(--color-secondary);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 40px;
  padding-block: 6px;
  flex-wrap: wrap;
}

.topbar-badge {
  background: rgba(2, 114, 189, 0.22);
  color: #38bdf8;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  margin-inline-start: auto;
}

/* Custom Sleek Language Switcher */
.alrahma-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lang-switch-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 14px;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.lang-switch-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.lang-switch-btn.active {
  color: #ffffff;
  background: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(0, 152, 234, 0.4);
}

.lang-flag {
  font-size: 13px;
  line-height: 1;
}

.lang-separator {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
}

/* Google Translate Offscreen Container */
#google_translate_element,
.alrahma-google-translate-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide Google Translate top banner frames and tooltip balloons */
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  opacity: 0 !important;
}

body {
  top: 0px !important;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  padding-block: 4px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-6);
}

/* Brand Logo (Logo ONLY - Clean & Scaled) */
.site-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo-img {
  height: 70px;
  width: 70px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(10, 14, 23, 0.12));
  transition: transform var(--transition-fast);
}

.site-brand:hover .site-logo-img {
  transform: scale(1.04);
}

/* Navigation Menu */
.site-nav {
  display: flex;
  align-items: center;
}

.site-nav ul,
.site-nav .nav-list,
.site-nav .menu {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.site-nav li a,
.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 15px;
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}

.site-nav li a:hover,
.site-nav .nav-link:hover {
  color: var(--color-secondary);
  background-color: var(--color-secondary-light);
}

.site-nav li.current-menu-item > a,
.site-nav li.current_page_item > a,
.site-nav .nav-link.active {
  color: var(--color-secondary);
  background-color: var(--color-secondary-light);
  font-weight: 700;
}

.site-nav li.current-menu-item > a::after,
.site-nav li.current_page_item > a::after,
.site-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background-color: var(--color-secondary);
  border-radius: 2px;
}

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

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-primary);
}

.mobile-nav-toggle svg {
  width: 26px;
  height: 26px;
}

/* Footer */
.site-footer {
  background-color: var(--color-primary-dark);
  color: var(--text-light);
  padding-top: var(--space-16);
  border-top: 4px solid var(--color-secondary);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.6fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-logo {
  height: 58px;
  width: auto;
  object-fit: contain;
}

.footer-col-title {
  color: var(--text-white);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-5);
  position: relative;
  padding-bottom: var(--space-2);
}

.footer-col-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 36px;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 2px;
}

.footer-about p {
  color: #94a3b8;
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.footer-legal-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: #cbd5e1;
  margin-top: var(--space-2);
}

.footer-links li {
  margin-bottom: var(--space-3);
}

.footer-links a {
  color: #94a3b8;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-secondary);
  transform: translateX(4px);
}

[dir="rtl"] .footer-links a:hover,
body.rtl .footer-links a:hover {
  transform: translateX(-4px);
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: #cbd5e1;
}

.footer-contact-list svg {
  width: 18px;
  height: 18px;
  fill: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: var(--space-6);
  font-size: var(--text-xs);
  color: #64748b;
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Floating WhatsApp Button */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  z-index: 990;
  width: 58px;
  height: 58px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.floating-whatsapp.pos-left,
html[dir="rtl"] .floating-whatsapp.pos-left,
body.rtl .floating-whatsapp.pos-left {
  left: 24px !important;
  right: auto !important;
}

.floating-whatsapp.pos-right,
html[dir="rtl"] .floating-whatsapp.pos-right,
body.rtl .floating-whatsapp.pos-right {
  right: 24px !important;
  left: auto !important;
}

.footer-logo-img {
  max-height: 78px;
  height: 78px;
  width: 78px;
  background: #ffffff;
  padding: 3px;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(2, 114, 189, 0.35);
  border: 2px solid var(--color-secondary);
  object-fit: contain;
  display: block;
}

.floating-whatsapp:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6);
  color: #fff;
}

.floating-whatsapp svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

/* Back to Top Button (Always on the opposite side of Floating WhatsApp) */
.back-to-top,
html[dir="rtl"] .back-to-top,
body.rtl .back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px !important;
  right: auto !important;
  z-index: 990;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  border: 2px solid rgba(2, 114, 189, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

/* If WhatsApp is placed on the left, place Back-to-Top on the right */
.floating-whatsapp.pos-left ~ .back-to-top,
html[dir="rtl"] .floating-whatsapp.pos-left ~ .back-to-top,
body.rtl .floating-whatsapp.pos-left ~ .back-to-top {
  left: auto !important;
  right: 24px !important;
}

.back-to-top.show,
html[dir="rtl"] .back-to-top.show,
body.rtl .back-to-top.show {
  opacity: 1 !important;
  visibility: visible !important;
}

.back-to-top:hover {
  background: var(--color-secondary);
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Mobile Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  inset-inline-end: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #ffffff;
  z-index: 1100;
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: inset-inline-end var(--transition-normal), visibility var(--transition-normal);
  overflow-y: auto;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav-drawer.active {
  inset-inline-end: 0;
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
}

.drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  padding: 4px;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.drawer-links a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.drawer-links a:hover, .drawer-links a.active {
  background-color: var(--color-secondary-light);
  color: var(--color-secondary);
}

.mobile-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 34, 64, 0.5);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .header-actions .btn-quote {
    display: none;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  .site-topbar {
    padding-block: 6px;
  }
  .site-topbar .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .topbar-info {
    flex: 1;
    min-width: 0;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  /* Keep only the primary phone in topbar on mobile to maintain clean 38px height */
  .topbar-location-item,
  .site-topbar .topbar-item[href^="mailto"],
  .topbar-badge {
    display: none !important;
  }
  .site-topbar .topbar-item {
    font-size: 11.5px;
    white-space: nowrap;
  }
  .topbar-actions {
    flex-shrink: 0;
    margin-inline-start: auto;
  }
  .alrahma-lang-switcher {
    padding: 3px 6px;
    gap: 4px;
  }
  .alrahma-lang-switcher .lang-switch-btn {
    padding: 3px 6px;
    font-size: 11px;
  }
  .floating-whatsapp {
    bottom: 20px;
    width: 50px;
    height: 50px;
  }
  .floating-whatsapp.pos-right,
  html[dir="rtl"] .floating-whatsapp.pos-right,
  body.rtl .floating-whatsapp.pos-right {
    right: 18px !important;
    left: auto !important;
  }
  .floating-whatsapp.pos-left,
  html[dir="rtl"] .floating-whatsapp.pos-left,
  body.rtl .floating-whatsapp.pos-left {
    left: 18px !important;
    right: auto !important;
  }
  .back-to-top,
  html[dir="rtl"] .back-to-top,
  body.rtl .back-to-top {
    bottom: 20px;
    left: 18px !important;
    right: auto !important;
    width: 44px;
    height: 44px;
  }
  .floating-whatsapp.pos-left ~ .back-to-top,
  html[dir="rtl"] .floating-whatsapp.pos-left ~ .back-to-top,
  body.rtl .floating-whatsapp.pos-left ~ .back-to-top {
    left: auto !important;
    right: 18px !important;
  }
}
