/* Pablo Cerrajería: colores sacados del logo */
:root {
  --choco: #4E2D16;        /* fondo del logo */
  --choco-deep: #3B2110;
  --ink: #2B190C;
  --muted: #6B5545;
  --brass: #E9BB3F;        /* gorra y camisa del logo */
  --brass-deep: #C9981F;
  --sky: #AED0DB;          /* visera del logo */
  --sky-pale: #EEF5F7;
  --white: #FFFFFF;
  --ring: #CFC8BE;

  --f-display: "Arvo", Rockwell, "Roboto Slab", Georgia, serif;
  --f-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --gutter: 24px;
  --header-h: 68px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.12; text-wrap: balance; }
h2 { font-size: clamp(1.85rem, 1.2rem + 2.2vw, 2.6rem); }
h3 { font-size: 1.25rem; line-height: 1.25; }

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

.ico { width: 1.15em; height: 1.15em; flex: none; }

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

[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brass); color: var(--ink); padding: 10px 16px; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--choco);
  border-bottom: 1px solid rgba(174, 208, 219, .18);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.brand span { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { color: rgba(255, 255, 255, .86); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 6px 0; }
.nav a:hover { color: var(--brass); }

.call-sm {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brass); color: var(--choco-deep);
  font-weight: 700; font-size: .98rem; text-decoration: none; white-space: nowrap;
  padding: 10px 16px; border-radius: 999px;
}
.call-sm:hover { background: #F2C955; }

/* ---------- Portada ---------- */
.hero { background: var(--choco); color: var(--white); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px;
  padding-block: 72px 96px;
}

.hero h1 { font-size: clamp(2.35rem, 1.3rem + 4vw, 4rem); max-width: 15ch; }
.hero h1 span { display: block; }
.hero-lead { margin-top: 22px; max-width: 46ch; font-size: 1.15rem; color: rgba(255, 255, 255, .86); }

/* El llavero: el teléfono es el botón principal */
.keytag {
  --swing: 0deg;
  position: relative; display: inline-flex; align-items: center;
  margin-top: 40px; margin-left: 30px;
  padding: 16px 30px 16px 66px;
  background: var(--brass); color: var(--choco-deep);
  border: 2px solid var(--brass-deep);
  border-radius: 46px 14px 14px 46px;
  box-shadow: 0 5px 0 var(--choco-deep), 0 14px 28px rgba(0, 0, 0, .28);
  text-decoration: none;
  transform-origin: 2px 50%;
  transform: rotate(var(--swing));
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), background-color .2s;
  animation: swing 1.6s cubic-bezier(.36, .07, .19, .97) .35s backwards;
}
.keytag:hover { --swing: -3deg; background: #F2C955; }
.keytag:active { transform: rotate(0deg) translateY(3px); box-shadow: 0 2px 0 var(--choco-deep), 0 8px 18px rgba(0, 0, 0, .25); }
.keytag:focus-visible { outline-color: var(--white); outline-offset: 5px; }

/* agujero perforado */
.keytag-hole {
  position: absolute; left: 20px; top: 50%;
  width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  background: var(--choco);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55), 0 0 0 2px var(--brass-deep);
}
/* anilla del llavero */
.keytag::before {
  content: ""; position: absolute; left: -24px; top: 50%;
  width: 52px; height: 52px; margin-top: -26px; border-radius: 50%;
  border: 4px solid var(--ring);
  border-right-color: #B4ACA1;
  pointer-events: none;
}

.keytag-body { display: flex; flex-direction: column; line-height: 1.1; }
.keytag-label { font-weight: 600; font-size: .88rem; }
.keytag-number {
  margin-top: 4px;
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.6rem);
  letter-spacing: .02em; white-space: nowrap;
}

@keyframes swing {
  0%   { transform: rotate(-9deg); }
  28%  { transform: rotate(6deg); }
  52%  { transform: rotate(-3deg); }
  74%  { transform: rotate(1.5deg); }
  100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .keytag { animation: none; transition: background-color .2s; }
  .keytag:hover { --swing: 0deg; }
}

.hero-alt { margin-top: 24px; }
.hero-alt a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--sky); font-weight: 600; text-underline-offset: 4px;
}
.hero-alt a:hover { color: var(--white); }

.hero-rating {
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid rgba(174, 208, 219, .25);
  color: rgba(255, 255, 255, .86); text-decoration: none; font-size: .98rem;
}
.hero-rating strong { color: var(--white); }
.hero-rating:hover span:last-child { text-decoration: underline; text-underline-offset: 4px; }

.stars { display: inline-flex; gap: 2px; color: var(--brass); }
.stars svg { width: 18px; height: 18px; }

.hero-emblem { justify-self: center; }
.hero-emblem img { width: min(100%, 380px); height: auto; border-radius: 50%; }

/* ---------- Secciones ---------- */
.section { padding-block: 88px; }
.section-sky { background: var(--sky-pale); }
.section-choco { background: var(--choco); color: var(--white); }
.section-lead { margin-top: 12px; max-width: 56ch; color: var(--muted); font-size: 1.1rem; }

/* Servicios */
.services {
  display: grid; grid-template-columns: repeat(2, 1fr);
  column-gap: 56px; row-gap: 8px; margin-top: 48px;
}
.service {
  display: grid; grid-template-columns: 52px 1fr; column-gap: 20px; align-items: start;
  padding-block: 28px; border-top: 2px solid var(--choco);
}
.service-ico {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brass); color: var(--choco-deep);
}
.service-ico svg { width: 26px; height: 26px; }
.service h3 { padding-top: 2px; }
.service p { margin-top: 6px; color: var(--muted); max-width: 42ch; }

