/*
Theme Name: Coches Granada Master
Theme URI: https://cochesgranada.com/
Author: J7 Network
Description: Tema ligero y orientado a conversión para el ecosistema provincial CochesGranada.com.
Version: 3.1.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: cochesgranada
*/

:root {
  --cg-ink: #0b1118;
  --cg-paper: #f4f1ea;
  --cg-white: #fff;
  --cg-gold: #d2a84a;
  --cg-red: #d9483b;
  --cg-green: #13a36f;
  --cg-muted: #68727d;
  --cg-line: rgba(11,17,24,.12);
  --cg-radius: 24px;
  --cg-shadow: 0 22px 70px rgba(11,17,24,.13);
  --cg-max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--cg-ink); background: var(--cg-paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.cg-shell { width: min(calc(100% - 40px), var(--cg-max)); margin-inline: auto; }
.cg-kicker { margin: 0 0 12px; color: var(--cg-gold); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.cg-section { padding: clamp(72px, 9vw, 128px) 0; }
.cg-section--dark { color: var(--cg-white); background: var(--cg-ink); }
.cg-section__head { display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; align-items: end; margin-bottom: 38px; }
.cg-section h2 { max-width: 800px; margin: 0; font-size: clamp(2.2rem, 5vw, 4.8rem); line-height: .98; letter-spacing: -.055em; }
.cg-section__head p { margin: 0; color: var(--cg-muted); }
.cg-section--dark .cg-section__head p { color: rgba(255,255,255,.68); }
.cg-btn { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: 10px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; background: var(--cg-gold); color: var(--cg-ink); font-weight: 800; cursor: pointer; transition: transform .2s, background .2s, color .2s; }
.cg-btn:hover, .cg-btn:focus-visible { transform: translateY(-2px); background: #e1bb60; }
.cg-btn--ghost { color: var(--cg-white); border-color: rgba(255,255,255,.36); background: rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.cg-btn--ghost:hover { color: var(--cg-ink); background: var(--cg-white); }
.cg-btn--dark { color: var(--cg-white); background: var(--cg-ink); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.cg-lead-form input.screen-reader-text { position: absolute !important; width: 1px !important; min-width: 1px !important; height: 1px !important; min-height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.cg-header { position: sticky; z-index: 30; top: 0; color: var(--cg-white); background: rgba(11,17,24,.94); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(16px); }
.cg-header__inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.cg-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -.04em; }
.cg-brand__mark { width: 34px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 11px; background: var(--cg-gold); color: var(--cg-ink); }
.cg-brand small { display: block; color: rgba(255,255,255,.55); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.cg-nav ul { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; }
.cg-nav a { color: rgba(255,255,255,.83); font-size: .92rem; font-weight: 650; }
.cg-nav a:hover { color: var(--cg-white); }
.cg-menu-toggle { display: none; border: 0; color: var(--cg-white); background: transparent; font-weight: 800; }

.cg-hero { position: relative; min-height: min(840px, calc(100svh - 72px)); display: grid; align-items: end; overflow: hidden; color: var(--cg-white); background: var(--cg-ink); }
.cg-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,9,13,.94) 0%, rgba(5,9,13,.67) 42%, rgba(5,9,13,.12) 77%), linear-gradient(0deg, rgba(5,9,13,.82), transparent 52%), var(--cg-hero) center/cover no-repeat; }
.cg-hero__content { position: relative; z-index: 1; padding: clamp(90px, 14vh, 150px) 0 58px; }
.cg-hero h1 { max-width: 920px; margin: 0 0 22px; font-size: clamp(3.3rem, 7.8vw, 7.2rem); line-height: .88; letter-spacing: -.075em; }
.cg-hero__lead { max-width: 650px; margin: 0 0 30px; color: rgba(255,255,255,.78); font-size: clamp(1rem, 1.6vw, 1.25rem); }
.cg-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cg-search-panel { position: relative; z-index: 2; margin: 0 auto -56px; width: min(calc(100% - 40px), var(--cg-max)); padding: 24px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--cg-radius); background: rgba(255,255,255,.96); box-shadow: var(--cg-shadow); color: var(--cg-ink); }
.cg-intent-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; }
.cg-intent-tabs a { white-space: nowrap; padding: 9px 14px; border-radius: 999px; background: #edf0f2; font-size: .86rem; font-weight: 800; }
.cg-intent-tabs a:first-child { background: var(--cg-ink); color: var(--cg-white); }
.cg-search-form { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr) auto; gap: 10px; }
.cg-search-form--revenue { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.cg-field label { display: block; margin: 0 0 6px; color: var(--cg-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.cg-field input, .cg-field select, .cg-lead-form input, .cg-lead-form select, .cg-lead-form textarea { width: 100%; min-height: 48px; border: 1px solid var(--cg-line); border-radius: 12px; background: var(--cg-white); padding: 0 13px; color: var(--cg-ink); }
.cg-search-form .cg-btn { align-self: end; }

.cg-intents { padding-top: 130px; }
.cg-card-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.cg-card { position: relative; min-height: 350px; grid-column: span 4; display: flex; align-items: end; overflow: hidden; border-radius: var(--cg-radius); background: #171f28; box-shadow: var(--cg-shadow); }
.cg-card:nth-child(1), .cg-card:nth-child(2) { grid-column: span 6; min-height: 430px; }
.cg-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,9,13,.92), rgba(5,9,13,.04) 72%); }
.cg-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.cg-card:hover img { transform: scale(1.035); }
.cg-card__body { position: relative; z-index: 1; padding: 26px; color: var(--cg-white); }
.cg-card__body h3 { margin: 0 0 8px; font-size: clamp(1.45rem, 2.4vw, 2.15rem); letter-spacing: -.035em; }
.cg-card__body p { max-width: 460px; margin: 0; color: rgba(255,255,255,.72); }

.cg-budget { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; }
.cg-budget__choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cg-choice { padding: 22px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.055); }
.cg-choice strong { display: block; color: var(--cg-gold); font-size: 1.3rem; }
.cg-choice span { color: rgba(255,255,255,.62); font-size: .86rem; }

.cg-territory { display: grid; grid-template-columns: 1.05fr .95fr; gap: 0; overflow: hidden; border-radius: calc(var(--cg-radius) + 8px); background: var(--cg-white); box-shadow: var(--cg-shadow); }
.cg-territory img { width: 100%; height: 100%; min-height: 520px; object-fit: cover; }
.cg-territory__copy { padding: clamp(36px, 6vw, 72px); align-self: center; }
.cg-territory__copy h2 { margin: 0 0 18px; font-size: clamp(2.3rem, 4vw, 4.5rem); line-height: .98; letter-spacing: -.055em; }
.cg-zones { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.cg-zones span { padding: 8px 12px; border-radius: 999px; background: #eef0f2; color: #39434d; font-size: .8rem; font-weight: 750; }

.cg-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border-radius: var(--cg-radius); background: rgba(255,255,255,.12); }
.cg-trust__item { padding: 30px; background: #111923; }
.cg-trust__item strong { display: block; margin-bottom: 8px; color: var(--cg-gold); font-size: 1.35rem; }
.cg-trust__item span { color: rgba(255,255,255,.62); font-size: .88rem; }

.cg-cta { display: grid; grid-template-columns: 1fr .9fr; gap: 36px; align-items: center; padding: clamp(34px, 6vw, 70px); border-radius: calc(var(--cg-radius) + 8px); background: var(--cg-gold); }
.cg-cta h2 { margin: 0; font-size: clamp(2.3rem, 5vw, 5rem); line-height: .92; letter-spacing: -.06em; }
.cg-lead-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cg-lead-form textarea, .cg-lead-form .cg-form-wide { grid-column: 1 / -1; }
.cg-lead-form textarea { min-height: 100px; padding-top: 12px; resize: vertical; }
.cg-consent { grid-column: 1 / -1; display: flex; gap: 9px; align-items: flex-start; font-size: .78rem; }
.cg-consent input { width: auto; min-height: auto; margin-top: 3px; }
.cg-lead-form > label:not(.cg-consent) { display: block; }
.cg-lead-form > label:not(.cg-consent) input { height: 100%; }
.cg-form-status { grid-column: 1 / -1; min-height: 22px; font-size: .85rem; font-weight: 700; }
.cg-form-status.is-success { color: #075b3e; }
.cg-form-status.is-error { color: #8d1f17; }
.cg-notice { margin: 18px 0; padding: 16px 18px; border-radius: 14px; background: #fff4d4; border: 1px solid #e5c870; }

.cg-footer { padding: 54px 0 28px; color: rgba(255,255,255,.7); background: #070b10; }
.cg-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 34px; }
.cg-footer h3 { color: var(--cg-white); }
.cg-footer ul { margin: 0; padding: 0; list-style: none; }
.cg-footer li { margin: 8px 0; }
.cg-footer__bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.09); font-size: .8rem; }

.cg-page { min-height: 65vh; padding: 0 0 clamp(70px, 9vw, 120px); }
.cg-page-hero { position: relative; min-height: clamp(390px, 54vw, 650px); display: flex; align-items: end; overflow: hidden; color: var(--cg-white); background: var(--cg-ink); }
.cg-page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,9,13,.94), rgba(5,9,13,.64) 48%, rgba(5,9,13,.14)), linear-gradient(0deg, rgba(5,9,13,.75), transparent 60%), var(--cg-page-image) center/cover no-repeat; }
.cg-page-hero__content { position: relative; z-index: 1; padding-block: clamp(70px, 10vw, 120px) 58px; }
.cg-page h1 { max-width: 1050px; margin: 0 0 20px; font-size: clamp(2.8rem, 6.5vw, 6.4rem); line-height: .9; letter-spacing: -.065em; }
.cg-page-hero__intro { max-width: 650px; margin: 0; color: rgba(255,255,255,.78); font-size: clamp(1rem, 1.8vw, 1.25rem); }
.cg-page-content { padding-top: clamp(42px, 7vw, 82px); }
.cg-page-content > p:first-child { max-width: 780px; color: var(--cg-muted); font-size: 1.08rem; }
.cg-page-content > .cg-cta:first-child { margin-top: 0 !important; }
.cg-listing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cg-vehicle { overflow: hidden; border-radius: 20px; background: var(--cg-white); box-shadow: 0 16px 46px rgba(11,17,24,.08); }
.cg-vehicle__image { display:block; width:100%; aspect-ratio:3/2; object-fit:cover; background:#e7e4dd; }
.cg-vehicle__source { color:var(--cg-muted); font-size:.78rem; margin:.7rem 0 0; }
.cg-market-actions { display:flex; flex-wrap:wrap; gap:12px; margin:24px 0; align-items:center; }
.cg-alert-form { margin-top:24px; padding:24px; border:1px solid var(--cg-line); border-radius:18px; background:var(--cg-white); }
.cg-alert-form input[type="email"] { width:min(100%,420px); min-height:48px; padding:0 14px; border:1px solid var(--cg-line); border-radius:10px; margin-right:8px; }
.cg-alert-form h3 { margin-top:0; }
.cg-vehicle__body { padding: 20px; }
.cg-vehicle h2 { margin: 0 0 10px; font-size: 1.35rem; }
.cg-price { color: var(--cg-red); font-size: 1.35rem; font-weight: 900; }
.cg-vehicle-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }
.cg-vehicle-facts div { padding: 18px; border: 1px solid var(--cg-line); border-radius: 14px; background: var(--cg-white); }
.cg-vehicle-facts dt { color: var(--cg-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.cg-vehicle-facts dd { margin: 5px 0 0; font-weight: 800; }

@media (max-width: 980px) {
  .cg-menu-toggle { display: block; }
  .cg-nav { position: absolute; display: none; inset: 72px 0 auto; padding: 22px; background: var(--cg-ink); }
  .cg-nav.is-open { display: block; }
  .cg-nav ul { align-items: stretch; flex-direction: column; }
  .cg-search-form { grid-template-columns: repeat(2, 1fr); }
  .cg-search-form .cg-btn { grid-column: 1 / -1; }
  .cg-card, .cg-card:nth-child(1), .cg-card:nth-child(2) { grid-column: span 6; min-height: 360px; }
  .cg-budget, .cg-territory, .cg-cta { grid-template-columns: 1fr; }
  .cg-trust { grid-template-columns: repeat(2, 1fr); }
  .cg-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .cg-shell { width: min(calc(100% - 24px), var(--cg-max)); }
  .cg-brand small { display: none; }
  .cg-hero { min-height: 760px; }
  .cg-hero::before { background: linear-gradient(0deg, rgba(5,9,13,.97) 0%, rgba(5,9,13,.48) 62%, rgba(5,9,13,.15)), var(--cg-hero-mobile) center/cover no-repeat; }
  .cg-hero h1 { font-size: clamp(3.2rem, 16vw, 5.2rem); }
  .cg-search-panel { padding: 16px; }
  .cg-search-form { grid-template-columns: 1fr; }
  .cg-search-form .cg-btn { grid-column: auto; }
  .cg-card, .cg-card:nth-child(1), .cg-card:nth-child(2) { grid-column: 1 / -1; min-height: 330px; }
  .cg-section__head { grid-template-columns: 1fr; gap: 16px; }
  .cg-budget__choices, .cg-trust, .cg-listing { grid-template-columns: 1fr; }
  .cg-vehicle-facts { grid-template-columns: repeat(2, 1fr); }
  .cg-territory img { min-height: 330px; }
  .cg-lead-form, .cg-footer__grid { grid-template-columns: 1fr; }
  .cg-lead-form > * { grid-column: 1 !important; }
}
