/* ═══════════════════════════════════════════════════
   LAVAITO.CL — Estilo inspirado en el WordPress original
   Lavado ecológico a domicilio
   ═══════════════════════════════════════════════════ */

/* ─── Variables de color (igual que lavaito.cl) ─── */
:root {
  --primary: #008BCB;
  --primary-dark: #006b9e;
  --primary-bg: #008BCB;
  --accent: #00A693;
  --accent-hover: #008B7A;
  --bg-page: #FFFFFF;
  --bg-white: #ffffff;
  --bg-alt: #f5f7fa;
  --text-body: #4e4e4f;
  --text-heading: #1D1D1B;
  --text-muted: #7c85a3;
  --text-dark: #000000;
  --border: #e2e8f0;
  --border-input: #d3d3d3;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 30px rgba(0,139,203,0.10);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--text-heading); line-height: 1.25; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* ─── Container ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Animación ─── */
.animate-fade-in { animation: fadeUp .6s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════ */
.navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky; top: 0; z-index: 1000;
}
.nav-content {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; max-width: 1200px; margin: 0 auto;
}
.navbar a { color: var(--text-heading); text-decoration: none; }
/* .navbar a:hover { color: var(--primary); } */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════
   BOTONES (compatibles con booking)
   ═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius); font-size: 1rem;
  font-weight: 600; font-family: inherit; line-height: 1;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .25s ease;
}
.btn-primary {
  background: var(--primary) !important; color: #0a0a0a !important;
  border: none !important;
}
.btn-primary:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,130,203,0.25);
}
.btn-outline {
  background: transparent; color: var(--text-heading);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 16px; font-size: .9rem; }

/* ═══════════════════════════════════════════════════
   GLASS CARD
   ═══════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ═══════════════════════════════════════════════════
   FORMULARIOS (⚠ CRÍTICO: booking.php usa estas clases)
   ═══════════════════════════════════════════════════ */
.form-group {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
}
.form-group label {
  color: var(--text-heading); font-weight: 600; font-size: .9rem;
  display: flex; align-items: center; gap: 6px;
}

/* ⚠ booking.php usa .form-control directamente */
.form-control {
  width: 100%; padding: 13px 16px; margin: 0 !important;
  background: var(--bg-white);
  border: 2px solid var(--border-input) !important;
  border-radius: var(--radius) !important;
  color: var(--text-body) !important; font-size: 1rem;
  font-family: inherit; transition: border-color .2s ease;
}
.form-control:focus {
  outline: none; border-color: var(--text-muted) !important;
}
.form-control::placeholder { color: #94a3b8; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234e4e4f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

/* ═══════════════════════════════════════════════════
   BOOKING: step circles, slots
   ═══════════════════════════════════════════════════ */
.step-circle {
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  border-color: var(--border) !important; background: var(--bg-white) !important;
  color: var(--text-body) !important;
}
.active-step .step-circle {
  background: var(--primary) !important; border-color: var(--primary) !important;
  color: #fff !important; transform: scale(1.15);
  box-shadow: 0 0 20px rgba(0,130,203,.3);
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(0,0,0,.08); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.slot-btn {
  padding: .9rem .5rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-white);
  color: var(--text-body); font-weight: 600; cursor: pointer;
  transition: all .2s ease;
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
}
.slot-btn:hover { border-color: var(--accent); }
.slot-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════ */
.alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem;
}
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #059669; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: var(--primary-dark); }

/* ═══════════════════════════════════════════════════
   TABLAS
   ═══════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
table th {
  background: #f8fafc; padding: 12px 14px; text-align: left;
  color: var(--text-muted); font-weight: 600; font-size: .85rem;
  border-bottom: 2px solid var(--border);
}
table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-body); }
table tr:hover { background: rgba(0,130,203,.02); }

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
}
.badge-primary { background: #e0f2fe; color: var(--primary-dark); }
.badge-success { background: #d1fae5; color: #059669; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }

/* ═══════════════════════════════════════════════════
   FAQ
   ═══════════════════════════════════════════════════ */
details.glass-card summary::-webkit-details-marker { display: none; }
details.glass-card[open] { border-color: var(--primary); border-width: 2px; }
details.glass-card summary {
  cursor: pointer; user-select: none; font-weight: 600; font-size: 1.05rem;
  color: var(--text-heading); display: flex; justify-content: space-between; align-items: center;
}
details.glass-card summary:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
footer {
  padding: 3rem 0; text-align: center;
  border-top: 1px solid var(--border); background: var(--bg-white);
}
footer p { color: var(--text-muted); font-size: .9rem; }

