/* ═══════════════════════════════════════════════════════
   MÏAM CHARITABLE TRUST — FOOTER CSS
   Extracted from styles.css + responsive.css
   Includes: Footer, Scroll-to-Top, WhatsApp FAB & Chat Boat
   ═══════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES (needed by footer components) ─── */
:root {
  --clr-teal: #2563eb;
  --clr-teal-deep: #1d4ed8;
  --clr-teal-light: #60a5fa;
  --clr-teal-muted: #bfdbfe;
  --clr-teal-bg: rgba(37, 99, 235, 0.1);

  --clr-forest: #1e3a8a;
  --clr-forest-deep: #0b1f4d;
  --clr-forest-light: #3b82f6;

  --clr-coral: #d94a47;
  --clr-coral-deep: #b83230;

  --ink-light: #ffffff;
  --ink-light-muted: rgba(255, 255, 255, 0.75);

  --font-display: "Lora", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4rem;
  --sp-8: 6rem;

  --r-pill: 100px;

  --t-fast: 0.25s;
  --t-normal: 0.5s;

  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET (minimal, for standalone use) ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body);  }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ═══════════════ FOOTER ═══════════════ */
.footer {
  position: relative;
}
.footer__wave {
  line-height: 0;
  overflow: hidden;
}
.footer__wave svg {
  display: block;
  width: 100%;
}
.footer__body {
  background: var(--clr-forest-deep);
  color: var(--ink-light);
  padding-top: var(--sp-8);
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-5) var(--sp-8);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: var(--sp-6);
}
.footer__logo-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink-light);
  display: block;
}
.footer__logo-sub {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  display: block;
  margin-bottom: var(--sp-3);
}
.footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
  margin-left: var(--sp-5);
  margin-top: var(--sp-1);
}
.footer__social {
  display: flex;
  gap: var(--sp-2);
}
.footer__social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}
.footer__social a:hover {
  border-color: var(--clr-teal);
  background: rgba(37, 99, 235, 0.15);
}
.footer__social .material-icons-outlined {
  font-size: 18px;
  color: var(--ink-light);
}
.footer__col-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: var(--sp-3);
}
.footer__links li {
  margin-bottom: var(--sp-2);
}
.footer__links a {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
  transition: color var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.footer__links a:hover {
  color: #fff;
}
.footer__links .material-icons-outlined {
  font-size: 16px;
}
.footer-cert {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-cert .material-icons-outlined {
  font-size: 16px;
  color: #fff;
}
.footer-cert strong {
  color: var(--clr-teal-muted);
}
.footer__contact-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-2);
  font-size: 0.88rem;
}
.footer__contact-detail .material-icons-outlined {
  font-size: 18px;
  color: #fff;
}
.footer__contact-detail a {
  color: #fff;
  font-weight: 500;
}
.footer__contact-detail a:hover {
  text-decoration: underline;
}
.footer__newsletter {
  display: flex;
  gap: 0;
  margin-top: var(--sp-3);
}
.footer__newsletter-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-light);
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  outline: none;
  transition: border-color var(--t-fast);
}
.footer__newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
.footer__newsletter-input:focus {
  border-color: var(--clr-teal);
}
.footer__newsletter-btn {
  padding: 0.7rem 1.2rem;
  background: var(--clr-teal);
  color: var(--ink-light);
  border: none;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  cursor: pointer;
  transition: background var(--t-fast);
  display: flex;
  align-items: center;
}
.footer__newsletter-btn:hover {
  background: var(--clr-teal-deep);
}
.footer__newsletter-btn .material-icons-outlined {
  font-size: 20px;
}
.footer__bottom {
  background: #0b1f3a;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  max-width: none;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

/* RTL Support */
html[dir="rtl"] .footer__inner { direction: rtl; }
html[dir="rtl"] .footer__social { flex-direction: row-reverse; }
html[dir="rtl"] .footer__links li a { flex-direction: row-reverse; }

/* ═══════════════ SCROLL TO TOP ═══════════════ */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--clr-teal);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 500;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { background: var(--clr-teal-deep); transform: translateY(-3px); }

