/* =========================
   BRAND VARIABLES
========================= */
:root {
  --blue-900: #0F3D66;
  --blue-800: #155A8A;
  --blue-700: #1E74B5;
  --blue-600: #258ADF;
  --blue-500: #4FA3E6;
  --blue-400: #7BBEF0;
  --blue-300: #A7D6F7;
  --blue-200: #D3ECFB;
  --blue-100: #EEF8FE;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --border-light: #D1D5DB;
  --bg-light: #F9FAFB;
  --bg-dark: #0F172A;
}

/* =========================
   GENERAL
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-light);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

/* Prevent anchor content hiding behind fixed nav */
section { scroll-margin-top: 90px; }

/* =========================
   NAVBAR
========================= */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 70px;
  padding: 0 8%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  z-index: 1000;
}

.logo img {
  height: 65px;
  transition: transform 0.3s ease;
}

/* =========================
   HAMBURGER
========================= */
.hamburger {
  position: absolute;
  right: 8%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 28px;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* =========================
   SIDE MENU (SHORTER + FLOATING + iOS SPRING + CENTERED + STAGGER)
   ✅ CHANGE INCLUDED: menu now sits directly under the fixed navbar
========================= */
.side-menu {
  position: fixed;

  /* ✅ directly under navbar (70px) + safe area */
  top: calc(70px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));

  width: 280px;

  /* MOBILE-SAFE: never exceed viewport width, respect notch safe areas */
  width: min(280px, calc(100vw - 32px));

  /* shorter than full height */
  height: auto;
  max-height: 80vh;

  /* MOBILE-SAFE: account for safe area + smoother iOS scrolling */
  max-height: calc(80vh - env(safe-area-inset-top));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background: #fff;
  padding: 40px 30px 32px;
  display: flex;
  flex-direction: column;

  /* center items */
  align-items: center;

  /* floating card look */
  border-radius: 18px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.18),
    0 8px 20px rgba(0, 0, 0, 0.12);

  /* iOS-like spring entrance */
  transform: translateX(calc(100% + 24px)) translateY(10px) scale(0.98);
  opacity: 0;

  transition:
    transform 520ms cubic-bezier(0.22, 1.35, 0.36, 1),
    opacity 220ms ease-out;

  will-change: transform, opacity;
  z-index: 1100;
}

.side-menu.active {
  transform: translateX(0) translateY(0) scale(1);
  opacity: 1;
}

/* Centered links + contact button */
.side-menu a {
  margin-bottom: 20px;
  padding: 12px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;

  width: 100%;
  text-align: center;
}

.side-menu a.btn {
  width: 100%;
}

.side-menu a:hover {
  color: var(--blue-600);
  background: rgba(37,138,223,0.08);
}

/* Active page highlight */
.side-menu a.active {
  color: var(--blue-600);
  font-weight: 600;
  background: rgba(37,138,223,0.08);
}

.primary-high-contrast {
  background: var(--blue-600);
  color: #fff;
  font-weight: 600;
}

/* =========================
   STAGGERED SPRING FOR MENU ITEMS
========================= */
.side-menu a,
.side-menu .services-toggle {
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  will-change: transform, opacity;
}

.side-menu.active a,
.side-menu.active .services-toggle {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    transform 520ms cubic-bezier(0.22, 1.35, 0.36, 1),
    opacity 220ms ease-out;
}

/* Stagger (direct children in your nav)
   1: Home (a)
   2: Services toggle (a.services-toggle)
   3: servicesSubmenu (div)
   4: About (a)
   5: Contact (a.btn)
*/
.side-menu.active > a:nth-child(1) { transition-delay: 60ms; }
.side-menu.active > a:nth-child(2) { transition-delay: 120ms; }
.side-menu.active > a:nth-child(4) { transition-delay: 180ms; }
.side-menu.active > a:nth-child(5) { transition-delay: 240ms; }

/* =========================
   SERVICES SUBMENU (INLINE + AUTO-RESIZE ANIMATION)
   - No display:none (so height can animate)
   - Smooth expand/collapse using max-height
========================= */
.services-toggle {
  display: flex;
  align-items: center;
  justify-content: center; /* centered row */
  gap: 10px;
}

.services-plus {
  font-size: 20px;
  line-height: 1;
  margin-left: 0; /* gap handles spacing */
}

.services-submenu {
  /* Keep it in the layout so it can animate height */
  display: flex;
  flex-direction: column;
  gap: 14px;

  width: 100%;

  /* collapsed state */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;

  margin-top: 0;
  margin-bottom: 0;

  padding-left: 12px;
  border-left: 2px solid transparent;

  transition:
    max-height 520ms cubic-bezier(0.22, 1.35, 0.36, 1),
    opacity 200ms ease-out,
    transform 520ms cubic-bezier(0.22, 1.35, 0.36, 1),
    border-left-color 200ms ease-out,
    margin 200ms ease-out;

  will-change: max-height, opacity, transform;
}

/* Expanded state */
.services-toggle[aria-expanded="true"] + .services-submenu {
  max-height: 520px; /* enough for all links; increase if you add more */
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;

  margin-top: 6px;
  margin-bottom: 10px;

  border-left-color: rgba(37,138,223,0.18);
}

