/* =========================
   DESIGN TOKENS (PRO)
========================= */
:root {
  /* Brand */
  --primary-color: #0056b3;
  --secondary-color: #00a8ff;
  --accent-green: #4CAF50;

  /* Text / UI */
  --text-dark: #2c3e50;
  --text-light: #f8f9fa;

  /* Surfaces */
  --bg-water: #e3f2fd;
  --bg-soft: #f0f8ff;
  --bg-white: #ffffff;

  /* Gradients */
  --gradient-blue: linear-gradient(135deg, #0056b3 0%, #0088cc 100%);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-1: 0 6px 18px rgba(0,0,0,0.08);
  --shadow-2: 0 12px 28px rgba(0,0,0,0.12);
  --shadow-3: 0 18px 50px rgba(0,0,0,0.18);

  /* Blur / Glass */
  --glass-bg: rgba(0, 40, 80, 0.55);
  --glass-border: rgba(255,255,255,0.14);
  --blur: blur(12px);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-1: 180ms;
  --dur-2: 320ms;
  --dur-3: 520ms;

  /* Layout */
  --nav-height: 84px; /* aprox */
}

/* =========================
   BASE
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  position: relative; /* Bootstrap ScrollSpy */
  background: var(--bg-white);
}

h1, h2, h3, h4, .btn {
  font-family: 'Nunito', sans-serif;
}

a {
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(0, 168, 255, 0.45);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Compensa navbar fixed al navegar a anchors */
section[id],
header[id] {
  scroll-margin-top: 95px;
}

/* Helpers */
.object-fit-cover { object-fit: cover; }

/* =========================
   NAVBAR (PRO)
========================= */
.navbar {
  transition: background var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              padding var(--dur-2) var(--ease-out);
  padding: 1.05rem 0;
  z-index: 1000;
  background: transparent;
}

.navbar.shadow {
  /* Tu JS agrega .shadow; aquí lo hacemos bonito */
  background: rgba(0, 40, 80, 0.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-2);
  padding: 0.75rem 0;
}

.navbar-brand span {
  letter-spacing: 0.5px;
}

.nav-link {
  color: rgba(255,255,255,0.92) !important;
  font-weight: 700;
  margin: 0 8px;
  position: relative;
  transition: opacity var(--dur-1) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}

.nav-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* underline animado */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0;
  background: rgba(255,255,255,0.92);
  transition: width var(--dur-2) var(--ease-soft);
}
.nav-link:hover::after {
  width: 100%;
}

/* estado activo scrollspy */
.navbar .nav-link.active {
  color: #fff !important;
}
.navbar .nav-link.active::after {
  width: 100%;
}

/* Mobile menu glass */
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: 10px;
    padding: 14px 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 40, 80, 0.75);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-2);
  }

  .nav-link::after { bottom: -4px; }
}

.lang-switch .btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 8px;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out);
}
.lang-switch .btn:hover {
  transform: translateY(-1px);
}

/* =========================
   HERO (PRO)
========================= */
.hero-section {
  background:
    radial-gradient(1200px 600px at 50% 20%, rgba(0,168,255,0.22), transparent 55%),
    linear-gradient(rgba(0, 25, 60, 0.62), rgba(0, 85, 170, 0.22)),
    url('https://images.unsplash.com/photo-1505144808419-1957a94ca61e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  padding-top: var(--nav-height);
}

/* iOS/Android: fixed suele ser problemático */
@media (max-width: 768px) {
  .hero-section {
    background-attachment: scroll;
    min-height: 86vh;
  }
}

.hero-eyebrow {
  letter-spacing: 0.4px;
  animation: fadeUp var(--dur-3) var(--ease-soft) both;
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  font-weight: 900;
  text-shadow: 0 10px 30px rgba(0,0,0,0.35);
  margin-bottom: 1.1rem;
  animation: fadeUp var(--dur-3) var(--ease-soft) both;
  animation-delay: 80ms;
}

.hero-section .lead {
  max-width: 860px;
  margin: 0 auto;
  animation: fadeUp var(--dur-3) var(--ease-soft) both;
  animation-delay: 140ms;
}

.hero-section .btn {
  animation: fadeUp var(--dur-3) var(--ease-soft) both;
  animation-delay: 220ms;
}

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

/* Wave divider */
.wave-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}
.wave-bottom svg {
  display: block;
  width: calc(150% + 1.3px);
  height: 80px;
  transform: rotateY(180deg);
}
.wave-bottom .shape-fill {
  fill: var(--bg-soft);
}

/* Buttons */
.btn-custom-primary,
.btn-custom-light {
  border-radius: var(--radius-pill);
  padding: 12px 30px;
  font-weight: 800;
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              filter var(--dur-2) var(--ease-out);
  will-change: transform;
}

.btn-custom-primary {
  background-color: #004494;
  color: #fff;
  border: 2px solid #004494;
  box-shadow: 0 12px 26px rgba(0, 68, 148, 0.22);
}
.btn-custom-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(0, 68, 148, 0.35);
  filter: saturate(1.1);
}

.btn-custom-light {
  background-color: rgba(255,255,255,0.92);
  color: #004494;
  border: 2px solid rgba(255,255,255,0.9);
}
.btn-custom-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(255,255,255,0.22);
  filter: brightness(1.03);
}

