/* ==========================================================================
   Autocares Francisco Heras — hoja de estilos
   ========================================================================== */

:root {
  --ink:        #0f1a24;
  --ink-soft:   #24333f;
  --slate:      #5a6b78;
  --line:       #dfd9d0;
  --line-soft:  #ece7e0;
  --paper:      #ffffff;
  --sand:       #f6f3ee;
  --sand-deep:  #efe9e0;
  --bronze:     #9a6b34;
  --bronze-dk:  #7d5628;
  --bronze-lt:  #f3ead9;

  --shadow-sm: 0 1px 2px rgba(15, 26, 36, .06), 0 2px 8px rgba(15, 26, 36, .04);
  --shadow-md: 0 4px 12px rgba(15, 26, 36, .08), 0 12px 32px rgba(15, 26, 36, .07);
  --shadow-lg: 0 8px 24px rgba(15, 26, 36, .12), 0 24px 64px rgba(15, 26, 36, .10);

  --radius:    14px;
  --radius-sm: 9px;

  --wrap: 1180px;
  --gut: clamp(1.25rem, 4vw, 3rem);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--bronze-dk); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.35rem); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--bronze); outline-offset: 3px; border-radius: 4px; }

/* --------------------------------------------------------------- botones */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--sans); font-size: .96rem; font-weight: 600; letter-spacing: .01em;
  padding: .82rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.btn--primary { background: var(--bronze); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--bronze-dk); box-shadow: var(--shadow-md); }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-soft); }

.btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff; backdrop-filter: blur(6px); background: rgba(15, 26, 36, .22); }
.btn--ghost:hover { background: rgba(255, 255, 255, .95); color: var(--ink); border-color: #fff; }

.btn--outline { border-color: var(--line); color: var(--ink); background: var(--paper); }
.btn--outline:hover { border-color: var(--ink); }

/* -------------------------------------------------------------- cabecera */

.topbar {
  background: var(--ink); color: rgba(255, 255, 255, .74);
  font-size: .82rem; letter-spacing: .01em;
}
.topbar__in { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; align-items: center; justify-content: space-between; padding-block: .5rem; }
.topbar a { color: #fff; text-decoration: none; font-weight: 500; }
.topbar a:hover { text-decoration: underline; }
.topbar__meta { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.topbar__meta span { display: inline-flex; align-items: center; gap: .4rem; }
.topbar svg { width: .95em; height: .95em; opacity: .85; }
@media (max-width: 620px) { .topbar__meta span.is-optional { display: none; } }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header.is-stuck { box-shadow: var(--shadow-sm); }
.site-header__in { display: flex; align-items: center; gap: 1.5rem; min-height: 74px; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 1.16rem; color: var(--ink); line-height: 1.1; letter-spacing: -.01em; }
.brand__tag { display: block; font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); margin-top: .18rem; }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  text-decoration: none; color: var(--ink-soft); font-size: .94rem; font-weight: 500;
  padding: .5rem .78rem; border-radius: 8px; transition: background-color .16s ease, color .16s ease;
}
.nav a:hover { background: var(--sand); color: var(--ink); }
.header-cta { margin-left: .6rem; }

.burger {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.burger span { display: block; width: 19px; height: 1.8px; background: var(--ink); position: relative; transition: background-color .2s; }
.burger span::before, .burger span::after {
  content: ""; position: absolute; left: 0; width: 19px; height: 1.8px; background: var(--ink); transition: transform .22s ease, top .22s ease;
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 920px) {
  .burger { display: inline-flex; }
  .header-cta { display: none; }
  .nav {
    position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line-soft); box-shadow: var(--shadow-md);
    padding: .5rem var(--gut) 1.1rem;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .82rem .2rem; border-radius: 0; border-bottom: 1px solid var(--line-soft); font-size: 1.02rem; }
  .nav .btn { margin-top: .9rem; justify-content: center; }
}

/* ------------------------------------------------------------------ hero */

.hero { position: relative; color: #fff; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(104deg, rgba(9, 16, 23, .93) 0%, rgba(9, 16, 23, .80) 42%, rgba(9, 16, 23, .38) 78%, rgba(9, 16, 23, .30) 100%);
}
.hero__in { padding-block: clamp(4rem, 11vw, 8.5rem); max-width: 44rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--bronze); margin-bottom: 1.15rem;
}
.eyebrow::before { content: ""; width: 30px; height: 1.5px; background: var(--bronze); }
.hero .eyebrow { color: #e8c489; }
.hero .eyebrow::before { background: #e8c489; }

.hero h1 { color: #fff; margin-bottom: .55em; text-wrap: balance; }
.hero__lead { font-size: clamp(1.06rem, 1.9vw, 1.22rem); color: rgba(255, 255, 255, .9); max-width: 34rem; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ----------------------------------------------------------- franja aval */

.trust { background: var(--ink); color: rgba(255, 255, 255, .82); }
.trust__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255, 255, 255, .1); }
.trust__cell { background: var(--ink); padding: 1.6rem 1.4rem; text-align: center; }
.trust__num { font-family: var(--serif); font-size: 1.75rem; color: #fff; display: block; line-height: 1; margin-bottom: .35rem; }
.trust__lbl { font-size: .83rem; letter-spacing: .02em; }
@media (max-width: 780px) { .trust__grid { grid-template-columns: repeat(2, 1fr); } }

/* --------------------------------------------------------------- bloques */

.section { padding-block: clamp(3.75rem, 8vw, 6.5rem); }
.section--sand { background: var(--sand); }
.section--paper { background: var(--paper); }

.section__head { max-width: 46rem; margin-bottom: clamp(2.25rem, 4vw, 3.25rem); }
.section__head p { color: var(--slate); font-size: 1.08rem; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow { justify-content: center; }

/* ------------------------------------------------------------- servicios */

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 1.1rem; }
.svc {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.svc:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line); }
.svc__ico {
  width: 42px; height: 42px; border-radius: 11px; background: var(--bronze-lt); color: var(--bronze-dk);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.svc__ico svg { width: 21px; height: 21px; }
.svc h3 { font-size: 1.08rem; margin-bottom: .35em; }
.svc p { font-size: .945rem; color: var(--slate); line-height: 1.55; }

/* --------------------------------------------------------------- empresa */

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--flip .split__media { order: -1; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split--flip .split__media { order: 0; } }

.split__media { position: relative; }
.split__media img { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; }
.split__media::before {
  content: ""; position: absolute; inset: auto -18px -18px auto; width: 62%; height: 62%;
  border: 1.5px solid var(--bronze); border-radius: var(--radius); z-index: -1;
}

.stamp {
  position: absolute; left: -14px; bottom: 24px;
  background: var(--ink); color: #fff; border-radius: var(--radius-sm);
  padding: .85rem 1.15rem; box-shadow: var(--shadow-md); font-size: .82rem; line-height: 1.35;
}
.stamp strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
@media (max-width: 520px) { .stamp { left: 10px; bottom: 10px; } .split__media::before { display: none; } }

.lead-note {
  border-left: 3px solid var(--bronze); padding: .2rem 0 .2rem 1.25rem; margin: 1.6rem 0;
  font-family: var(--serif); font-size: 1.16rem; line-height: 1.5; color: var(--ink);
}

/* --------------------------------------------------------------- calidad */

.quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.quality__item { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.5rem; }
.quality__item h3 { font-size: 1.02rem; display: flex; gap: .6rem; align-items: flex-start; }
.quality__item h3 svg { width: 19px; height: 19px; color: var(--bronze); flex: none; margin-top: .18rem; }
.quality__item p { font-size: .93rem; color: var(--slate); margin: 0; }

.badge-iso {
  display: inline-flex; align-items: center; gap: .8rem;
  background: var(--bronze-lt); border: 1px solid #e3d3b6; border-radius: var(--radius-sm);
  padding: .85rem 1.2rem; font-size: .9rem; color: var(--ink); font-weight: 500;
}
.badge-iso svg { width: 26px; height: 26px; color: var(--bronze-dk); flex: none; }

/* --------------------------------------------------------------- galería */

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.gallery button {
  padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius-sm);
  overflow: hidden; aspect-ratio: 4 / 3; display: block;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.gallery button:hover img { transform: scale(1.06); }
.gallery button:nth-child(1) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery button:nth-child(1) { grid-column: span 2; grid-row: auto; aspect-ratio: 4 / 3; }
}

.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8, 13, 18, .93); padding: clamp(1rem, 4vw, 3rem);
  align-items: center; justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: var(--radius-sm); object-fit: contain; }
.lightbox__btn {
  position: absolute; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 1.4rem; line-height: 1;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .24); }
.lightbox__close { top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); }
.lightbox__prev { left: clamp(.5rem, 2vw, 2rem); }
.lightbox__next { right: clamp(.5rem, 2vw, 2rem); }

/* -------------------------------------------------------------- contacto */

