/* Autoescuelas AprobarYa: directory parts on top of the main site's base.css + es.css (copied by build/sync_assets.php). */
.apy-dir { padding-top: 1.2rem; padding-bottom: 2rem; }
.apy-dir-hero .apy-hero-art img { width: min(100%, 300px); }

/* Search box with suggestions */
.apy-search { position: relative; max-width: 640px; margin: 1.3rem 0 0; }
.apy-search-field { display: flex; align-items: center; gap: .4rem; padding: .35rem .35rem .35rem .9rem; background: #fff; border: 2px solid transparent; border-radius: 14px; box-shadow: 0 10px 30px rgba(15,26,51,.25); }
.apy-search-field:focus-within { border-color: var(--apy-orange); }
.apy-search-icon { font-size: 1rem; }
.apy-search input { flex: 1; min-width: 0; padding: .65rem .2rem; color: #0f172a; background: transparent; border: 0; font: inherit; font-size: 1.02rem; outline: none; }
.apy-search .button { min-height: 46px; }
.apy-search-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 360px; overflow: auto; margin: 0; padding: .35rem; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(15,26,51,.2); }
.apy-search-list li { margin: 0; }
.apy-search-list a { display: flex; justify-content: space-between; gap: .8rem; padding: .6rem .75rem; color: #0f172a; border-radius: 10px; text-decoration: none; font-weight: 700; }
.apy-search-list a small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.apy-search-list a:hover, .apy-search-list a.is-active { background: var(--apy-orange-soft); }
.apy-search-list .is-empty { padding: .7rem .8rem; color: var(--muted); }
.category-hero-copy .apy-search { margin-top: 1.1rem; }
.apy-quick { margin: .9rem 0 0; color: #c8d6eb; font-size: .9rem; }
.apy-quick a { margin-left: .55rem; color: #fff; font-weight: 800; }

/* Stats strip */
.apy-dir-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.apy-dir-stats li { display: grid; padding: 1rem; text-align: center; background: var(--apy-card); border: 1px solid var(--line); border-radius: 14px; }
.apy-dir-stats strong { color: var(--navy); font-size: 1.7rem; line-height: 1.1; }
.apy-dir-stats span { color: var(--muted); font-size: .85rem; font-weight: 700; }

/* Chips (municipios) and provinces by region */
.apy-chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.apy-chip-grid a, .apy-region a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem .8rem; color: var(--apy-ink); background: var(--apy-card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 750; }
.apy-chip-grid a:hover, .apy-region a:hover { border-color: var(--apy-orange); }
.apy-chip-grid b, .apy-region b { padding: .05rem .5rem; color: var(--apy-orange-text); background: var(--apy-orange-soft); border-radius: 999px; font-size: .78rem; }
.apy-region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.apy-region { padding: 1rem; background: #f3f6fb; border-radius: 16px; }
.apy-region h3 { margin: 0 0 .6rem; color: var(--navy); font-size: 1rem; }
.apy-region ul { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.apy-az-list { columns: 4 200px; column-gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.apy-az-list li { break-inside: avoid; padding: .25rem 0; }
.apy-az-list a { color: var(--navy-2); font-weight: 750; }
.apy-az-list small { color: var(--muted); }

/* School cards */
.apy-school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.apy-school-card { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem; background: var(--apy-card); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.apy-school-card:hover { border-color: var(--apy-orange); box-shadow: 0 10px 26px rgba(20,33,61,.08); }
.apy-school-card-top { display: flex; gap: .8rem; align-items: flex-start; }
.apy-school-card .lesson-index { flex: 0 0 auto; width: 38px; height: 38px; font-size: .85rem; }
.apy-school-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.apy-school-card h3 a { color: var(--apy-ink); text-decoration: none; }
.apy-school-card h3 a:hover { color: var(--apy-orange-text); text-decoration: underline; }
.apy-school-place, .apy-school-distance { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.apy-rating { margin: 0; font-size: .92rem; }
.apy-rating.is-empty { color: var(--muted); font-size: .85rem; }
.apy-stars { color: #f59e0b; letter-spacing: .05em; }
.apy-rating-count { color: var(--muted); }
.apy-rating.is-big { font-size: 1.05rem; }
.apy-school-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .3rem; }
.apy-school-actions .button { min-height: 42px; padding: .5rem .9rem; font-size: .9rem; }
.apy-school-grid.is-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* Pagination */
.apy-pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; margin: 1.5rem 0 0; }
.apy-pagination > a:not(.button), .apy-pagination > span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .5rem; color: var(--apy-ink); background: var(--apy-card); border: 1px solid var(--line); border-radius: 10px; font-weight: 800; text-decoration: none; }
.apy-pagination > span[aria-current] { color: #fff; background: var(--navy); border-color: var(--navy); }

/* CTA band */
.apy-dir-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: var(--apy-section-gap); padding: 1.4rem 1.6rem; color: #fff; background: linear-gradient(150deg, #14213d, #24467f); border-radius: 18px; }
.apy-dir-cta h2 { margin: 0 0 .3rem; color: #fff; font-size: 1.3rem; }
.apy-dir-cta p { margin: 0; color: #c8d6eb; }

/* School page */
.apy-school-hero { margin-top: 1rem; padding: clamp(1.3rem, 3vw, 2.2rem); color: #fff; background: radial-gradient(120% 140% at 100% 0%, #2a4f8a 0%, #14213d 60%, #0f1a33 100%); border-radius: 20px; }
.apy-school-hero .eyebrow { color: #ffd9c2 !important; }
.apy-school-hero h1 { margin: .5rem 0 .6rem; color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; }
.apy-school-hero .apy-rating-count, .apy-school-address { color: #d3dff2; }
.apy-school-hero .apy-rating strong { color: #fff; }
.apy-school-address { margin: .5rem 0 0; }
.apy-school-hero .button-secondary { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }
.apy-school-hero .apy-school-actions { margin-top: 1rem; }
.apy-school-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
.apy-school-main { display: grid; gap: 1.2rem; min-width: 0; }
.apy-school-main .apy-home-section { margin-top: .5rem; }
.apy-school-side { display: grid; gap: 1rem; position: sticky; top: 90px; }
.apy-school-side .lesson-aside { position: static; }
.apy-school-side h3 { margin: 0; font-size: 1rem; }
.apy-school-side .button { width: 100%; }
.apy-school-side a:not(.button) { font-weight: 800; }
.apy-school-box { padding: 1.3rem; background: var(--apy-card); border: 1px solid var(--line); border-radius: 16px; }
.apy-school-box h2 { margin: 0 0 .8rem; font-size: 1.2rem; color: var(--navy); }
.apy-facts { display: grid; gap: 0; margin: 0; }
.apy-facts > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.apy-facts > div:first-child { border-top: 0; }
.apy-facts dt { color: var(--muted); font-weight: 700; }
.apy-facts dd { margin: 0; font-weight: 650; }
.apy-facts a { color: var(--navy-2); font-weight: 800; }
.apy-map { display: grid; place-items: center; gap: .6rem; min-height: 280px; padding: 1.2rem; text-align: center; background: #eef2f9 url('/images/logo-96.webp') no-repeat center 20% / 0; border-radius: 12px; }
.apy-map p { margin: 0; color: var(--muted); }
.apy-map a { color: var(--navy-2); font-weight: 800; font-size: .9rem; }
.apy-map iframe { width: 100%; height: 340px; border: 0; border-radius: 12px; }
.apy-map.is-loaded { display: block; padding: 0; min-height: 0; background: none; }
.apy-faq details { border-top: 1px solid var(--line); padding: .8rem 0; }
.apy-faq details:last-child { padding-bottom: 0; }
.apy-faq summary { cursor: pointer; font-weight: 800; }
.apy-faq details p { margin: .5rem 0 0; color: var(--muted); }

@media (max-width: 900px) {
  .apy-school-layout { grid-template-columns: 1fr; }
  .apy-school-side { position: static; }
}
@media (max-width: 760px) {
  .apy-dir-stats { grid-template-columns: repeat(2, 1fr); }
  .apy-facts > div { grid-template-columns: 1fr; gap: .1rem; }
  .apy-school-grid, .apy-school-grid.is-list { grid-template-columns: 1fr; }
  .apy-search .button { padding-inline: .8rem; }
}
.apy-school-hero .eyebrow { display: inline-block; padding: .25rem .65rem; color: #ffd9c2 !important; background: rgba(232,105,45,.18) !important; border: 1px solid rgba(242,154,99,.35); border-radius: 999px; font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }

/* School page (sx-, css/sx.css) on this site */
.sx svg.ph { flex: 0 0 auto; width: 1em; height: 1em; vertical-align: -.125em; }
.sx-licence-icon svg.ph, .sx-phone-icon svg.ph, .sx-address-icon svg.ph { width: 20px; height: 20px; }
.school-map-consent > svg.ph { width: 32px; height: 32px; color: #24467f; }
.rv-stars { position: relative; display: inline-block; line-height: 1; letter-spacing: .05em; }
.rv-stars-base { color: #d6dbe4; }
.rv-stars-fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #f59e0b; }
.sx-map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sx-map-embed.is-loaded { display: block; }
.sx .school-photo { position: relative; }
.sx-photo-note { position: absolute; right: 10px; bottom: 10px; padding: .2rem .55rem; color: #fff; background: rgba(15,23,42,.7); border-radius: 999px; font-size: .72rem; font-weight: 700; }
.sx-card-grid.sx { display: grid; gap: 14px; }
@media (min-width: 760px) { .sx-card-grid.sx { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .apy-dir .sx-card-grid.sx { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sx .sx-card-phone svg.ph, .sx .sx-card-place svg.ph { color: var(--sx-blue); }
.sx-call-bar ~ * { }
@media (max-width: 1023px) { body:has(.sx-call-bar) { padding-bottom: 72px; } body:has(.sx-call-bar) .site-footer { margin-bottom: 0; } }
/* ---------- Home review 2026-11-14 ---------- */
.apy-dir-hero > * { min-width: 0; }
.apy-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; }
.apy-quick a { margin-left: 0; padding: .25rem 0; }
.apy-search-icon { display: inline-flex; color: var(--muted); }
.apy-search-icon svg { width: 18px; height: 18px; }
.apy-search-list .is-empty { list-style: none; }
.apy-near { display: inline-flex; align-items: center; gap: .4rem; margin: .7rem 0 0; padding: .45rem .8rem; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer; }
.apy-near:hover { background: rgba(255,255,255,.2); }
.apy-near[disabled] { opacity: .7; cursor: progress; }
.apy-near-msg { margin: .5rem 0 0; color: #ffd9c2; font-size: .88rem; }
.apy-rank-note { margin: .3rem 0 0; color: var(--muted); font-size: .88rem; }
@media (max-width: 760px) {
  .apy-dir-hero .apy-hero-art img { width: 72px; }
  .apy-dir-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .apy-dir-stats li { padding: .7rem .4rem; }
  .apy-dir-stats strong { font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .apy-chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apy-chip-grid a { padding: .45rem .6rem; font-size: .9rem; }
  .apy-region-grid { grid-template-columns: 1fr; }
}
.site-footer a { display: inline-block; min-height: 24px; padding: .15rem 0; }

/* Provinces by region: regions flow down columns (no empty gaps under short regions), compact rows. */
.apy-region-grid { display: block !important; columns: 4 230px; column-gap: 1rem; }
.apy-region { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 1rem; padding: .85rem .9rem; background: var(--apy-card); border: 1px solid var(--line); border-radius: 16px; }
.apy-region h3 { margin: 0 0 .45rem; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.apy-region ul { gap: 0; }
.apy-region li + li { border-top: 1px solid var(--line); }
.apy-region a { min-height: 40px; padding: .45rem .2rem; background: none; border: 0; border-radius: 8px; }
.apy-region a:hover { background: var(--apy-orange-soft); border: 0; }
@media (max-width: 480px) { .apy-region-grid { columns: 1; } }

/* ---------- Province page review 2026-11-14 ---------- */
.apy-prov-intro { max-width: 860px; margin: 1.4rem 0 0; color: var(--muted); line-height: 1.65; }
.apy-prov-intro a, .apy-prov-missing a, .apy-prov-all a { color: var(--navy-2); font-weight: 800; }
.apy-prov-missing, .apy-prov-all { margin: 1rem 0 0; color: var(--muted); font-size: .92rem; }
.apy-prov-single { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; color: #fff; background: var(--btn, #b8481a); border-radius: 16px; text-decoration: none; font-size: 1.05rem; }
.apy-prov-single:hover { filter: brightness(.95); }
.apy-az-list a { display: inline-block; min-height: 28px; padding: .15rem 0; }
.category-hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Town page review 2026-11-14 ---------- */
.apy-rank-list { margin: 0; padding: 0; list-style: none; }
.apy-rank-list > li { display: contents; }
.apy-unrated-title { margin: 1.8rem 0 .8rem; color: var(--navy); font-size: 1.1rem; }
.apy-unrated-title small { color: var(--muted); font-weight: 600; }
.sx-pill-none { color: var(--muted) !important; background: #f1f4f9 !important; font-weight: 700; font-size: .75rem; }
.count-badge { white-space: nowrap; }
.apy-page-gap { padding: 0 .3rem; color: var(--muted); }
.apy-chip-grid a span small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.category-hero-copy .apy-search { max-width: 520px; }
@media (max-width: 760px) { .category-hero-stats { display: none; } }

/* ---------- School page review 2026-11-14 ---------- */
.sx-h1-branch { display: block; margin-top: .25rem; color: var(--muted); font-size: .5em; font-weight: 700; letter-spacing: 0; }
.sx-rating.is-none { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-weight: 700; text-decoration: none; }
.sx-rating.is-none:hover { color: var(--navy-2); text-decoration: underline; }
.sx-address.is-none { cursor: default; }
.sx-call-bar .sx-btn { white-space: nowrap; }
@media (max-width: 760px) { body:has([data-call-bar]) { padding-bottom: calc(88px + env(safe-area-inset-bottom)); } .sx-call-bar { padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); } }
.sx-card-title a { display: inline-block; min-height: 24px; }
.is-soon { cursor: default; }

/* School page: same content width as the header, footer and the other pages (sx.css uses 1280px). */
.sx .sx-wrap { width: min(1152px, calc(100% - 2rem)); }

/* Cookie consent box (bottom, above the phone call bar) */
.apy-consent { position: fixed; left: 50%; bottom: 1rem; z-index: 60; display: flex; align-items: center; gap: 1.2rem; width: min(760px, calc(100% - 2rem)); padding: 1rem 1.2rem; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(15,26,51,.25); }
.apy-consent[hidden] { display: none; }
.apy-consent h2 { margin: 0 0 .25rem; color: var(--navy); font-size: 1rem; }
.apy-consent p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.apy-consent p a { color: var(--navy-2); font-weight: 700; }
.apy-consent-actions { display: flex; gap: .5rem; flex: none; }
.apy-consent-actions .button { min-height: 44px; }
.footer-cookie-link { padding: 0; color: #b4c0d4; background: none; border: 0; font: inherit; cursor: pointer; }
.footer-cookie-link:hover { color: #fff; text-decoration: underline; }
@media (max-width: 640px) {
  .apy-consent { flex-direction: column; align-items: stretch; bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .apy-consent-actions .button { flex: 1; }
}

/* Directory home: "Cómo elegir autoescuela" tips */
.apy-tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; margin: 0; padding: 0; list-style: none; }
.apy-tips-grid li { padding: 1.1rem 1.2rem; background: var(--apy-card); border: 1px solid var(--line); border-radius: 16px; }
.apy-tips-grid h3 { margin: 0 0 .4rem; color: var(--apy-ink); font-size: 1.02rem; line-height: 1.3; }
.apy-tips-grid p { margin: 0; color: var(--muted, #475569); font-size: .94rem; line-height: 1.55; }
.apy-tips-grid a { display: inline-block; margin-top: .3rem; color: var(--apy-orange-text); font-weight: 750; }

/* Consent: per-purpose choices ("Configurar") */
.apy-consent-options { display: grid; gap: .45rem; margin-top: .7rem; }
.apy-consent-options label { display: flex; align-items: flex-start; gap: .55rem; min-height: 44px; padding: .5rem .7rem; background: var(--apy-card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .92rem; }
.apy-consent-options input { width: 20px; height: 20px; margin-top: .1rem; accent-color: var(--apy-orange); flex: none; }

/* Consent box: three buttons fit at 375 px (Aceptar on its own row) */
.apy-consent-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .apy-consent-actions .button { flex: 1 1 40%; min-width: 0; padding-inline: .6rem; }
  .apy-consent-actions [data-consent-accept] { flex-basis: 100%; order: 3; }
}
