/* ========================================
   FOOTER STYLES
   Mobile-first, 5-column grid on desktop
   ======================================== */

/* ----------------------------------------
   Footer Base
   ---------------------------------------- */
.uae-footer {
  background-color: #2A303B;
}

.footer-inner {
  max-width: 1170px;
  margin: 0 auto;
  padding: 64px 20px 48px;
}

/* ----------------------------------------
   Footer Grid
   Mobile: stacked columns
   Desktop: 5 columns with specified widths
   ---------------------------------------- */
.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ----------------------------------------
   Footer Columns
   ---------------------------------------- */
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Column Titles */
.footer-col-title {
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

/* ----------------------------------------
   Brand Column
   ---------------------------------------- */
.footer-col--brand {
  gap: 24px;
}

.footer-logo {
  display: inline-block;
}

.footer-logo-img {
  width: 143px;
  height: 143px;
}

/* App Badges */
.footer-app-badges {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.footer-app-badge {
  display: block;
  width: 100%;
  transition: opacity 0.2s ease;
}

.footer-app-badge img {
  width: 100%;
  height: auto;
  max-width: 172px;
}

.footer-app-badge:hover {
  opacity: 0.8;
}

/* Brand Tagline */
.footer-brand-tagline {
  display: none;
}

/* Social Icons */
.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.footer-social-link:hover {
  opacity: 0.7;
}

.footer-social-link img {
  display: block;
}

/* ----------------------------------------
   Link Columns (Company, Modules, Resources)
   ---------------------------------------- */
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links-static {
  margin-top: 0;
}

.footer-nav-link {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-nav-link:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.05);
}

/* ----------------------------------------
   Contact Column
   ---------------------------------------- */
.footer-col--contact {
  gap: 24px;
}

.footer-contact-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact-item {
  display: block;
}

.footer-contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.footer-contact-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.footer-contact-link:hover .footer-contact-value {
  color: #FFFFFF;
}

/* Country: Flag + Name container */
.footer-contact-country {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.footer-contact-flag {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.footer-contact-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  margin: 0;
}

/* Mail icon */
.footer-contact-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.8;
}

.footer-contact-value {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  text-align: end;
  transition: color 0.2s ease;
}

/* Badges (SOC + Great Place to Work) */
.footer-badge {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.footer-badge-link {
  display: block;
  transition: opacity 0.2s ease;
}

.footer-badge-link:hover {
  opacity: 0.8;
}

.footer-badge-img {
  height: auto;
}

/* ----------------------------------------
   Bottom Bar
   ---------------------------------------- */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-inner {
  max-width: 1170px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Mobile: Stack locale controls */
.footer-locale {
  order: -1;
}

.footer-copyright-text {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  text-align: center;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-legal-link {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.footer-legal-link:hover {
  color: #FFFFFF;
}


/* ========================================
   TABLET (768px+)
   2-column layout for link sections
   ======================================== */
@media (min-width: 768px) {
  .footer-inner {
    padding: 72px 24px 56px;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px 40px;
  }

  .footer-col--brand {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
  }

  .footer-app-badges {
    flex-direction: row;
    gap: 16px;
  }

  .footer-bottom-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 24px;
    gap: 24px;
  }

  .footer-locale {
    order: 0;
    justify-self: start;
  }

  .footer-copyright-text {
    text-align: center;
    justify-self: center;
  }

  .footer-legal {
    justify-self: end;
  }
}


/* ========================================
   DESKTOP (992px+)
   5-column grid with specified widths
   ======================================== */
@media (min-width: 992px) {
  .footer-inner {
    padding: 80px 15px 64px;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 172px 122px 230px 180px 212px;
    gap: 0;
    justify-content: space-between;
    align-items: stretch;
  }

  .footer-col--brand {
    grid-column: auto;
    flex-direction: column;
    gap: 24px;
  }

  .footer-col--contact {
    justify-content: space-between;
  }

  .footer-contact-content {
    gap: 14px;
  }

  .footer-badge {
    width: 100%;
    justify-content: space-between;
  }

  .footer-app-badges {
    flex-direction: column;
    gap: 12px;
  }

  .footer-col {
    gap: 14px;
  }

  .footer-col-title {
    margin-bottom: 10px;
  }

  .footer-links {
    gap: 14px;
  }

  .footer-links-static {
    margin-top: 0;
  }

  .footer-contact-list {
    gap: 14px;
  }

  .footer-bottom-inner {
    padding: 28px 15px;
  }
}


/* ========================================
   LARGE DESKTOP (1200px+)
   Fine-tune spacing
   ======================================== */
@media (min-width: 1200px) {
  .footer-inner {
    padding: 80px 15px 64px;
  }

  .footer-grid {
    gap: 0;
  }
}


/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   WCAG AA Compliant (4.5:1 contrast ratio)
   ======================================== */

/* ----------------------------------------
   Color Contrast Fixes
   Background #2A303B requires 4.5:1 minimum
   ---------------------------------------- */

/* Boost from 0.6 to 0.75 opacity for 4.5:1+ contrast */
.footer-brand-tagline {
  color: rgba(255, 255, 255, 0.75);
}

.footer-copyright-text {
  color: rgba(255, 255, 255, 0.75);
}

.footer-legal-link {
  color: rgba(255, 255, 255, 0.75);
}

/* ----------------------------------------
   Focus States (WCAG 2.4.7)
   ---------------------------------------- */
.uae-footer a:focus-visible,
.uae-footer button:focus-visible {
  outline: 2px solid #4DA8DA;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Enhanced hover/focus states */
.footer-nav-link:focus {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
}

.footer-legal-link:focus {
  color: #FFFFFF;
}

.footer-contact-link:focus .footer-contact-value {
  color: #FFFFFF;
}

/* ----------------------------------------
   Skip Link for Keyboard Navigation
   ---------------------------------------- */
.footer-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #008483;
  color: #FFFFFF;
  padding: 8px 16px;
  z-index: 100;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 0 4px 0;
  transition: top 0.2s ease;
}

.footer-skip-link:focus {
  top: 0;
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* ----------------------------------------
   High Contrast Mode Support
   ---------------------------------------- */
@media (prefers-contrast: high) {
  .footer-brand-tagline,
  .footer-copyright-text,
  .footer-legal-link,
  .footer-nav-link,
  .footer-contact-value {
    color: #FFFFFF;
  }

  .uae-footer a:focus,
  .uae-footer button:focus {
    outline: 3px solid #FFFFFF;
    outline-offset: 3px;
  }
}

/* ----------------------------------------
   Reduced Motion Support
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .uae-footer a,
  .uae-footer button,
  .footer-skip-link {
    transition: none;
  }
}

/* ----------------------------------------
   RTL Support
   ---------------------------------------- */
[dir="rtl"] .footer-contact-link {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

[dir="rtl"] .footer-contact-value {
  margin-inline-start: 28px; /* 20px flag + 8px gap */
  text-align: start;
}


/* ========================================
   FOOTER LOCALE (Bottom Bar)
   Country selector + language switcher
   Shopify-style compact layout
   ======================================== */

/* ----------------------------------------
   Locale Container
   ---------------------------------------- */
.footer-locale {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ----------------------------------------
   Footer Country Selector
   Compact style for bottom bar
   ---------------------------------------- */
.footer-country-selector {
  position: relative;
}

.footer-country-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer-country-trigger:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.footer-country-flag {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.footer-country-globe {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.8;
  filter: brightness(0) invert(1);
}

.footer-country-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.footer-country-arrow {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.7);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.7);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-block-start: -3px;
}

/* Arrow rotation when open */
.footer-country-selector.dropdown-open .footer-country-arrow {
  transform: rotate(-135deg);
  margin-block-start: 3px;
}

/* ----------------------------------------
   Footer Country Menu
   Mobile: Bottom sheet | Desktop: Dropdown upward
   ---------------------------------------- */
.footer-country-menu {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  max-height: 0;
  background-color: #FFFFFF;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-country-selector.dropdown-open .footer-country-menu {
  max-height: 60vh;
  padding: 16px 0 0 0;
  overflow-y: auto;
}

/* Menu Title */
.footer-country-title {
  font-size: 16px;
  font-weight: 600;
  color: #2A303B;
  margin: 0;
  padding: 6px 16px;
}

/* Menu Items */
.footer-country-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 400;
  color: #2A303B;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.footer-country-item:hover,
.footer-country-item:focus {
  background-color: #F5F5F5;
  color: #008483;
}

.footer-country-item.is-active {
  font-weight: 500;
  background-color: rgba(0, 132, 131, 0.08);
}

.footer-country-item.is-active::after {
  content: '';
  margin-inline-start: auto;
  width: 16px;
  height: 16px;
  background-color: var(--color-primary);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.5 4.5L6.5 11.5L3 8' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.5 4.5L6.5 11.5L3 8' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.footer-country-item img {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Close Button (tertiary - minimal) */
.footer-country-close {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-country-close:hover {
  color: #475569;
}

.footer-country-close svg {
  flex-shrink: 0;
}

/* Mobile overlay backdrop */
.footer-country-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.footer-country-selector.dropdown-open .footer-country-backdrop {
  opacity: 1;
  visibility: visible;
}

/* ----------------------------------------
   Language Switcher (SVG Mask - matches header)
   ---------------------------------------- */
.footer-lang {
  display: block;
  width: 46px;
  height: 16px;
  padding: 8px 12px;
  box-sizing: content-box;
  font-size: 0; /* Hide text content */
  color: transparent;
  background-color: rgba(255, 255, 255, 0.8);
  -webkit-mask-image: url('https://cdn.prod.website-files.com/6512cbc4fa8d0ecb482a233b/6955a8147d339900369a7e0d_footer-lang-ar.svg');
  -webkit-mask-size: 46px 16px;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url('https://cdn.prod.website-files.com/6512cbc4fa8d0ecb482a233b/6955a8147d339900369a7e0d_footer-lang-ar.svg');
  mask-size: 46px 16px;
  mask-repeat: no-repeat;
  mask-position: center;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.footer-lang:hover {
  background-color: #FFFFFF;
}

/* RTL: English text doesn't need SVG mask (English fonts already loaded) */
[dir="rtl"] .footer-lang {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 8px 12px;
  box-sizing: border-box;
  font-size: 14px; /* Show text */
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  -webkit-mask-image: none;
  mask-image: none;
}

[dir="rtl"] .footer-lang:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.1);
}

/* ----------------------------------------
   Tablet (768px+)
   Dropdown opens upward
   ---------------------------------------- */
@media (min-width: 768px) {
  /* Dropdown instead of bottom sheet */
  .footer-country-menu {
    position: absolute;
    inset-inline-start: 0;
    bottom: 100%;
    inset-inline-end: auto;
    width: 280px;
    max-height: 0;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .footer-country-selector.dropdown-open .footer-country-menu {
    max-height: 400px;
    padding: 12px 0;
  }

  .footer-country-title {
    padding: 6px 12px;
  }

  .footer-country-item {
    padding: 8px 12px;
  }

  .footer-country-item img {
    width: 18px;
    height: 18px;
  }

  .footer-country-close {
    display: none;
  }

  /* Hide mobile backdrop on tablet+ */
  .footer-country-backdrop {
    display: none;
  }
}

/* ----------------------------------------
   RTL Support for Locale
   ---------------------------------------- */
[dir="rtl"] .footer-country-arrow {
  border-right: none;
  border-left: 1.5px solid rgba(255, 255, 255, 0.7);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.7);
  transform: rotate(-45deg);
}

[dir="rtl"] .footer-country-selector.dropdown-open .footer-country-arrow {
  transform: rotate(135deg);
}

/* ----------------------------------------
   Locale Accessibility
   ---------------------------------------- */
.footer-country-trigger:focus-visible {
  outline: 2px solid #4DA8DA;
  outline-offset: 2px;
}

.footer-country-item:focus-visible {
  outline: 2px solid #4DA8DA;
  outline-offset: -2px;
}

.footer-lang:focus-visible {
  outline: 2px solid #4DA8DA;
  outline-offset: 2px;
}

.footer-country-close:focus-visible {
  outline: 2px solid #4DA8DA;
  outline-offset: -2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .footer-country-menu,
  .footer-country-arrow,
  .footer-country-backdrop,
  .footer-lang {
    transition: none;
  }
}
