/* ===== RESET & BASE (mobile first) ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #1a4d8c;
  --color-primary-dark: #123566;
  --color-accent: #e8a020;
  --color-whatsapp: #25d366;
  --color-bg: #f5f6f8;
  --color-white: #ffffff;
  --color-text: #222;
  --color-muted: #666;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --bottom-nav-height: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section { padding: 3rem 0; }

.section__title {
  font-size: 1.6rem;
  color: var(--color-primary);
  margin-bottom: .4rem;
}

.section__subtitle {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}

/* ===== HEADER ===== */
.header {
  background: var(--color-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo__icon {
  background: var(--color-primary);
  color: var(--color-white);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 800;
}

.logo__text { font-size: 1.1rem; }

/* ===== BOTTOM NAV (estilo app nativa) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-white);
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 300;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  padding: .4rem .25rem;
  color: var(--color-muted);
  font-size: .68rem;
  font-weight: 500;
  transition: color .2s;
}

.bottom-nav__item--active {
  color: var(--color-primary);
}

.bottom-nav__icon {
  width: 24px;
  height: 24px;
}

.bottom-nav__item--active .bottom-nav__icon {
  stroke-width: 2.5;
}

/* ===== BOTONES ===== */
.btn {
  display: inline-block;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background .2s;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover { background: var(--color-primary-dark); }

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: var(--color-white);
  margin-top: 1rem;
}

.btn--whatsapp:hover { background: #1da851; }

.btn--full { width: 100%; }

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 1rem + env(safe-area-inset-bottom, 0px));
  right: 1.25rem;
  width: 56px;
  height: 56px;
  background: var(--color-whatsapp);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.45);
  z-index: 200;
  transition: transform .2s;
}

.whatsapp-btn:hover { transform: scale(1.08); }

.whatsapp-btn::before {
  content: "";
  width: 30px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ===== HERO / HOME ===== */
.page-home .header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  box-shadow: none;
  z-index: 10;
}

.page-home .logo { color: var(--color-white); }

.page-home .logo__icon {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero {
  color: var(--color-white);
  padding: 3.5rem 0;
}

.hero--fullscreen {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 5.5rem 0 3rem;
  background: url("foto-home.jpg") center center / cover no-repeat;
}

.hero--fullscreen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(18, 53, 102, 0.72) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  margin-bottom: 1rem;
}

.hero__title {
  font-size: 1.75rem;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.hero__text {
  font-size: .95rem;
  opacity: .9;
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.hero .btn--primary {
  background: var(--color-accent);
  color: var(--color-text);
}

.hero .btn--primary:hover { background: #d08e10; }

/* ===== SERVICIOS / HOME ===== */
.servicios { background: var(--color-bg); }

.servicios__grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.card-servicio {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--color-primary);
}

.card-servicio h3 {
  color: var(--color-primary);
  font-size: 1rem;
  margin-bottom: .5rem;
}

.card-servicio p {
  font-size: .88rem;
  color: var(--color-muted);
}

.cta-banner {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.cta-banner p {
  margin-bottom: 1rem;
  font-size: .95rem;
}

.cta-banner .btn--primary {
  background: var(--color-accent);
  color: var(--color-text);
}

.cta-banner .btn--primary:hover { background: #d08e10; }

/* ===== SUCURSALES ===== */
.sucursales { background: var(--color-white); }

.sucursales__grid {
  display: grid;
  gap: 1rem;
}

.card-sucursal {
  background: var(--color-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-sucursal h3 {
  color: var(--color-primary);
  margin-bottom: .5rem;
  font-size: 1.05rem;
}

.card-sucursal p {
  font-size: .88rem;
  color: var(--color-muted);
}

/* ===== FILTROS ===== */
.filtros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.filtro label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: .25rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.filtro select {
  width: 100%;
  padding: .55rem .6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: .9rem;
  background: var(--color-white);
  color: var(--color-text);
}

/* ===== CATÁLOGO ===== */
.catalogo__grid {
  display: grid;
  gap: 1.25rem;
}

.card-auto {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-auto--hidden { display: none; }

.card-auto__fotos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #ddd;
}

.card-auto__fotos img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.card-auto__info { padding: 1rem; }

.card-auto__info h3 {
  font-size: 1rem;
  margin-bottom: .5rem;
  color: var(--color-primary);
}

.card-auto__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .6rem;
}

.card-auto__tags li {
  background: var(--color-bg);
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .78rem;
  color: var(--color-muted);
}

.card-auto__cta {
  display: inline-block;
  margin-top: .25rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--color-primary);
}

.card-auto__cta:hover { text-decoration: underline; }

.catalogo__vacio {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem;
  font-style: italic;
}

/* ===== CONTACTO ===== */
.contacto { background: var(--color-white); }

.contacto__grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.form__group { margin-bottom: 1rem; }

.form__group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .3rem;
}

.form__group input,
.form__group textarea {
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
}

.contacto__info h3 {
  color: var(--color-primary);
  margin-bottom: .75rem;
  font-size: 1.05rem;
}

.contacto__info p {
  font-size: .9rem;
  color: var(--color-muted);
  margin-bottom: .3rem;
}

/* ===== MAPA ===== */
.mapa__title {
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: .75rem;
}

.mapa iframe {
  width: 100%;
  height: 250px;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 1.25rem 0 1.5rem;
  font-size: .8rem;
  margin-bottom: .5rem;
}

/* ===== TABLET (≥ 600px) ===== */
@media (min-width: 600px) {
  .hero__title { font-size: 2.2rem; }
  .filtros { grid-template-columns: repeat(4, 1fr); }
  .catalogo__grid { grid-template-columns: repeat(2, 1fr); }
  .sucursales__grid { grid-template-columns: repeat(3, 1fr); }
  .servicios__grid { grid-template-columns: repeat(2, 1fr); }
  .card-auto__fotos img { height: 150px; }
  .mapa iframe { height: 300px; }
}

/* ===== DESKTOP (≥ 900px) ===== */
@media (min-width: 900px) {
  .hero--fullscreen { padding: 6rem 0 4rem; }
  .hero__title { font-size: 2.6rem; }
  .catalogo__grid { grid-template-columns: repeat(3, 1fr); }
  .contacto__grid { grid-template-columns: 1fr 1fr; }
  .mapa iframe { height: 350px; }
  .servicios__grid { grid-template-columns: repeat(2, 1fr); }

  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
    border-left: 1px solid #e8e8e8;
    border-right: 1px solid #e8e8e8;
  }
}