.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }

.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1.15rem; }
.contact-list li { display: flex; gap: .95rem; align-items: flex-start; }
.contact-list .ico {
  width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--paper);
  border: 1px solid var(--line-soft); display: grid; place-items: center; color: var(--bronze-dk);
}
.contact-list .ico svg { width: 18px; height: 18px; }
.contact-list dt, .contact-list .lbl {
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--slate);
  margin-bottom: .15rem;
}
.contact-list a { color: var(--ink); text-decoration: none; font-weight: 500; }
.contact-list a:hover { color: var(--bronze-dk); text-decoration: underline; }

.map { border: 0; width: 100%; height: 300px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.form-card {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 1.05rem; }
.field label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink); margin-bottom: .38rem; }
.field .req { color: var(--bronze-dk); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: .98rem; color: var(--ink);
  padding: .72rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); transition: border-color .16s ease, box-shadow .16s ease;
}
.field textarea { min-height: 118px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(154, 107, 52, .14);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.hp { position: absolute; left: -9999px; }

.consent { display: flex; gap: .65rem; align-items: flex-start; font-size: .84rem; color: var(--slate); margin-bottom: 1.25rem; }
.consent input { width: 17px; height: 17px; margin-top: .18rem; flex: none; accent-color: var(--bronze); }

.form-msg { display: none; border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .92rem; margin-bottom: 1rem; }
.form-msg.is-ok { display: block; background: #eaf5ec; border: 1px solid #bfdfc6; color: #245c33; }
.form-msg.is-err { display: block; background: #fbeceb; border: 1px solid #efc9c6; color: #8b2b25; }

/* ------------------------------------------------------------------- CTA */

.cta-band { background: var(--ink); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .78); max-width: 38rem; margin-inline: auto; margin-bottom: 2rem; }
.cta-band .btn--outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.cta-band .btn--outline:hover { background: #fff; color: var(--ink); border-color: #fff; }
.cta-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------- pie */

.site-footer { background: #0a1219; color: rgba(255, 255, 255, .62); font-size: .92rem; padding-block: 3.25rem 1.75rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.9rem; } }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.site-footer a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__tag { color: rgba(255, 255, 255, .5); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; font-size: .84rem;
}

/* ------------------------------------------------------- botón flotante */

.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-md); text-decoration: none;
  transition: transform .2s ease;
}
.wa-float:hover { transform: scale(1.07); }
.wa-float svg { width: 30px; height: 30px; }

/* ------------------------------------------------------------ animación */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ----------------------------------------------- páginas legales (.doc) */

.doc { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.doc__in { max-width: 46rem; margin-inline: auto; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: .3em; }
.doc__meta { color: var(--slate); font-size: .9rem; margin-bottom: 2.5rem; }
.doc h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); margin-top: 2.4rem; }
.doc h3 { font-size: 1.05rem; margin-top: 1.6rem; }
.doc ul, .doc ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.doc li { margin-bottom: .45rem; }
.doc table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .93rem; }
.doc th, .doc td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.doc th { background: var(--sand); font-weight: 600; color: var(--ink); }
.doc .back { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; margin-bottom: 1.8rem; text-decoration: none; }
.doc .back:hover { text-decoration: underline; }

.todo {
  background: #fff8e6; border: 1px solid #f0dca8; border-left: 3px solid #d9a520;
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .9rem; color: #6b5107;
  margin: 1.2rem 0;
}
.todo strong { color: #4f3c05; }

/* ------------------------------------------------------ página gracias */

.thanks { min-height: 68vh; display: grid; place-items: center; text-align: center; padding: 3rem 0; }
.thanks__ico {
  width: 68px; height: 68px; border-radius: 50%; background: var(--bronze-lt); color: var(--bronze-dk);
  display: grid; place-items: center; margin: 0 auto 1.5rem;
}
.thanks__ico svg { width: 32px; height: 32px; }

/* ------------------------------------------------- sello del desarrollador */

.credit { margin-top: 1.5rem; text-align: center; }
.credit a {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; padding: .35rem .7rem; border-radius: 999px;
  opacity: .55; transition: opacity .18s ease, background-color .18s ease;
}
.credit a:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.credit img { height: 18px; width: auto; }
.credit__tag {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55); padding-left: .5rem;
  border-left: 1px solid rgba(255, 255, 255, .18);
}
@media (max-width: 420px) {
  .credit a { flex-direction: column; gap: .35rem; }
  .credit__tag { border-left: 0; padding-left: 0; }
}
