/* ============================================================
   MG Medic · KS Medic · KS Airmedic — Portal corporativo B2B
   Bootstrap 5.3 + FontAwesome 6 · Glassmorphism
   ============================================================ */

:root {
  /* Tokens del sistema visual (Modern Minimal, ligado al proyecto) */
  --bg: oklch(99% 0.002 240);
  --surface: oklch(100% 0 0);
  --fg: oklch(18% 0.012 250);
  --muted: oklch(54% 0.012 250);
  --border: oklch(92% 0.005 250);
  --accent: oklch(58% 0.18 255);

  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  /* Derivados del sistema */
  --accent-strong: oklch(46% 0.16 258);
  --accent-soft: oklch(95.5% 0.035 250);
  --focus-ring: oklch(88% 0.08 255 / 0.6);
  --wa: #25D366;
  --wa-bright: oklch(66% 0.15 156);
  --wa-ink: #0a2318;
  --wa-text: oklch(46% 0.12 158);

  --nav-glass: rgba(255, 255, 255, 0.58);
  --card-glass: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 24px 60px -28px rgba(18, 34, 68, 0.35);
  --shadow-soft: 0 14px 34px -20px rgba(18, 34, 68, 0.28);

  --radius-lg: 1.25rem;
  --radius-md: 0.875rem;

  --bs-primary: var(--accent);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--border);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 620px at 12% -6%, oklch(95% 0.035 240 / 0.8), transparent 62%),
    radial-gradient(1000px 520px at 88% 18%, oklch(95% 0.035 222 / 0.65), transparent 58%),
    radial-gradient(960px 720px at 50% 115%, oklch(94% 0.03 258 / 0.55), transparent 62%);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .navbar-brand, .display-type {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

section[id], footer[id] { scroll-margin-top: 88px; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-strong); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem var(--focus-ring);
}

::selection { background: oklch(88% 0.09 255 / 0.5); }

/* ---------- Glass ---------- */

.glass {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---------- Navegación ---------- */

.navbar-glass {
  background: var(--nav-glass);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 14px 34px -22px rgba(20, 40, 80, 0.35);
  transition: background 0.25s ease;
}

.navbar-glass.scrolled { background: rgba(255, 255, 255, 0.8); }

.navbar-brand img { filter: drop-shadow(0 4px 10px rgba(18, 34, 68, 0.25)); }

.navbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--fg);
  padding: 0.5rem 0.9rem;
  border-radius: 0.75rem;
  white-space: nowrap;
  font-family: var(--font-display);
}

.navbar .nav-link i { color: var(--accent-strong); font-size: 0.95em; }

.navbar .nav-link:hover { color: var(--accent-strong); background: oklch(97% 0.015 250 / 0.7); }

.navbar .nav-link.active { color: var(--accent-strong); background: var(--accent-soft); }

.navbar-toggler {
  border-color: rgba(18, 34, 68, 0.18);
  color: var(--fg);
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
  }
  .navbar .nav-link { padding: 0.65rem 0.9rem; }
}

/* ---------- Hero Slider ---------- */

.hero-carousel,
.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
  height: 100vh;
}

.hero-carousel .carousel-item { min-height: 640px; }

.hero-slide { position: relative; overflow: hidden; }

.absolute-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 14, 30, 0.66) 0%, rgba(9, 16, 34, 0.42) 46%, rgba(8, 14, 30, 0.78) 100%);
}

.hero-wrap {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 96px;
}

.hero-content {
  max-width: 46rem;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: oklch(85% 0.08 240);
  margin-bottom: 1.1rem;
}

.hero-kicker::before {
  content: "";
  width: 2.4rem;
  height: 2px;
  border-radius: 2px;
  background: var(--wa);
}