/* =========================
   SECTION BACKGROUNDS
========================= */
.section-bg-light {
  background-color: var(--bg-soft);
  padding: clamp(3.5rem, 6vw, 5rem) 0;
  position: relative;
}

/* =========================
   CARDS (Cómo funciona)
========================= */
.card-process {
  background: var(--bg-white);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
  overflow: hidden;
  height: 100%;
}

.card-process:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-2);
  border-color: rgba(0,168,255,0.20);
}

.machine-img {
  max-height: 260px;
  object-fit: contain;
  transition: transform var(--dur-2) var(--ease-out);
}
.card-process:hover .machine-img {
  transform: scale(1.02);
}

.step-number {
  background: var(--primary-color);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.step-number.green {
  background: var(--accent-green);
}

.blue-ribbon {
  background: var(--gradient-blue);
  color: white;
  padding: 1.25rem 1.4rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  text-align: center;
  font-size: 1.05rem;
  margin-top: -10px;
  position: relative;
  z-index: 2;
  box-shadow: 0 -8px 20px rgba(0,0,0,0.10);
}

/* =========================
   RENTABILIDAD (pro)
========================= */
.profit-section {
  background: var(--bg-white);
  padding: clamp(3.5rem, 6vw, 5rem) 0;
}

.icon-box {
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: #f8f9fa;
  box-shadow: inset 0 0 22px rgba(0,0,0,0.05), var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              background var(--dur-2) var(--ease-out);
}

.profit-item {
  transition: transform var(--dur-2) var(--ease-out);
}
.profit-item:hover {
  transform: translateY(-4px);
}
.profit-item:hover .icon-box {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-2);
}

/* hover color (ya no depende de col-md-3) */
.profit-item:hover .icon-box.blue { background: #e3f2fd; }
.profit-item:hover .icon-box.green { background: #e8f5e9; }
.profit-item:hover .icon-box.teal { background: #e0f2f1; }

/* =========================
   IMPACTO
========================= */
.impact-section {
  background: linear-gradient(to right, #eef7ff, #ffffff);
  padding: clamp(2.5rem, 5vw, 3.2rem) 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.impact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
  height: 100%;
}

.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.impact-icon-small {
  font-size: 2.1rem;
  color: var(--secondary-color);
}

/* =========================
   CALIFORNIA media ratio
========================= */
.ratio > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform var(--dur-3) var(--ease-soft);
}
.ratio:hover > img {
  transform: scale(1.06);
}

/* =========================
   GALERÍA (pro)
========================= */
.gallery-img {
  border-radius: var(--radius-md);
  height: 280px;
  width: 100%;
  object-fit: cover;
  transition: transform var(--dur-2) var(--ease-out),
              filter var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
  cursor: pointer;
  box-shadow: var(--shadow-1);
}

.gallery-img:hover {
  transform: translateY(-6px) scale(1.02);
  filter: brightness(1.06) contrast(1.02);
  box-shadow: var(--shadow-2);
}

@media (max-width: 576px) {
  .gallery-img {
    height: 220px;
  }
}

/* =========================
   CTA (pro y estable)
========================= */
.cta-box-section {
  background: url('https://images.unsplash.com/photo-1562016600-ece13e8ba570?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
  padding: clamp(4rem, 7vw, 6rem) 0;
  position: relative;
  text-align: center;
  overflow: hidden;
}

.cta-box-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.42);
}

.cta-card {
  background: var(--gradient-blue);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 2;
  box-shadow: 0 30px 70px rgba(0, 86, 179, 0.32);
  border: 1px solid rgba(255,255,255,0.14);
}

.cta-card .form-control,
.cta-card .form-select {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.94);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}

.cta-card .form-control:focus,
.cta-card .form-select:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  border-color: rgba(0,168,255,0.55);
}

.cta-card .btn.btn-light {
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.cta-card .btn.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.22);
}

/* =========================
   FOOTER
========================= */
footer {
  background-color: #002855;
  color: #b0c4de;
  padding: 3rem 0;
  font-size: 0.92rem;
}

footer a {
  color: #b0c4de;
  text-decoration: none;
  transition: color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}

footer a:hover {
  color: white;
  transform: translateY(-1px);
}

.social-circle {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  align-items: center;
  justify-content: center;
  margin: 0 5px;
  transition: background var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}

.social-circle:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
}

/* =========================
   OPTIONAL: Chat Widget
========================= */
.chat-widget {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 58px;
  height: 58px;
  background: var(--secondary-color);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 26px;
  box-shadow: 0 10px 26px rgba(0,168,255,0.35);
  cursor: pointer;
  z-index: 1050;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.chat-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(0,168,255,0.45);
}

/* =========================
   RESPONSIVE TWEAKS
========================= */
@media (max-width: 768px) {
  .hero-section { padding-top: 76px; }
  .cta-card { text-align: left; }
}

@media (max-width: 576px) {
  .navbar { padding: 0.85rem 0; }
  .hero-section .lead { font-size: 1.02rem; }
}

/* =========================
   REDUCED MOTION (pro)
========================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
