/* ============================================================
   Marín Cerrajeros — hoja de estilos
   Colores de marca: rojo #A62A2D · negro #1A171B
   ============================================================ */

:root {
  --rojo: #4B0C1C;          /* granate del logo */
  --rojo-oscuro: #6B1830;   /* granate claro para hover */
  --dorado: #D2AA6F;
  --dorado-oscuro: #B98F55;
  --dorado-claro: #E7C48F;
  --negro: #1A171B;
  --tinta: #2B272C;
  --gris: #6B6468;
  --gris-claro: #E9E5E2;
  --crema: #FAF8F5;
  --blanco: #FFFFFF;
  --sombra: 0 2px 14px rgba(26, 23, 27, .10);
  --radio: 10px;
  --ancho: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--tinta);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .btn, .nav a, .logo-texto {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  text-transform: uppercase;
  letter-spacing: .02em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; font-weight: 700; color: var(--negro); }
h3 { font-size: 1.35rem; font-weight: 600; color: var(--negro); }

img { max-width: 100%; display: block; }

a { color: var(--rojo); }

.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 22px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-rojo { background: var(--rojo); color: #fff; }
.btn-rojo:hover { background: var(--rojo-oscuro); }
.btn-borde { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn-borde:hover { background: rgba(255,255,255,.12); }
.btn-borde-oscuro { background: transparent; color: var(--negro); border-color: var(--negro); }
.btn-borde-oscuro:hover { background: var(--negro); color: #fff; }

/* ---------- Barra superior ---------- */
.barra-top {
  background: var(--rojo);
  color: #E3CFC0;
  font-size: .88rem;
  padding: 6px 0;
}
.barra-top .contenedor { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.barra-top a { color: #fff; text-decoration: none; }
.barra-top a:hover { text-decoration: underline; }
.barra-top .tel-lista { display: flex; gap: 18px; }

/* ---------- Cabecera ---------- */
.cabecera {
  background: var(--blanco);
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 8px rgba(26,23,27,.08);
}
.cabecera .contenedor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
}
.marca { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.marca img { height: 54px; width: auto; }
.logo-texto { font-size: 1.45rem; font-weight: 700; color: var(--negro); line-height: 1; }
.logo-texto span { color: var(--rojo); }

.nav ul { list-style: none; display: flex; gap: 4px; }
.nav a {
  display: block;
  padding: 10px 12px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--negro);
  text-decoration: none;
  border-radius: 6px;
}
.nav a:hover { color: var(--rojo); }
.nav a.activo { color: var(--rojo); }
.nav a.nav-cta { background: var(--rojo); color: #fff; margin-left: 8px; }
.nav a.nav-cta:hover { background: var(--rojo-oscuro); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 26px; height: 3px;
  background: var(--negro);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

@media (max-width: 1020px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--blanco);
    box-shadow: 0 12px 20px rgba(26,23,27,.12);
    display: none;
  }
  .nav.abierto { display: block; }
  .nav ul { flex-direction: column; padding: 10px 16px 18px; }
  .nav a { padding: 12px 10px; font-size: 1.15rem; }
  .nav a.nav-cta { margin-left: 0; text-align: center; }
}

/* ---------- Héroe ---------- */
.heroe {
  position: relative;
  color: #fff;
  display: flex;
  align-items: center;
  min-height: 520px;
  isolation: isolate;
  overflow: hidden;
}
.heroe::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(43,6,15,.90) 15%, rgba(43,6,15,.55) 55%, rgba(26,23,27,.30));
  z-index: 1;
}
.heroe img.fondo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.heroe .contenedor { position: relative; z-index: 2; padding-top: 64px; padding-bottom: 64px; }
.heroe .sub {
  font-size: 1.25rem;
  max-width: 620px;
  margin: 18px 0 30px;
  color: #EFEAE6;
}
.heroe .acciones { display: flex; gap: 14px; flex-wrap: wrap; }
.heroe .kicker {
  display: inline-block;
  color: var(--dorado-claro);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .92rem;
  margin-bottom: 10px;
}

/* Cabecera de página interior */
.pagina-cab {
  background: var(--rojo);
  color: #fff;
  padding: 56px 0 48px;
}
.pagina-cab h1 { color: #fff; }
.pagina-cab .intro { max-width: 760px; margin-top: 16px; font-size: 1.13rem; color: #EBDCD2; }
.pagina-cab .intro strong { color: var(--dorado-claro); }
.miga { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: #C9A48F; margin-bottom: 12px; }
.miga a { color: #C9A48F; text-decoration: none; }
.miga a:hover { color: #fff; }

/* ---------- Secciones ---------- */
.seccion { padding: 68px 0; }
.seccion-alt { background: var(--blanco); }
.seccion-cab { max-width: 720px; margin-bottom: 38px; }
.seccion-cab p { margin-top: 12px; color: var(--gris); font-size: 1.08rem; }
.linea-roja {
  width: 54px; height: 4px;
  background: var(--dorado);
  border-radius: 2px;
  margin-bottom: 16px;
}

/* ---------- Tarjetas de servicios (home) ---------- */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}
.tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  text-decoration: none;
  color: var(--tinta);
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.tarjeta:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(26,23,27,.16); }
.tarjeta img { height: 185px; width: 100%; object-fit: cover; }
.tarjeta .cuerpo { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tarjeta h3 { color: var(--negro); }
.tarjeta p { font-size: .98rem; color: var(--gris); flex: 1; }
.tarjeta .mas { color: var(--rojo); font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Bloques de servicio (páginas de material) ---------- */
.bloques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.bloque {
  background: var(--blanco);
  border-radius: var(--radio);
  border-top: 4px solid var(--dorado);
  box-shadow: var(--sombra);
  padding: 24px 24px 26px;
}
.bloque p { margin-top: 8px; color: var(--gris); font-size: .99rem; }

/* ---------- Sección con foto lateral ---------- */
.duo {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 46px;
  align-items: center;
}
.duo img { border-radius: var(--radio); box-shadow: var(--sombra); width: 100%; object-fit: cover; }
.duo .texto p { margin-top: 14px; color: var(--gris); font-size: 1.06rem; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; gap: 26px; } }

/* ---------- Tres columnas "por qué elegirnos" ---------- */
.columnas3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px;
}
.columna {
  background: var(--blanco);
  padding: 28px 26px;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.columna .num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--dorado-oscuro);
  line-height: 1;
  margin-bottom: 10px;
}
.columna p { margin-top: 8px; color: var(--gris); }

/* ---------- Galería ---------- */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.galeria figure {
  border-radius: var(--radio);
  overflow: hidden;
  background: var(--blanco);
  box-shadow: var(--sombra);
}
.galeria img { width: 100%; height: 230px; object-fit: cover; transition: transform .25s; }
.galeria figure:hover img { transform: scale(1.04); }
.galeria figcaption { padding: 12px 16px; font-size: .92rem; color: var(--gris); }

/* ---------- Banda CTA ---------- */
.cta-banda {
  background: linear-gradient(115deg, #5C1228, var(--rojo));
  color: #fff;
  padding: 58px 0;
}
.cta-banda .contenedor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
}
.cta-banda h2 { color: #fff; }
.cta-banda p { color: #EBD5C8; margin-top: 8px; font-size: 1.08rem; }
.cta-banda .acciones { display: flex; gap: 14px; flex-wrap: wrap; }
.cta-banda .btn-blanco { background: #fff; color: var(--rojo); }
.cta-banda .btn-blanco:hover { background: #F3EBEB; }

/* ---------- Nosotros ---------- */
.prosa { max-width: 780px; }
.prosa p { margin-bottom: 18px; font-size: 1.08rem; }
.prosa strong { color: var(--negro); }

/* ---------- Contacto ---------- */
.contacto-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 880px) { .contacto-grid { grid-template-columns: 1fr; } }

.form-tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 30px 28px;
}
.campo { margin-bottom: 18px; }
.campo label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--negro); font-size: .97rem; }
.campo input, .campo select, .campo textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gris-claro);
  border-radius: 6px;
  font: inherit;
  background: var(--crema);
  color: var(--tinta);
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--rojo);
  background: #fff;
}
.campo-consentimiento { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--gris); }
.campo-consentimiento input { width: auto; margin-top: 4px; }

