:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --muted-1: #f2f4f7; /* único gris usado en secciones gris */
  --muted-2: #e6e9ee;
  --text: #222831;
  --muted-text: #556070;
  --accent: #2b6cb0;
  --radius: 10px;
  --container-max: 1100px;
  --shadow-sm: 0 6px 18px rgba(30,40,50,0.06);
  --transition: 200ms ease;
}

/* Reset y base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color:var(--text);
  background: var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.5;
  scroll-behavior:smooth;
}

/* Container: ancho centrado, vuelvo a incluir padding vertical para evitar que el contenido quede pegado */
.container{
  width:calc(100% - 64px);
  max-width:var(--container-max);
  margin:0 auto;
  padding:40px 0; /* restaurado: importante para espaciado entre secciones */
}

/* HEADER */
.site-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:120; /* suficientemente alto para estar sobre la página */
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.95));
  border-bottom:1px solid rgba(30,40,50,0.04);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  max-width:var(--container-max);
  margin:0 auto;
  padding:18px 32px;
}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font-weight:600}
.brand-logo{font-size:20px}
.brand-name{font-size:16px}

/* Nav */
.site-nav{display:block}
.nav-list{display:flex;gap:20px;align-items:center;margin:0;padding:0;list-style:none}
.nav-link{text-decoration:none;color:var(--muted-text);padding:8px 12px;border-radius:8px;transition:var(--transition);font-weight:500}
.nav-link:hover,.nav-link.active{color:var(--accent);background:transparent}

/* Mobile toggle */
.nav-toggle{display:none;background:none;border:0;padding:8px;cursor:pointer}
.hamburger{width:22px;height:2px;background:var(--text);display:block;position:relative}
.hamburger::before,.hamburger::after{content:"";position:absolute;left:0;width:22px;height:2px;background:var(--text)}
.hamburger::before{top:-7px}
.hamburger::after{top:7px}

/* HERO / CARRUSEL */
.hero{padding:0; position:relative; z-index:0;}
.carousel{position:relative;overflow:hidden;width:100%;border-bottom:1px solid rgba(30,40,50,0.03); z-index:0;}
.slides{display:flex;width:100%;transition:transform 600ms ease;will-change:transform; position:relative; z-index:0;}
.slide{position:relative;user-select:none;flex-shrink:0;display:block}
.slide-image{display:block;width:100%;height:640px;object-fit:cover;vertical-align:middle}