.services-submenu a {
  display: block;
  width: 100%;
  margin-bottom: 0;
  text-align: center;

  /* for submenu stagger */
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  will-change: transform, opacity;
}

/* Submenu item spring stagger when expanded */
.services-toggle[aria-expanded="true"] + .services-submenu a {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    transform 520ms cubic-bezier(0.22, 1.35, 0.36, 1),
    opacity 220ms ease-out;
}

.services-toggle[aria-expanded="true"] + .services-submenu a:nth-child(1) { transition-delay: 80ms; }
.services-toggle[aria-expanded="true"] + .services-submenu a:nth-child(2) { transition-delay: 120ms; }
.services-toggle[aria-expanded="true"] + .services-submenu a:nth-child(3) { transition-delay: 160ms; }
.services-toggle[aria-expanded="true"] + .services-submenu a:nth-child(4) { transition-delay: 200ms; }
.services-toggle[aria-expanded="true"] + .services-submenu a:nth-child(5) { transition-delay: 240ms; }
.services-toggle[aria-expanded="true"] + .services-submenu a:nth-child(6) { transition-delay: 280ms; }

/* Keep submenu items from shifting on hover */
.services-submenu a:hover {
  transform: translateY(0) scale(1);
}

/* =========================
   OVERLAY
========================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 1050;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =========================
   BUTTONS
========================= */
.btn {
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ADDED: remove underline from button links */
a.btn { text-decoration: none; }

.primary {
  background: var(--blue-600);
  color: #fff;
}

.animate-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(37,138,223,0.4);
}

/* Pulse converted to glow (prevents transform conflicts) */
.pulse-btn {
  animation: pulseGlow 2.5s infinite;
}

.pulse-btn:hover { animation-play-state: paused; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,138,223,0.35); }
  50% { box-shadow: 0 0 0 12px rgba(37,138,223,0); }
}

.btn:focus-visible {
  outline: 3px solid rgba(37,138,223,0.6);
  outline-offset: 3px;
}

/* =========================
   HERO
========================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8%;
  text-align: center;
  color: #fff;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(37,138,223,0.75),
    rgba(30,116,181,0.75)
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.hero-content h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
  margin-bottom: 14px;
}

.hero-content p {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
  margin: 10px 0;
}

.hero-text {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s forwards;
}

/* Reliable animation targeting */
.hero-content h1.hero-text { animation-delay: 0.2s; }
.hero-content p.hero-text:nth-of-type(1) { animation-delay: 0.4s; }
.hero-content p.hero-text:nth-of-type(2) { animation-delay: 0.6s; }

.hero-btn {
  margin-top: 24px;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeUpBtn 1s forwards;
  animation-delay: 0.6s;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUpBtn {
  0% { opacity: 0; transform: translateY(50px); }
  60% { transform: translateY(-10px); }
  80% { transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =========================
   SECTIONS
========================= */
.services,
.about,
.contact {
  padding: 100px 8%;
  text-align: center;
  background: var(--bg-light);
}

/* =========================
   SERVICE CARDS
========================= */
.service-grid {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  gap: 30px;
}

.card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.6s ease;
}

.card.visible {
  transform: translateY(0);
  opacity: 1;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 18px 40px rgba(37,138,223,0.18);
}

/* ADDED: Clickable service cards */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link:focus-visible {
  outline: 3px solid rgba(37,138,223,0.6);
  outline-offset: 3px;
}

/* =========================
   CONTACT FORM
========================= */
.contact form {
  max-width: 520px;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.contact input,
.contact textarea {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  font-size: 16px;
}

.contact input:focus,
.contact textarea:focus {
  border-color: var(--blue-600);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,138,223,0.15);
}

/* =========================
   FOOTER
========================= */
.footer {
  background: var(--bg-dark);
  color: #CBD5F5;
  padding: 14px 24px;
  text-align: center;
}

/* =========================
   SOCIAL ICONS
========================= */
.footer-social {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 30px;
}

.footer-social a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}

.footer-social svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.footer-social .facebook { background: #1877F2; }
.footer-social .instagram {
  background: radial-gradient(
    circle at 30% 110%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285AEB 90%
  );
}
.footer-social .whatsapp { background: #25D366; }
.footer-social .email { background: #374151; }

.footer-social a:hover {
  filter: brightness(1.05);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

/* =========================
   MOBILE TWEAKS
========================= */
@media (max-width: 600px) {
  .navbar { padding: 0 16px; }
  .hamburger { right: 16px; }

  .services,
  .about,
  .contact {
    padding: 80px 16px;
  }

  .hero {
    padding: 0 16px;
  }
}

/* =========================
   ACCESSIBILITY
========================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .hero-video { display: none; }
}
/* =========================
   Contact form UX (no layout changes)
========================= */
.btn.is-sending {
  position: relative;
  opacity: 0.9;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-sending::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  border-top-color: rgba(255,255,255,0.15);
  animation: btnSpin 0.8s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Simple toast (fixed, doesn't affect layout) */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.25;
  max-width: min(92vw, 520px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 9999;
}

.site-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-toast.success {
  background: rgba(20, 160, 80, 0.95);
  color: #fff;
}

.site-toast.error {
  background: rgba(200, 45, 45, 0.95);
  color: #fff;
}