/* ═══════════════ WHATSAPP FAB ═══════════════ */
.wa-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 4000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  border-radius: 100px;
  padding: 0.7rem 1.1rem 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.wa-fab:hover {
  background: #1ebe5d;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}
.wa-fab:focus-visible {
  outline: 3px solid #25d366;
  outline-offset: 3px;
}
.wa-fab__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.wa-fab__label {
  line-height: 1;
}
.wa-fab--lifted {
  bottom: 5.5rem;
}

/* ═══════════════ WHATSAPP CHAT BOAT ═══════════════ */
.wa-chat-boat {
  position: fixed;
  right: 1.5rem;
  bottom: 5.25rem;
  z-index: 3999;
  width: 320px;
}
.wa-chat-boat__panel {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transform-origin: bottom right;
  transition: transform 0.3s var(--ease-smooth), opacity 0.3s;
}
.wa-chat-boat__header {
  background: #075e54;
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wa-chat-boat__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}
.wa-chat-boat__title .material-icons-outlined {
  font-size: 20px;
  color: #25d366;
}
.wa-chat-boat__close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.wa-chat-boat__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.wa-chat-boat__close .material-icons-outlined {
  font-size: 20px;
}
.wa-chat-boat__body {
  padding: 1rem;
  background: #ece5dd;
}
.wa-chat-boat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.wa-chat-boat__chip {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.wa-chat-boat__chip:hover {
  background: #dcf8c6;
  border-color: #25d366;
}
.wa-chat-boat__form {
  display: flex;
  gap: 0;
  border-radius: 100px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.wa-chat-boat__input {
  flex: 1;
  border: none;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-family: var(--font-body);
  outline: none;
  background: transparent;
}
.wa-chat-boat__input:focus {
  outline: none;
}
.wa-chat-boat__send {
  background: #25d366;
  border: none;
  color: #fff;
  padding: 0.7rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.wa-chat-boat__send:hover {
  background: #1ebe5d;
}
.wa-chat-boat__send .material-icons-outlined {
  font-size: 20px;
}

/* Hidden state */
.wa-chat-boat[data-open="false"] .wa-chat-boat__panel {
  transform: scale(0.9) translateY(10px);
  opacity: 0;
  pointer-events: none;
}
.wa-chat-boat--lifted {
  bottom: 8rem;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   Breakpoints: 1024px (tablet-lg), 768px (tablet), 480px (mobile), 360px (small phone)
   ═══════════════════════════════════════════════════════ */

/* ── Large Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
    padding: 0 var(--sp-4) var(--sp-6);
  }
  /* Brand spans full width on top */
  .footer__brand {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--sp-4);
  }
  .footer__brand > div:first-child { flex: 0 0 auto; }
  .footer__tagline { margin-bottom: var(--sp-2); }
  .footer__social { margin-top: 0; }
  .footer__body { padding-top: var(--sp-5); }
}

/* ── Tablet (≤768px) ── */
@media (max-width: 768px) {
  /* Footer body padding */
  .footer__body { padding-top: var(--sp-4); }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    padding: 0 var(--sp-3) var(--sp-5);
  }

  /* Brand: stacked, full width */
  .footer__brand {
    grid-column: 1 / -1;
    flex-direction: column;
    gap: var(--sp-2);
  }

  /* Bottom bar padding */
  .footer__bottom {
    padding: var(--sp-3) var(--sp-3) var(--sp-4);
    gap: 0.75rem;
    font-size: 0.78rem;
  }
  .footer__bottom p { max-width: 100% !important; }

  /* Social icons — bigger tap targets */
  .footer__social a {
    width: 44px;
    height: 44px;
  }

  /* Links & contact — min 44px tap target */
  .footer__links a,
  .footer__contact-detail a,
  .footer__bottom a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Newsletter — full width pill layout */
  .footer__newsletter {
    margin-top: var(--sp-2);
  }

  /* Scroll-to-top safe area */
  .scroll-top {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    right: 1rem;
    width: 44px;
    height: 44px;
  }

  /* WhatsApp */
  .wa-fab { bottom: 1rem; right: 1rem; }
  .wa-chat-boat { right: 0.75rem; width: calc(100vw - 1.5rem); max-width: 340px; }
}

/* ── Mobile (≤480px) ── */
@media (max-width: 480px) {
  /* Single column footer */
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
    padding: 0 1.25rem var(--sp-5);
  }

  .footer__brand {
    grid-column: 1;
    flex-direction: column;
  }

  /* Col titles spacing */
  .footer__col-title { margin-bottom: var(--sp-2); }

  /* Links spacing tighter */
  .footer__links li { margin-bottom: 0.6rem; }

  /* Newsletter stacks vertically */
  .footer__newsletter {
    flex-direction: column;
    gap: 0.6rem;
    margin-top: var(--sp-2);
  }
  .footer__newsletter-input {
    border-radius: var(--r-pill);
    width: 100%;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
  }
  .footer__newsletter-btn {
    border-radius: var(--r-pill);
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    gap: 6px;
  }
  .footer__newsletter-btn::after {
    content: "Subscribe";
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
  }

  /* Logo name smaller */
  .footer__logo-name { font-size: 1.5rem; }

  /* Tagline smaller */
  .footer__tagline { font-size: 0.92rem; }

  /* Social row wrap */
  .footer__social { flex-wrap: wrap; gap: 0.6rem; }

  /* Bottom bar */
  .footer__bottom {
    padding: var(--sp-3) 1.25rem;
    font-size: 0.74rem;
  }
  .footer__bottom p { line-height: 1.6; }
  .footer__bottom p[style*="font-size: 14px"] { font-size: 12px !important; }
  .footer__bottom p[style*="font-size: 12px"] { font-size: 10px !important; }
  .footer__bottom p[style*="font-size:13px"] { font-size: 11px !important; }

  /* Cert items */
  .footer-cert { font-size: 0.78rem; }

  /* Contact details */
  .footer__contact-detail { font-size: 0.84rem; gap: 6px; }

  /* WhatsApp */
  .wa-fab {
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: 1rem;
    padding: 0.75rem;
    border-radius: 50%;
  }
  .wa-fab__label { display: none; }
  .wa-fab--lifted { bottom: max(4.5rem, calc(env(safe-area-inset-bottom) + 4rem)); }

  .wa-chat-boat {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 5rem;
  }
  .wa-chat-boat--lifted { bottom: 8rem; }
  .wa-chat-boat__chips { gap: 0.4rem; }
  .wa-chat-boat__chip { font-size: 0.75rem; padding: 0.3rem 0.7rem; }

  /* Scroll-to-top */
  .scroll-top {
    bottom: max(1rem, env(safe-area-inset-bottom));
    right: 1rem;
    width: 42px;
    height: 42px;
  }
}

/* ── Small Phone (≤360px) ── */
@media (max-width: 360px) {
  .footer__inner { padding: 0 1rem var(--sp-4); }
  .footer__bottom { padding: var(--sp-2) 1rem var(--sp-3); }
  .footer__logo-name { font-size: 1.3rem; }
  .footer-cert { font-size: 0.72rem; }
  .footer__contact-detail { font-size: 0.78rem; }

  .wa-chat-boat {
    right: 0;
    left: 0;
    width: 100vw;
    border-radius: 16px 16px 0 0;
    bottom: 0;
  }
  .wa-chat-boat__panel { border-radius: 16px 16px 0 0; }
}

/* ── Focus ring ── */
*:focus-visible { outline: 2px solid var(--clr-teal); outline-offset: 3px; border-radius: 4px; }

/* ── Print: hide floating elements ── */
@media print {
  .scroll-top, .wa-fab, .wa-chat-boat { display: none !important; }
}