.hero-title {
  color: oklch(98% 0.004 250);
  font-size: clamp(2.15rem, 5.2vw, 3.9rem);
  font-weight: 800;
  line-height: 1.06;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero-title .accent-text { color: var(--wa); }

.hero-sub {
  color: oklch(92% 0.01 250);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 40rem;
  margin-bottom: 2rem;
}

.hero-carousel .carousel-indicators {
  z-index: 3;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.hero-carousel .carousel-indicators [data-bs-target] {
  width: 2.4rem;
  height: 4px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.55);
  border: 0;
  opacity: 1;
}

.hero-carousel .carousel-indicators .active { background-color: var(--wa); }

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
  width: 9%;
  color: #fff;
  opacity: 0.55;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover { opacity: 1; }

@media (max-width: 991.98px) {
  .hero-carousel, .hero-carousel .carousel-inner, .hero-carousel .carousel-item { height: 92vh; }
  .hero-carousel .carousel-item { min-height: 600px; }
  .hero-content { padding-top: 96px; }
}

/* ---------- Secciones ---------- */

.section { padding: 5.5rem 0; }

.section-head { max-width: 44rem; margin-inline: auto; margin-bottom: 3rem; }

.kicker {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.section .lead { font-size: 1.05rem; }

/* ---------- Catálogo / Tabs ---------- */

.catalog-tabs {
  border-bottom: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.catalog-tabs .nav-link {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.catalog-tabs .nav-link:hover { border-color: var(--accent); color: var(--accent-strong); }

.catalog-tabs .nav-link.active {
  background: var(--fg);
  border-color: var(--fg);
  color: oklch(98% 0.004 250);
}

.catalog-tabs .nav-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.product-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 70px -28px rgba(18, 34, 68, 0.42);
}

.product-card .card-img-top {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.product-card .card-body { padding: 1.4rem; }

.product-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.product-card .card-text {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
}

.wa-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--wa-text);
}

.wa-link:hover { color: var(--wa-ink); }
.wa-link i { font-size: 1.1em; }

/* ---------- KS Airmedic ---------- */

.airmedic-section .lead-text { color: var(--muted); font-size: 1.05rem; }

.airmedic-img-wrap {
  border-radius: var(--radius-lg);
  padding: 0.6rem;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.airmedic-img-wrap img { width: 100%; border-radius: calc(var(--radius-lg) - 0.6rem); }

.systems-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 1.75rem;
  padding: 0;
  list-style: none;
}

.systems-chips li {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  box-shadow: var(--shadow-soft);
}

.client-wall {
  margin-top: 4.5rem;
  text-align: center;
}

.client-wall-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.client-logo {
  display: grid;
  place-items: center;
  height: 84px;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.client-logo:hover { transform: translateY(-3px); border-color: var(--accent); }

.img-client {
  max-height: 52px;
  max-width: 100%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.8;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.client-logo:hover .img-client { filter: grayscale(0); opacity: 1; }

/* ---------- Contacto ---------- */

.contact-section .contact-info h2 { margin-bottom: 0.75rem; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.contact-list a:hover { color: var(--accent-strong); }

.contact-list i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 0.75rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 1.05rem;
}

.contact-list .wa-icon i { color: var(--wa-text); background: oklch(95% 0.05 158); }

.form-card {
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-label { font-weight: 600; font-size: 0.92rem; }

.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 34, 68, 0.12);
  padding: 0.7rem 0.9rem;
  border-radius: 0.7rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.invalid-feedback { display: none; }
.was-validated .is-invalid .invalid-feedback,
.was-validated .is-invalid.invalid-feedback { display: block; }

/* ---------- Botones ---------- */

.btn { border-radius: 0.8rem; font-weight: 700; }

.btn-wa {
  background: var(--wa);
  border: 1px solid var(--wa);
  color: var(--wa-ink);
  box-shadow: 0 18px 40px -18px rgba(37, 211, 102, 0.65);
}

.btn-wa:hover,
.btn-wa:focus {
  background: var(--wa-bright);
  border-color: var(--wa-bright);
  color: var(--wa-ink);
  transform: translateY(-2px);
  box-shadow: 0 22px 46px -18px rgba(37, 211, 102, 0.7);
}

.btn-outline-wa {
  border: 1.5px solid var(--wa);
  color: var(--wa-ink);
  background: transparent;
}

.btn-outline-wa:hover,
.btn-outline-wa:focus {
  background: var(--wa);
  border-color: var(--wa);
  color: var(--wa-ink);
}

.btn-primary {
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: oklch(42% 0.15 258);
  border-color: oklch(42% 0.15 258);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- WhatsApp flotante ---------- */

.whatsapp-float {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 1075;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wa);
  color: var(--wa-ink);
  box-shadow: 0 18px 42px -14px rgba(37, 211, 102, 0.65);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus {
  color: var(--wa-ink);
  transform: scale(1.06);
  box-shadow: 0 22px 50px -14px rgba(37, 211, 102, 0.8);
}

.whatsapp-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wa);
  z-index: -1;
  animation: wa-pulse 2.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes wa-pulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  70%  { transform: scale(1.6);  opacity: 0; }
  100% { transform: scale(1.6);  opacity: 0; }
}

@media (min-width: 576px) {
  .whatsapp-float { right: 1.75rem; bottom: 1.75rem; }
}

/* ---------- Footer ---------- */

.footer {
  background: oklch(16% 0.018 252);
  color: oklch(88% 0.008 250);
}

.footer a { color: oklch(76% 0.02 250); }
.footer a:hover { color: #fff; }

.footer .footer-brand { margin-bottom: 1rem; }

.footer-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(70% 0.02 250);
  margin-bottom: 1rem;
}

.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }

.socials { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.socials a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.1rem 0;
  font-size: 0.86rem;
  color: oklch(64% 0.015 250);
}

.footer-bottom p { margin: 0; }

/* ---------- Reducción de movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .whatsapp-float::before { animation: none; }
  .navbar-glass,
  .product-card,
  .client-logo,
  .btn { transition: none; }
  .product-card:hover { transform: none; }
  .carousel-item { transition-duration: 0.01ms !important; }
}