/* Pasos */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  margin-top: 52px; counter-reset: step;
}
.step { counter-increment: step; position: relative; }
.step::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 52px; height: 52px; margin-bottom: 20px;
  border: 3px solid var(--choco); border-radius: 50%;
  font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; color: var(--choco);
  background: var(--white); position: relative; z-index: 1;
}
.step::after {
  content: ""; position: absolute; top: 26px; left: 52px; right: -32px;
  border-top: 2px dashed rgba(78, 45, 22, .3);
}
.step:last-child::after { display: none; }
.step p { margin-top: 8px; color: var(--muted); }

/* Opiniones */
.reviews-grid { display: grid; grid-template-columns: 300px 1fr; gap: 64px; align-items: start; }
.score { position: sticky; top: calc(var(--header-h) + 32px); }
.score h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
.score-num {
  margin-top: 20px;
  font-family: var(--f-display); font-weight: 700; color: var(--brass);
  font-size: clamp(4.5rem, 3rem + 5vw, 6.5rem); line-height: .9;
}
.stars-lg { margin-top: 12px; }
.stars-lg svg { width: 26px; height: 26px; }
.score-meta { margin-top: 14px; color: rgba(255, 255, 255, .78); }
.link-light {
  display: inline-block; margin-top: 18px;
  color: var(--sky); font-weight: 600; text-underline-offset: 4px;
}
.link-light:hover { color: var(--white); }

.quotes { columns: 2; column-gap: 48px; }
.quote {
  break-inside: avoid;
  padding-block: 22px 26px;
  border-top: 1px solid rgba(174, 208, 219, .28);
}
.quote blockquote {
  font-family: var(--f-display); font-style: italic; font-size: 1.18rem; line-height: 1.5;
  color: var(--white);
}
.quote blockquote::before { content: "«"; color: var(--brass); margin-right: 2px; }
.quote blockquote::after { content: "»"; color: var(--brass); margin-left: 2px; }
.quote-by { margin-top: 10px; font-size: .92rem; font-weight: 600; color: var(--sky); }

/* Llamada final */
.cta { background: var(--brass); color: var(--choco-deep); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-block: 64px; }
.cta p { margin-top: 10px; font-size: 1.1rem; max-width: 44ch; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; flex: none; }

.btn-dark, .btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px;
  font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap;
}
.btn-dark { background: var(--choco-deep); color: var(--brass); }
.btn-dark:hover { background: var(--choco); }
.btn-line { border: 2px solid var(--choco-deep); color: var(--choco-deep); }
.btn-line:hover { background: rgba(59, 33, 16, .08); }
.cta :focus-visible { outline-color: var(--choco-deep); }

/* Pie */
.footer { background: var(--choco-deep); color: rgba(255, 255, 255, .82); font-size: .98rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1.5fr 1fr .8fr; gap: 40px; padding-block: 56px 40px; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { width: 72px; height: 72px; border-radius: 50%; }
.footer-name { font-family: var(--f-display); font-weight: 700; font-size: 1.25rem; color: var(--white); }
.footer-h { font-family: var(--f-body); font-size: .95rem; font-weight: 700; color: var(--brass); margin-bottom: 10px; }
.footer-list li + li { margin-top: 6px; }
.footer-list a { text-underline-offset: 4px; overflow-wrap: anywhere; }
.footer-list a:hover { color: var(--white); }
.footer-bottom { padding-block: 20px 28px; border-top: 1px solid rgba(174, 208, 219, .16); font-size: .88rem; color: rgba(255, 255, 255, .6); }

/* Barra fija en móvil */
.mobile-bar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .step::after { display: none; }
  .reviews-grid { grid-template-columns: 1fr; gap: 40px; }
  .score { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --header-h: 60px; }
  body { padding-bottom: 76px; }

  .brand img { width: 38px; height: 38px; }
  .brand span { font-size: 1.08rem; }
  .call-sm { padding: 9px 13px; font-size: .92rem; }

  .hero-grid { grid-template-columns: 1fr; gap: 0; padding-block: 40px 56px; }
  .hero-emblem { display: none; }
  .hero-lead { font-size: 1.05rem; }
  .keytag { margin-top: 32px; }

  .section { padding-block: 64px; }
  .services { grid-template-columns: 1fr; margin-top: 32px; }
  .steps { grid-template-columns: 1fr; margin-top: 36px; gap: 28px; }
  .step { display: grid; grid-template-columns: 52px 1fr; column-gap: 18px; }
  .step::before { grid-row: span 2; margin-bottom: 0; }
  .step h3 { padding-top: 12px; }
  .step p { grid-column: 2; }

  .quotes { columns: 1; }

  .footer-contact { grid-column: 1 / -1; }

  .cta-inner { flex-direction: column; align-items: stretch; padding-block: 52px; }
  .cta-actions { flex-direction: column; }

  .mobile-bar {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--choco-deep);
    border-top: 1px solid rgba(174, 208, 219, .2);
  }
  .mobile-bar a {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 12px; border-radius: 12px;
    font-weight: 700; text-decoration: none;
  }
  .mobile-call { background: var(--brass); color: var(--choco-deep); }
  .mobile-wa { border: 2px solid var(--sky); color: var(--sky); }
}

@media (max-width: 480px) {
  .call-sm span { display: none; }
  .brand span { white-space: nowrap; }
}

@media (max-width: 360px) {
  .brand span { font-size: 1rem; }
}