/* ═══════════════════════════════════════════════════
   LAYOUT HERO / SECTIONS (solo para index.php)
   ═══════════════════════════════════════════════════ */
.hero-wrap {
  padding: 5rem 0 4rem;
}
.hero-wrap h1 { font-size: 3rem; color: var(--text-dark); }
.hero-wrap h1 span { color: var(--primary); }
.hero-wrap p { font-size: 1.15rem; color: var(--text-body); max-width: 560px; }

.section-label {
  color: var(--primary); font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: .4rem; font-size: .85rem;
}
.section-heading { font-size: 2.2rem; color: var(--text-dark); }

.bg-alt   { background: #f5f7fa; }
.bg-white { background: var(--bg-white); }

/* CTA azul */
.cta-blue {
  background: var(--primary-bg); color: #fff; padding: 3.5rem 0; text-align: center;
}
.cta-blue h2 { color: #fff; font-size: 2rem; }
.cta-blue p { color: rgba(255,255,255,.88); max-width: 480px; margin: 0 auto 1.5rem; }
.cta-btn-green {
  background: var(--accent); color: #fff; padding: .9rem 2rem;
  border-radius: var(--radius); font-weight: 600; display: inline-flex;
  align-items: center; gap: 8px; border: none; cursor: pointer;
  text-decoration: none; transition: opacity .2s;
}
.cta-btn-green:hover { opacity: .9; color: #fff; }
.cta-btn-outline-white {
  background: transparent; color: #fff; padding: .9rem 2rem;
  border-radius: var(--radius); font-weight: 600; display: inline-flex;
  align-items: center; gap: 8px; border: 2px solid rgba(255,255,255,.5);
  text-decoration: none; transition: border-color .2s;
}
.cta-btn-outline-white:hover { border-color: #fff; color: #fff; }

/* Grid helpers */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.grid-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.5rem; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════════════════ */

/* Tablets y pantallas medianas */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
  .hero-wrap h1 { font-size: 2.4rem; }
  .section-heading { font-size: 1.8rem; }
}

/* Móviles */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .navbar { padding: 0 16px; }
  .nav-content { flex-wrap: wrap; gap: 10px; }

  .grid-4 { grid-template-columns: 1fr; }

  .hero-wrap { padding: 3rem 0 2rem; }
  .hero-wrap h1 { font-size: 1.8rem; }
  .hero-wrap p { font-size: 1rem; }

  .section-heading { font-size: 1.5rem; }

  .cta-blue h2 { font-size: 1.5rem; }
  .cta-blue .btn, .cta-blue a { width: 100%; justify-content: center; }

  /* Footer contact grid */
  section.bg-white > .container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 400px) {
  .hero-wrap h1 { font-size: 1.5rem; }
  .btn { padding: 10px 18px; font-size: .9rem; }
}

/* =====================================================
   PANEL ADMIN - Responsive (solo dentro de páginas admin)
   Convierte tablas en tarjetas apiladas en móvil
   ===================================================== */
.bg-gray-50.flex table { min-width: 0; }

/* En pantallas menores a md (768px), convertir filas de tabla en tarjetas */
@media (max-width: 767px) {
  /* Hacer que las tablas del admin dentro de tarjetas no desborden */
  .bg-gray-50.flex .overflow-x-auto,
  .bg-gray-50.flex table { overflow-x: visible; }

  /* Tablas que no tienen versión móvil dedicada: mostrar como bloques apilados */
  .bg-gray-50.flex table { display: block; width: 100%; }
  .bg-gray-50.flex table thead { display: none; }
  .bg-gray-50.flex table tbody { display: block; width: 100%; }
  .bg-gray-50.flex table tbody tr {
    display: block;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .bg-gray-50.flex table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: none;
    text-align: right;
    font-size: 13px;
  }
  /* Etiquetas de celda usando data-label (si aplica) */
  .bg-gray-50.flex table tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .05em;
    text-align: left;
  }

  /* Ajustar botones/acciones dentro de las filas */
  .bg-gray-50.flex table tbody td:last-child { justify-content: flex-end; }
  .bg-gray-50.flex table tbody td form { display: inline-flex; gap: 6px; flex-wrap: wrap; }

  /* Contenedores de tabla con scroll: quitar el scroll lateral */
  .bg-gray-50.flex .overflow-x-auto {
    overflow-x: visible;
    -webkit-overflow-scrolling: auto;
  }

  /* Asegurar que el main no desborde en celular */
  .bg-gray-50.flex main { overflow-x: hidden; }
  .bg-gray-50.flex aside, .bg-gray-50.flex .w-64 { position: static; height: auto; }
}