/* Overlay único */
.hero-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  pointer-events:none;
  background: transparent;
  z-index:20; /* overlay solo encima del hero */
}
.hero-content{
  pointer-events:auto;
  max-width:640px;
  margin-left:64px;
  background: rgba(0,0,0,0.55);
  color:#fff;
  padding:28px;
  border-radius:12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.hero-title{font-size:40px;margin:0 0 8px;color:#fff;line-height:1.05}
.hero-subtitle{color:rgba(255,255,255,0.95);margin:0 0 16px;max-width:58ch;font-weight:700}
.hero-ctas{display:flex;gap:12px;align-items:center}

/* Buttons */
.btn{display:inline-block;text-decoration:none;padding:12px 18px;border-radius:10px;font-weight:600;border:1px solid transparent;transition:all var(--transition);cursor:pointer}
.btn-primary{background:var(--accent);color:#fff}
.btn-outline{background:transparent;color:#fff;border-color:rgba(255,255,255,0.18)}
.btn:hover{transform:translateY(-3px)}

/* Carousel controls */
.carousel-control{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  background:rgba(0,0,0,0.45);
  color:#fff;
  border:0;
  width:44px;
  height:44px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:30;
}
.carousel-control.prev{left:18px}
.carousel-control.next{right:18px}
.carousel-control:focus{outline:2px solid rgba(255,255,255,0.2)}

/* Dots */
.carousel-dots{position:absolute;left:50%;transform:translateX(-50%);bottom:18px;display:flex;gap:8px;z-index:30}
.dot{width:12px;height:12px;border-radius:50%;background:rgba(255,255,255,0.45);border:0;cursor:pointer}
.dot.active{background:var(--accent)}

/* SECTIONS: spacing and backgrounds */
section { width:100%; box-sizing:border-box; padding: 72px 0; display:block; position:relative; z-index:1; }
.section-bg-white { background-color: var(--surface); }
.section-bg-gray  { background-color: var(--muted-1); }

/* Prevent anchor being hidden by fixed header */
:target { scroll-margin-top:96px; }

/* Reusable section header and description */
.section-header-centered { text-align:center; margin-bottom:8px; }
.section-header-centered h2 { font-size:32px; margin:0; }
.section-description-wrap { max-width:100%; margin:18px 0 6px; }
.section-description { margin:0 auto; color:var(--muted-text); font-size:16px; line-height:1.6; text-align:left; }

/* Cards grid */
.section-cards{
  margin-top:26px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
  align-items:stretch;
}
.section-card{
  background:var(--surface);
  border:1px solid rgba(30,40,50,0.06);
  padding:28px;
  border-radius:14px;
  box-shadow:var(--shadow-sm);
  min-height:200px;
  display:flex;
  flex-direction:column;
}
.section-card h3{ margin:0 0 12px; font-size:20px }
.section-card p{ margin:0; color:var(--muted-text); line-height:1.6; flex:1 }

/* Product media: reserved area for images */
.product-media-row { margin-top:22px; }
.product-card .product-media,
.section-card .product-media {
  margin-top:14px;
  background: var(--muted-2);
  border-radius:10px;
  height:160px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  color: var(--muted-text);
  font-weight:600;
  font-size:14px;
  border: 1px dashed rgba(30,40,50,0.06);
}
.product-media img { width:100%; height:100%; object-fit:cover; display:block; }

/* WHY section: fixed background with dark overlay; cards remain white */
.why {
  position: relative;
  overflow: hidden;
  color: #fff;
  background-image: url("images/why-bg.jpg");
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index:0;
}
.why::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index:0;
}
.why .why-content { position: relative; z-index: 2; color: #fff; }
.why .section-description, .why .section-header-centered h2 { color: #fff; }
.why .section-card { background: var(--surface); color: var(--text); border-color: rgba(30,40,50,0.06); z-index:3; box-shadow:var(--shadow-sm); }

/* Contact grid and form */
.contact-grid{display:grid;grid-template-columns:1fr 320px;gap:28px;align-items:start}
.form-row{margin-bottom:12px}
label{display:block;margin-bottom:6px;font-weight:600;font-size:14px}
input[type="text"],input[type="email"],textarea{
  width:100%;
  padding:12px;
  border-radius:8px;
  border:1px solid #d8dde6;
  background:var(--surface);
  color:var(--text);
  font-size:14px;
}

/* Form actions spacing: adds gap between buttons and the map */
.form-actions{display:flex;gap:12px;margin-top:10px;margin-bottom:32px}
.btn-ghost{background:transparent;border:1px solid #d8dde6;color:var(--muted-text)}

/* CAPTCHA styles */
.captcha-row { display:flex; align-items:center; gap:12px; margin-top:8px; }
.captcha-box { display:flex; align-items:center; gap:10px; }
.captcha-num {
  display:inline-block;
  min-width:28px;
  text-align:center;
  font-weight:700;
  font-size:18px;
  background:rgba(255,255,255,0.06);
  padding:8px 10px;
  border-radius:6px;
  color:var(--text);
  border:1px solid rgba(30,40,50,0.02);
}
.captcha-plus { font-size:18px; color:var(--muted-text); }
#captcha-input { width:88px; padding:8px 10px; border-radius:8px; border:1px solid #d8dde6; }

/* Feedback messages */
.form-feedback { margin-top:8px; min-height:20px; }
.feedback-success { color: green; font-weight:700; }
.feedback-error { color: crimson; font-weight:700; }

/* MAP full-width */
.map-full{ width:100%; box-sizing:border-box; margin-top:12px; z-index:0; }
.map-iframe{ display:block; width:100%; height:420px; border:0; }
@media (max-width:600px){ .map-iframe{height:300px} }

/* Footer */
.site-footer{border-top:1px solid rgba(30,40,50,0.04);padding:18px 0; background:var(--surface); z-index:0}
.footer-inner{display:flex;justify-content:space-between;align-items:center;gap:12px}
.footer-inner p{margin:0}
.footer-links{list-style:none;margin:0;padding:0;display:flex;gap:12px}
.footer-links a{color:var(--muted-text);text-decoration:none}
.dev-link{ color: var(--accent); text-decoration:none; font-weight:700 }
.dev-link:hover{ text-decoration:underline }

/* Mobile fallback: background-attachment fixed behaves inconsistently on mobile */
@media (max-width:768px){
  .why { background-attachment: scroll; background-position: center top; }
  .why::before { background: rgba(0,0,0,0.55); }
  .captcha-row { flex-direction:column; align-items:flex-start; }
  #captcha-input { width:100%; }
}

/* Responsive adjustments */
@media (max-width:1024px){
  .slide-image{height:520px}
  .hero-content{margin-left:40px;max-width:520px}
  .section-cards{grid-template-columns:repeat(2,1fr)}
  .section-description{font-size:15px}
  .contact-grid{grid-template-columns:1fr}
  .product-card .product-media{height:140px}
}
@media (max-width:600px){
  .header-inner{padding:12px 18px}
  .nav-toggle{display:block}
  .site-nav{position:fixed;top:68px;right:18px;background:var(--surface);border-radius:12px;box-shadow:var(--shadow-sm);padding:12px;display:none;min-width:200px}
  .site-nav.open{display:block}
  .nav-list{flex-direction:column;gap:8px}

  .slide-image{height:420px}
  .hero-overlay{align-items:flex-end}
  .hero-content{margin-left:0;margin-right:0;margin-bottom:22px;background:rgba(0,0,0,0.6);padding:18px;max-width:92%;width:auto;border-radius:10px}
  .hero-title{font-size:22px}
  .hero-subtitle{font-size:14px}

  .section-cards{grid-template-columns:1fr;gap:16px}
  .section-card{min-height:auto;padding:18px}
  .section-description{font-size:14px}

  .contact-grid{grid-template-columns:1fr}
  .footer-inner{flex-direction:column;gap:8px}
  .container{width:calc(100% - 36px)}
}

/* WhatsApp floating button (coloca al final de styles.css) */
.whatsapp-float{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:140; /* por encima del header y demás elementos */
  width:56px;
  height:56px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#25D366,#128C7E); /* tono whatsapp */
  color:#fff;
  border-radius:50%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  text-decoration:none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  opacity:0.98;
}
.whatsapp-float svg{ width:26px; height:26px; display:block; }
.whatsapp-float:hover{ transform:translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.28); }

/* Ajustes en pantallas pequeñas si quieres separarlo del borde */
@media (max-width:600px){
  .whatsapp-float{ right:14px; bottom:14px; width:52px; height:52px; }
  .whatsapp-float svg{ width:22px; height:22px; }
}

/* Utilities */
.hidden{display:none}