/* ===== VARIABLES ===== */
:root {
  --green: #22C55E;
  --blue: #1E40AF;
  --orange: #F97316;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; }

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ===== HERO GRADIENT ===== */
.hero-bg { background: linear-gradient(135deg, #1e3a8a 0%, #1E40AF 40%, #166534 100%); }

/* ===== SECTION HEADING UNDERLINE ===== */
.section-heading { position: relative; }
.section-heading::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 2px;
  margin: 12px auto 0;
}
.section-heading-left::after { margin: 12px 0 0; }

/* ===== CARD HOVER ===== */
.card-hover { transition: transform 0.22s ease, box-shadow 0.22s ease; }
.card-hover:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.10); }

/* ===== RANGE SLIDER ===== */
input[type=range] {
  -webkit-appearance: none;
  width: 100%; height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(34,197,94,.4);
}
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(34,197,94,.4);
  border: none;
}

/* ===== FORM FIELDS ===== */
.form-field {
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 11px 16px;
  width: 100%;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: white;
  color: #111827;
}
.form-field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,64,175,.1); }
.form-field.invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.form-field::placeholder { color: #9ca3af; }

/* ===== STEP PANELS ===== */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeUp 0.35s ease; }

/* ===== PROGRESS BAR ===== */
.progress-bar { transition: width 0.45s cubic-bezier(.4,0,.2,1); background: linear-gradient(90deg, var(--blue), var(--green)); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.animate-fade-up { animation: fadeUp 0.5s ease forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }

/* ===== TOAST ===== */
.toast { animation: slideInRight 0.3s ease; }

/* ===== SERVICE CARD ICON BG ===== */
.icon-bg-blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.icon-bg-green { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.icon-bg-orange { background: linear-gradient(135deg, #fff7ed, #ffedd5); }

/* ===== MODAL ===== */
.modal-bg { background: rgba(0,0,0,.65); backdrop-filter: blur(5px); }

/* ===== BLOG CARD IMAGE PLACEHOLDER ===== */
.blog-img {
  background: linear-gradient(135deg, #1e3a8a, #166534);
  width: 100%; height: 200px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== ADMIN TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--blue);
  color: white;
  text-align: left;
  padding: 12px 14px;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: .8125rem;
  color: #374151;
}
.data-table tr:hover td { background: #f8fafc; }

/* ===== STEP DOTS ===== */
.step-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  transition: all 0.3s ease;
}
.step-dot.done { background: var(--blue); color: white; }
.step-dot.current { background: var(--green); color: white; box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.step-dot.pending { background: #e2e8f0; color: #9ca3af; }

/* ===== STAT CARD ===== */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid #f1f5f9;
  transition: transform .2s ease;
}
.stat-card:hover { transform: translateY(-3px); }

/* ===== NAV ACTIVE ===== */
.nav-active { color: #1E40AF !important; font-weight: 700 !important; }

/* ===== CASE RESULT NUMBERS ===== */
.result-number { font-size: 2.5rem; font-weight: 900; line-height: 1; }

/* ===== MOBILE NAV OPEN ===== */
@media (max-width: 767px) {
  .hero-bg { padding-top: 5rem; padding-bottom: 4rem; }
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1f2937;
  border-top: 1px solid #374151;
  padding: 16px 24px;
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 -4px 30px rgba(0,0,0,.25);
}
.cookie-banner--visible { transform: translateY(0); }

/* ===== CAROUSEL ===== */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  background: #111827;
  height: 300px;
}
@media (max-width: 640px) { .carousel-wrapper { height: 200px; } }
@media (max-width: 768px) { .carousel-wrapper { height: 240px; } }

#carouselTrack {
  display: flex;
  height: 100%;
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
  cursor: zoom-in;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.carousel-slide:hover img { transform: scale(1.02); }

/* Dots */
.carousel-dot {
  width: 10px; height: 10px;
  border-radius: 5px;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.carousel-dot--active {
  width: 28px;
  background: #1E40AF;
}

/* Carousel nav buttons */
.carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  z-index: 10;
  transition: all 0.2s ease;
  color: #374151;
}
.carousel-btn:hover { background: white; box-shadow: 0 6px 20px rgba(0,0,0,.22); transform: translateY(-50%) scale(1.05); }
.carousel-btn--prev { left: 14px; }
.carousel-btn--next { right: 14px; }

/* Counter badge */
.carousel-counter {
  position: absolute;
  bottom: 14px; right: 14px;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  z-index: 10;
}

/* ===== PRESUPUESTO: SERVICE / OPTION BUTTONS ===== */

/*
  Comportamiento final acordado:
  - Sin seleccionar + hover → fondo azul pálido, texto oscuro
  - Seleccionado (bg-blue-800) → fondo azul oscuro, texto BLANCO (legible)
*/

/* Hover sobre botón NO seleccionado */
.servicio-btn:not(.bg-blue-800):hover {
  background-color: #eff6ff;
  border-color: #1e40af;
  color: #111827;
}

/* Estado seleccionado: azul oscuro + texto blanco */
.servicio-btn.bg-blue-800 {
  color: #ffffff;
}
.servicio-btn.bg-blue-800:hover {
  background-color: #1e3a8a;
  color: #ffffff;
}
.servicio-btn.bg-blue-800 span {
  color: rgba(255, 255, 255, 0.85);
}

/* Hover sobre municipio no seleccionado */
.municipio-btn:not(.bg-blue-50):hover {
  background-color: #eff6ff;
  border-color: #1e40af;
}

/* Checkboxes / labels de extras */
input[type="checkbox"] {
  accent-color: #1E40AF;
  cursor: pointer;
}

/* Range slider focus */
input[type="range"]:focus {
  outline: 2px solid #1E40AF;
  outline-offset: 3px;
}

/* Select y textareas — focus */
select.form-field:focus,
textarea.form-field:focus {
  background-color: #ffffff;
  color: #111827;
}

/* ===== LEGAL PAGES ===== */
.legal-content h2 { font-size: 1.35rem; font-weight: 800; color: #111827; margin: 2rem 0 .75rem; }
.legal-content h3 { font-size: 1.1rem; font-weight: 700; color: #1E40AF; margin: 1.5rem 0 .5rem; }
.legal-content p  { color: #4b5563; line-height: 1.8; margin-bottom: 1rem; }
.legal-content ul { color: #4b5563; line-height: 1.8; margin-bottom: 1rem; padding-left: 1.5rem; list-style: disc; }
.legal-content li { margin-bottom: .4rem; }
.legal-content a  { color: #1E40AF; text-decoration: underline; }
.legal-content .legal-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .75rem; padding: 1.25rem 1.5rem; margin: 1.25rem 0; }

/* ===== PRESUPUESTO: SELECCIÓN AZUL + TEXTO BLANCO ===== */
.presupuesto-option.selected {
  background-color: #1E40AF;
  color: #FFFFFF;
  border-color: #1E40AF;
}
.presupuesto-option.selected h3,
.presupuesto-option.selected p,
.presupuesto-option.selected span {
  color: #FFFFFF;
}
.presupuesto-option.selected .option-icon {
  background-color: rgba(255,255,255,0.2);
  color: #FFFFFF;
}

/* ===== PUEBLOS FOOTER ===== */
.pueblos-footer {
  background-color: #f9fafb;
  padding: 40px 20px;
  border-top: 1px solid #e5e7eb;
}
.pueblos-container { max-width: 1200px; margin: 0 auto; }
.pueblos-footer h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 16px; color: #1f2937; }
.pueblos-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.pueblos-links li { margin: 0; }
.pueblos-links a { color: #1E40AF; text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.pueblos-links a:hover { color: #22C55E; text-decoration: underline; }
