/*
 * styles.css — Satélite /cerrajero/ · Cerrajeros Baratos
 * Colores: #0f1729 (azul oscuro) · #f7f4ee (crema) · #e8a13d (ámbar)
 *          #b07a24 (ámbar oscuro) · #fdf2dc (crema claro) · #1a7a3c (verde)
 * Fuentes:  DM Serif Display (títulos) · Manrope (cuerpo)
 * Prefijo:  cb-
 */

/* ─── RESET & BASE ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background: #f7f4ee;
  color: #0f1729;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ─── TIPOGRAFÍA ──────────────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.2;
  color: #0f1729;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.05rem; font-family: 'Manrope', sans-serif; font-weight: 700; }

a { color: #0f1729; transition: color 0.2s; }
a:hover { color: #b07a24; }

/* ─── CONTENEDOR ──────────────────────────────────────────────────────────── */
.cb-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── BARRA STICKY (solo móvil) ──────────────────────────────────────────── */
.cb-sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
}
.cb-sticky-bar.cb-visible { transform: translateY(0); }

.cb-sticky-tel,
.cb-sticky-wa {
  flex: 1;
  padding: 1rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.cb-sticky-tel {
  background: #e8a13d;
  color: #0f1729;
}
.cb-sticky-wa {
  background: #1a7a3c;
  color: #fff;
}

/* ─── NAVEGACIÓN ──────────────────────────────────────────────────────────── */
.cb-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #0f1729;
}
.cb-logo {
  font-family: 'DM Serif Display', serif;
  color: #f7f4ee;
  font-size: 1.2rem;
  text-decoration: none;
}
.cb-logo:hover { color: #e8a13d; }
.cb-nav-tel {
  color: #e8a13d;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
}
.cb-nav-tel:hover { color: #fdf2dc; }

/* ─── HERO ────────────────────────────────────────────────────────────────── */
.cb-hero {
  background: linear-gradient(140deg, #0f1729 55%, #152038 100%);
  color: #f7f4ee;
  padding-bottom: 2rem;
}
.cb-hero__body {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
}
.cb-hero--listing .cb-hero__body {
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 2rem;
}
.cb-hero__h1 {
  color: #f7f4ee;
  margin-bottom: 0.5rem;
}
.cb-hero__sub {
  color: #aab4c8;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.cb-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cb-tel-link {
  color: #e8a13d;
  font-weight: 700;
  text-decoration: none;
}

/* ─── MIGAS DE PAN ────────────────────────────────────────────────────────── */
.cb-breadcrumb {
  font-size: 0.82rem;
  color: #7a8ca3;
  margin-bottom: 1rem;
}
.cb-breadcrumb a {
  color: #7a8ca3;
  text-decoration: none;
}
.cb-breadcrumb a:hover { color: #e8a13d; }

/* ─── BOTONES ─────────────────────────────────────────────────────────────── */
.cb-btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 0.4rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}
.cb-btn:hover  { opacity: 0.92; transform: translateY(-1px); }
.cb-btn:active { transform: translateY(0); }

.cb-btn--primary {
  background: #e8a13d;
  color: #0f1729;
}
.cb-btn--wa {
  background: #1a7a3c;
  color: #fff;
}

/* ─── SECCIONES ───────────────────────────────────────────────────────────── */
.cb-section {
  padding: 3rem 0;
}
.cb-section + .cb-section {
  border-top: 1px solid rgba(15, 23, 41, 0.08);
}
.cb-section__title {
  margin-bottom: 1.5rem;
}

/* ─── INTRO ───────────────────────────────────────────────────────────────── */
.cb-intro-text p {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  max-width: 75ch;
}
.cb-intro-text strong { color: #0f1729; }

.cb-map-wrap {
  margin: 1.75rem 0 1.25rem;
  border-radius: 0.6rem;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.cb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cb-pill {
  background: #fdf2dc;
  color: #0f1729;
  padding: 0.35rem 0.8rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #e8d4a0;
}

/* ─── CUADRÍCULA DE SERVICIOS ─────────────────────────────────────────────── */
.cb-servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.cb-servicio {
  background: #fff;
  border: 1px solid rgba(15, 23, 41, 0.08);
  border-radius: 0.6rem;
  padding: 1.5rem;
  /* animación de entrada vía IntersectionObserver */
  opacity: 0;
  transform: translateY(16px);
  transition: box-shadow 0.2s;
}
.cb-servicio.cb-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.2s;
}
.cb-servicio:hover { box-shadow: 0 4px 18px rgba(15,23,41,0.12); }

.cb-servicio__icon {
  font-size: 1.9rem;
  display: block;
  margin-bottom: 0.75rem;
}
.cb-servicio__title {
  margin-bottom: 0.45rem;
  color: #0f1729;
}
.cb-servicio__desc {
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.5;
}

/* ─── TABLA DE PRECIOS ────────────────────────────────────────────────────── */
.cb-precios {
  background: #fdf2dc;
  border-radius: 0.75rem;
  padding: 2rem;
  border: 1px solid #e8d4a0;
}
.cb-precios__note {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1.25rem;
}
.cb-table-wrap { overflow-x: auto; }
.cb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.cb-table th,
.cb-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(15,23,41,0.08);
}
.cb-table th {
  background: #e8a13d;
  color: #0f1729;
  font-weight: 700;
  white-space: nowrap;
}
.cb-table tr:last-child td { border-bottom: none; }
.cb-table td:last-child {
  font-weight: 700;
  color: #b07a24;
  white-space: nowrap;
}
.cb-table tr:nth-child(even) td { background: rgba(232,161,61,0.06); }

/* ─── FAQ ─────────────────────────────────────────────────────────────────── */
.cb-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 800px;
}
.cb-faq-item {
  border: 1px solid rgba(15,23,41,0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.cb-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.97rem;
  list-style: none;
  user-select: none;
}
.cb-faq-q::-webkit-details-marker { display: none; }
.cb-faq-q::after {
  content: '▾';
  color: #e8a13d;
  margin-left: 1rem;
  flex-shrink: 0;
  font-size: 0.85rem;
}
details[open] .cb-faq-q::after { content: '▴'; }
.cb-faq-a {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.65;
}

/* ─── BLOQUE CTA CENTRAL ──────────────────────────────────────────────────── */
.cb-cta-block {
  background: linear-gradient(140deg, #0f1729, #152038);
  border-radius: 0.75rem;
  padding: 2.5rem;
  color: #f7f4ee;
  text-align: center;
}
.cb-cta-block h2 {
  color: #f7f4ee;
  margin-bottom: 0.75rem;
}
.cb-cta-block p {
  color: #aab4c8;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.cb-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ─── MUNICIPIOS CERCANOS ─────────────────────────────────────────────────── */
.cb-nearby-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
  list-style: none;
}
.cb-nearby-item {
  background: #fff;
  border: 1px solid rgba(15,23,41,0.08);
  border-radius: 0.4rem;
  padding: 0.8rem 1rem;
  transition: border-color 0.2s;
}
.cb-nearby-item:hover { border-color: #e8a13d; }
.cb-nearby-link {
  display: block;
  text-decoration: none;
  font-weight: 600;
  color: #0f1729;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}
.cb-nearby-link:hover { color: #b07a24; }
.cb-nearby-meta {
  font-size: 0.78rem;
  color: #9ca3af;
}
.cb-tier-1 .cb-nearby-link::before { content: '★ '; color: #e8a13d; }

/* ─── LISTADO DE MUNICIPIOS ───────────────────────────────────────────────── */
.cb-listing-index { padding: 2rem 0 3rem; }

.cb-provincia-group { margin-bottom: 2.5rem; }

.cb-comarca-title {
  font-size: 1.7rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8a13d;
}
.cb-comarca-group { margin-bottom: 1.5rem; }
.cb-comarca-subtitle {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.6rem;
}
.cb-muni-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.cb-muni-list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.cb-muni-item a {
  display: block;
  padding: 0.4rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(15,23,41,0.1);
  border-radius: 0.25rem;
  text-decoration: none;
  font-size: 0.875rem;
  color: #0f1729;
  transition: border-color 0.2s, color 0.2s;
}
.cb-muni-item a:hover {
  border-color: #e8a13d;
  color: #b07a24;
}
.cb-muni-item.cb-tier-1 a {
  font-weight: 700;
  border-color: rgba(232,161,61,0.4);
}
.cb-pop {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-left: 0.25rem;
}

/* ─── PÁGINA 404 ──────────────────────────────────────────────────────────── */
.cb-404-suggestions {
  padding: 2rem 0;
}
.cb-404-suggestions h2 {
  margin-bottom: 1.25rem;
}

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
.cb-footer {
  background: #0f1729;
  color: #aab4c8;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}
.cb-footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.cb-footer__col strong {
  color: #f7f4ee;
  display: block;
  margin-bottom: 0.6rem;
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
}
.cb-footer__col p {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  line-height: 1.6;
}
.cb-footer__col a {
  color: #aab4c8;
  text-decoration: none;
}
.cb-footer__col a:hover { color: #e8a13d; }
.cb-footer__copy {
  font-size: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  color: #6b7280;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */

/* Tabletas y escritorio: ocultar barra sticky */
@media (min-width: 768px) {
  .cb-sticky-bar {
    display: none;
  }
  /* Añadir padding inferior en móvil para que no tape contenido */
  body { padding-bottom: 0; }
}

@media (max-width: 767px) {
  body { padding-bottom: 60px; } /* espacio para barra sticky */

  .cb-hero__ctas .cb-btn {
    display: block;
    text-align: center;
    width: 100%;
  }
  .cb-hero__ctas {
    flex-direction: column;
  }

  .cb-servicios-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cb-precios {
    padding: 1.25rem;
  }

  .cb-cta-block {
    padding: 1.75rem 1.25rem;
    border-radius: 0;
  }
  .cb-cta-actions .cb-btn {
    display: block;
    width: 100%;
    text-align: center;
  }
  .cb-cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .cb-servicios-grid {
    grid-template-columns: 1fr;
  }
  .cb-section { padding: 2rem 0; }
  .cb-cta-block { margin: 0 -1.25rem; }
}