.dato-linea { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.dato-linea .icono {
  flex: 0 0 42px; height: 42px;
  background: var(--rojo);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.dato-linea a { color: var(--tinta); text-decoration: none; }
.dato-linea a:hover { color: var(--rojo); }
.dato-linea .titulo { font-weight: 700; color: var(--negro); text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; }

.mapa-caja {
  margin-top: 26px;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  background: var(--negro);
  color: #fff;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.mapa-caja iframe { width: 100%; height: 380px; border: 0; display: block; }
.mapa-aviso p { color: #CFC9C5; font-size: .92rem; max-width: 420px; margin: 12px auto 18px; }

/* ---------- Pie ---------- */
.pie { background: #33060F; color: #CDBDB4; padding: 56px 0 0; font-size: .97rem; }
.pie a { color: #E8E3DF; text-decoration: none; }
.pie a:hover { color: #fff; text-decoration: underline; }
.pie-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding-bottom: 40px;
}
@media (max-width: 900px) { .pie-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pie-grid { grid-template-columns: 1fr; } }
.pie h4 {
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  color: #fff;
  font-size: 1.12rem;
  margin-bottom: 14px;
  letter-spacing: .05em;
}
.pie ul { list-style: none; }
.pie li { margin-bottom: 8px; }
.pie .logo-pie { height: 84px; width: auto; margin-bottom: 14px; }
.pie-legal {
  border-top: 1px solid rgba(255,255,255,.14);
  padding: 18px 0;
  font-size: .85rem;
  color: #948D89;
}
.pie-legal .contenedor { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pie-legal a { color: #948D89; }
.pie-legal .credito strong { color: var(--dorado); font-weight: 600; }

/* ---------- Botón flotante WhatsApp ---------- */
.whatsapp-flotante {
  position: fixed;
  left: 20px; bottom: 20px;
  z-index: 950;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: transform .15s;
}
.whatsapp-flotante:hover { transform: scale(1.07); }
.whatsapp-flotante svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- Chatbot ---------- */
.chat-boton {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 950;
  height: 56px;
  padding: 0 22px 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--rojo);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: transform .15s, background .15s;
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chat-boton:hover { transform: scale(1.04); background: var(--rojo-oscuro); }
.chat-boton svg { width: 26px; height: 26px; fill: #fff; flex: 0 0 auto; }
@media (max-width: 480px) {
  .chat-boton { padding: 0 16px 0 13px; font-size: 1rem; height: 52px; }
}

/* Burbuja de saludo del asistente (aparece sola, el chat no se abre solo) */
.chat-globo {
  position: fixed;
  right: 20px; bottom: 90px;
  z-index: 949;
  max-width: 270px;
  background: #fff;
  color: var(--tinta);
  border: 1px solid var(--gris-claro);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 8px 26px rgba(26,23,27,.22);
  padding: 14px 36px 14px 16px;
  font-size: .95rem;
  line-height: 1.45;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.chat-globo.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.chat-globo strong { color: var(--rojo); }
.chat-globo .globo-cerrar {
  position: absolute;
  top: 6px; right: 8px;
  background: none; border: 0;
  color: var(--gris);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.chat-ventana {
  position: fixed;
  right: 20px; bottom: 90px;
  z-index: 960;
  width: min(370px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-ventana.abierto { display: flex; }
.chat-cab {
  background: var(--rojo);
  color: #fff;
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.chat-cab .titulo { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; font-weight: 700; font-size: 1.1rem; letter-spacing: .04em; }
.chat-cab .estado { font-size: .78rem; color: #9DE0A9; }
.chat-cerrar { background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 4px; }
.chat-cuerpo {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--crema);
}
.chat-msg {
  background: #fff;
  border: 1px solid var(--gris-claro);
  border-radius: 12px 12px 12px 4px;
  padding: 11px 14px;
  font-size: .95rem;
  max-width: 92%;
  white-space: pre-line;
  box-shadow: 0 1px 4px rgba(26,23,27,.06);
}
.chat-msg.usuario {
  align-self: flex-end;
  background: var(--rojo);
  color: #fff;
  border: 0;
  border-radius: 12px 12px 4px 12px;
}
.chat-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-opciones button, .chat-opciones a {
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rojo);
  color: var(--rojo);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.chat-opciones button:hover, .chat-opciones a:hover { background: var(--rojo); color: #fff; }
.chat-pie {
  padding: 8px 14px;
  background: #fff;
  border-top: 1px solid var(--gris-claro);
  text-align: center;
}
.chat-pie button {
  background: none; border: 0;
  color: var(--gris);
  font-size: .82rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Página legal ---------- */
.legal { max-width: 800px; }
.legal h2 { margin: 34px 0 12px; font-size: 1.5rem; }
.legal p, .legal li { margin-bottom: 12px; color: var(--tinta); }
.legal ul { padding-left: 22px; }
.aviso-pendiente {
  background: #FCF3E3;
  border: 1.5px solid #E8C87A;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: .95rem;
}

/* ---------- Botones del formulario ---------- */
.form-botones { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-whatsapp:hover { background: #1EBE5A; }
.btn-whatsapp svg { width: 20px; height: 20px; fill: #fff; }
.nota-form { margin-top: 14px; font-size: .85rem; color: var(--gris); }

/* ---------- Bloque WhatsApp en la página de gracias ---------- */
.gracias-wa {
  margin: 26px auto 0;
  max-width: 520px;
  background: var(--blanco);
  border: 1.5px solid var(--dorado);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 22px 24px 26px;
}
.gracias-wa p { margin-bottom: 16px; color: var(--gris); }
.gracias-wa strong { color: var(--negro); }

/* ---------- Utilidades ---------- */
.centro { text-align: center; }
.mt-26 { margin-top: 26px; }
.nota-foto { font-size: .85rem; color: var(--gris); margin-top: 14px; }

@media (max-width: 640px) {
  .seccion { padding: 48px 0; }
  .heroe { min-height: 440px; }
  .barra-top .direccion { display: none; }
}
