/* Cerrajero Torrevieja — critical styles, no framework */
:root {
  --blue-950: #0b1f4a;
  --blue-900: #122b63;
  --blue-800: #1a3a7a;
  --blue-700: #1e4a9e;
  --blue-600: #2563eb;
  --blue-100: #dbe7ff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --surface: #f7f9fc;
  --white: #fff;
  --wa: #128c7e;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(11, 31, 74, 0.18);
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --max: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--blue-600);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-900);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--blue-800);
  letter-spacing: -0.02em;
}

.brand img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav a:hover {
  color: var(--blue-700);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--blue-700);
  color: var(--white) !important;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 700;
  color: var(--blue-800);
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  color: var(--white);
  padding: 3rem 0 3rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(37, 99, 235, 0.45), transparent 55%),
    linear-gradient(145deg, var(--blue-950) 0%, var(--blue-800) 48%, var(--blue-700) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M30 4l22 10v16c0 14-9 26-22 32C17 56 8 44 8 30V14z' fill='%23fff' fill-opacity='.35'/%3E%3C/svg%3E");
  background-size: 72px 72px;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  animation: rise 0.7s ease both;
}

.hero-text {
  flex: 1 1 0;
  min-width: 0;
}

.hero-img {
  flex: 0 0 46%;
  align-self: center;
  overflow: hidden;
  border-radius: 16px;
  line-height: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.hero-img img {
  width: 100%;
  height: auto;
  display: block;
}

.hero h1,
.hero .brand-mark {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero .hero-lead,
.hero p {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--white);
  color: var(--blue-800);
  box-shadow: var(--shadow);
}

.btn-wa {
  background: var(--wa);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Sections */
section {
  padding: 3.5rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--blue-900);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0 auto;
  max-width: 38rem;
  color: var(--muted);
}

.prose {
  max-width: 46rem;
  margin-inline: auto;
}

.prose p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.prose strong {
  color: var(--ink);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 0.4rem;
}

/* Scroll-reveal (class added by JS, CSS drives the animation) */
.will-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.will-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Services */
#servicios,
#localidades,
#faq,
#opiniones,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.service {
  padding: 1.15rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.service h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--blue-900);
}

.service p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Locations */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.loc-link {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--blue-800);
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.loc-link:hover {
  border-color: var(--blue-100);
  background: var(--white);
  transform: translateY(-2px);
}

.loc-link[aria-current="page"] {
  border-color: var(--blue-600);
  background: var(--blue-100);
}

/* FAQ */
.faq {
  background: var(--surface);
}

.faq-list {
  max-width: 44rem;
  margin-inline: auto;
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.25rem 1rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--blue-900);
  padding: 0.9rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* Testimonials */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.quote {
  padding: 1.25rem;
  border-left: 3px solid var(--blue-600);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.quote .stars {
  color: #f59e0b;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  line-height: 1;
}

.quote p {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-style: italic;
}

.quote footer {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: var(--white);
  text-align: center;
}

.cta-band h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.cta-band p {
  margin: 0 auto 1.25rem;
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Footer */
.site-footer {
  background: var(--blue-950);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 0.75rem;
  color: var(--white);
  font-size: 1rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 0.35rem 0;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: #94a3b8;
}

.breadcrumbs a {
  color: var(--blue-700);
  font-weight: 600;
}

/* Floating call */
.float-call {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #16a34a;
  color: var(--white);
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.35);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 10px 30px rgba(22, 163, 74, 0.35);
  }
  50% {
    box-shadow: 0 10px 36px rgba(22, 163, 74, 0.55);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1rem 1rem;
    gap: 0.35rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.7rem 0.4rem;
  }

  .nav-cta {
    justify-content: center;
  }

  .hero {
    padding: 2.5rem 0 2.5rem;
  }

  .hero-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero-text {
    text-align: center;
  }

  .hero-text .cta-row {
    justify-content: center;
  }

  .hero-img {
    flex: none;
    width: 100%;
    border-radius: 16px;
  }

  .hero-img img {
    border-radius: 16px;
  }

  .float-call span {
    display: none;
  }
}

/* Legal pages */
.prose h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--blue-900);
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.prose h2 {
  font-size: 1.15rem;
  color: var(--blue-800);
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}

.prose h3 {
  font-size: 1rem;
  color: var(--blue-700);
  margin: 1.25rem 0 0.4rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0.5rem 0 1rem;
  color: var(--muted);
}

.prose li {
  margin: 0.3rem 0;
}

.prose a {
  color: var(--blue-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose em {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-bottom nav a {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
}

.footer-bottom nav a:hover {
  color: var(--white);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-content,
  .float-call,
  .btn {
    animation: none;
    transition: none;
  }

  .will-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
