/* =========================================================
   1. VARIABLES GLOBALES Y RESET
   ========================================================= */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-color: #ffffff;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text);
  line-height: 1.6;
}

img, iframe, object, embed {
  max-width: 100%;
}

/* =========================================================
   2. NAVBAR (ESCRITORIO Y TABLETS HORIZONTALES)
   ========================================================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  height: 70px;
  transition: transform 0.3s ease-in-out;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--text);
}

.logo span {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text);
  cursor: pointer;
  padding: 5px;
}

.nav-links a {
  margin-left: 20px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* =========================================================
   3. SECCIONES Y ANCLAJES (ESCRITORIO)
   ========================================================= */
#inicio {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 90px 5% 40px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  scroll-margin-top: 20px;
}

.badge {
  background: #eff6ff;
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 15px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* SECCIÓN GENERAL Y DIFUMINADO GLOBAL DE FONDOS CLAROS */
.section {
  padding: 90px 5%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* El difuminado suave se aplica tanto en PC como en móvil */
.section.bg-light {
  background: linear-gradient(to bottom, #ffffff, #f8fafc 15%, #f8fafc 85%, #ffffff);
}

#ejemplos { scroll-margin-top: 70px; }
#calculadora { scroll-margin-top: 70px; }
#faq { scroll-margin-top: 70px; }

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 10px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* =========================================================
   4. COMPONENTES (EJEMPLOS, CALCULADORA, FAQ)
   ========================================================= */
.cards-grid {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
}

.card-preview {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

.style-minimal { background: linear-gradient(135deg, #334155, #0f172a); }
.style-creative { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.style-corporate { background: linear-gradient(135deg, #1e40af, #0284c7); }

.card-body {
  padding: 20px;
}

.card-body h3 { margin: 0 0 10px 0; }
.card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.tag {
  background: var(--bg-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* CALCULADORA LAYOUT */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  max-width: 1100px;
  width: 100%;
  align-items: center;
}

.info-column h2 {
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 8px;
}

.info-lead {
  color: var(--text-muted);
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.info-card {
  display: flex;
  gap: 15px;
  margin-bottom: 16px;
  background: var(--card-bg);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.info-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.info-card h3 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
}

.info-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calculator-container {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.calculator-container h2 {
  margin-top: 5px;
  font-size: 1.35rem;
  margin-bottom: 5px;
}

.group-title {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.type-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.type-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.type-card input {
  position: absolute;
  opacity: 0;
}

.type-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.type-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.type-card input:checked + .type-card-content {
  border-color: var(--primary);
  background: #eff6ff;
}

.type-price {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.9rem;
}

.hidden { display: none !important; }

.webapp-notice {
  background: #fffbebfb;
  border: 1px solid #fef08a;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
}

.webapp-notice p {
  margin: 0;
  font-size: 0.85rem;
  color: #854d0e;
  line-height: 1.4;
}

.form-group { margin-bottom: 15px; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.88rem;
}

.checkbox-item:hover { background: var(--bg-light); }

.checkbox-label-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-item input { margin-right: 4px; }

/* TOOLTIPS BASE (ESCRITORIO) */
.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-badge {
  width: 17px;
  height: 17px;
  background-color: var(--text-muted);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: background 0.2s;
}

.info-badge:hover {
  background-color: var(--primary);
}

.tooltip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  background-color: var(--text);
  color: #fff;
  text-align: left;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: normal;
  line-height: 1.35;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--text) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-box {
  visibility: visible;
  opacity: 1;
}

/* CAJA PRECIO Y BOTÓN */
.price-box {
  margin-top: 10px;
  padding: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  text-align: center;
}

.price-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 2px 0;
}

.btn-whatsapp {
  display: block;
  width: 100%;
  background-color: #25d366;
  color: white;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-whatsapp:hover { background-color: #1eb954; }

/* FAQ */
.faq-container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item[open] { border-color: var(--primary); }

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: bold;
  transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
  padding: 0 20px 16px 20px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--bg-color);
}

/* =========================================================
   5. ADAPTACIÓN RESPONSIVE MÓVIL (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {
  .section {
    padding: 70px 5%;
  }

  .menu-toggle { display: block; }

  .nav-links {
    display: flex;
    position: fixed;
    top: 70px;
    right: 0;
    width: 220px;
    height: calc(100vh - 70px);
    background: #ffffff;
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 25px 20px;
    gap: 20px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    z-index: 99;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
  }

  .nav-links.active { transform: translateX(0); }

  .nav-links a {
    margin-left: 0;
    font-size: 1rem;
  }

  .hero {
    min-height: calc(100dvh - 70px);
    padding: 40px 5% 30px;
  }

  .hero h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .info-column { display: none; }

  .calculator-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tooltip-box {
    width: 170px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 135%;
  }

  .tooltip-box::after {
    left: 50%;
    margin-left: -5px;
  }

  /* Saltos ajustados a -70px en móvil como has configurado */
  #inicio { scroll-margin-top: -70px; }
  #ejemplos { scroll-margin-top: -70px; }
  #calculadora { scroll-margin-top: -70px; }
  #faq { scroll-margin-top: -70px; }

  .navbar.hidden-nav {
    transform: translateY(-100%);
  }
}

/* =========================================================
   6. OCULTAR TOOLTIPS EN VISTAS HORIZONTALES (≥ 901px)
   ========================================================= */
@media (min-width: 901px) {
  .type-selector .tooltip-container {
    display: none !important;
  }
}