:root {
  --green: #1f7a3f;
  --green-dark: #14552a;
  --green-soft: #e9f7ee;
  --text: #1d1d1f;
  --muted: #5f6368;
  --white: #ffffff;
  --bg: #f6f8f7;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --max: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding-top: 150px;
}

body.menu-open {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(92%, var(--max));
  margin: 0 auto;
}

/* TOPBAR */
.topbar {
  background: var(--green);
  color: var(--white);
  font-size: 0.95rem;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.topbar-group {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.topbar a:hover {
  text-decoration: underline;
}

/* NAVBAR */
.navbar {
  background: #22a550;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  padding: 12px 0 14px;
}

.site-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
}

.site-brand strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: 0.2px;
  color: var(--white);
}

.site-brand span {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
}

.menu-toggle {
  display: none;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.menu::-webkit-scrollbar {
  height: 6px;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--white);
  transition: color 0.2s ease, background 0.2s ease;
  padding: 10px 12px;
  border-radius: 10px;
  white-space: nowrap;
  font-size: 0.92rem;
  flex: 0 0 auto;
}

.menu a:hover,
.menu a.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

/* LAYOUT PRINCIPAL CON PUBLICIDAD DERECHA */
.main-with-sidebar {
  width: min(94%, 1380px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.main-content {
  min-width: 0;
}

.right-ads {
  position: sticky;
  top: 165px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ads-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6b7280;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 4px;
}

.ad-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.ad-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ad-card h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #111827;
}

.ad-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 14px;
  color: #4b5563;
}

.ad-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 7px;
}

.ad-list li {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  color: #1f2937;
}

.ad-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.86rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ad-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

.ad-btn-primary {
  background: #1f7a3f;
  color: #fff;
}

.ad-btn-secondary {
  background: #fff;
  color: #1f7a3f;
  border: 1px solid #cfe7d7;
}

/* HERO */
.hero {
  padding: 42px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
  margin-bottom: 18px;
}

.hero-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 24px;
  max-width: 62ch;
}

.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.badge {
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
}

.btn-secondary {
  border-color: var(--green);
  color: var(--green);
  background: var(--white);
}

/* SLIDER */
.hero-card {
  background: var(--white);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.slider {
  position: relative;
  min-height: 440px;
}

.slide {
  display: none;
  position: absolute;
  inset: 0;
  padding: 26px;
  background-size: cover;
  background-position: center;
  color: var(--white);
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
}

.slide.active {
  display: flex;
  align-items: end;
}

.slide-content {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.slide-content h2 {
  font-size: 1.9rem;
  line-height: 1.15;
  margin-bottom: 10px;
}

.slide-content p {
  font-size: 1rem;
  opacity: 0.98;
}

.slider-controls {
  position: absolute;
  inset-inline: 0;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 5;
}

.slider-buttons {
  display: flex;
  gap: 10px;
}

.slider-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
}

.slider-btn:hover {
  background: #ffffff;
}

.dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
}

.dot.active {
  background: #fff;
}

/* SECTIONS */
.section {
  padding: 56px 0;
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin-bottom: 12px;
  line-height: 1.15;
}

.section-text {
  color: var(--muted);
  max-width: 78ch;
  margin-bottom: 28px;
  font-size: 1.04rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  line-height: 1.25;
}

.card p {
  color: var(--muted);
  flex-grow: 1;
}

.experience {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.experience strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  margin-bottom: 10px;
}

.experience span {
  font-size: 1.15rem;
  font-weight: 600;
}

.seo-box {
  background: #ffffff;
  border-left: 6px solid var(--green);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

/* FOOTER */
.footer {
  background: var(--green);
  color: var(--white);
  padding: 26px 0;
  margin-top: 30px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* FLOATING BUTTONS */
.floating-actions {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 12px;
  z-index: 1200;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 1.35rem;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.fab-whatsapp {
  background: #25d366;
}

.fab-top {
  background: var(--green-dark);
}

/* UTILIDADES GENERALES */
.page-hero {
  padding: 72px 0 48px;
  background: linear-gradient(135deg, #f2f8f3, #ffffff);
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.page-hero p {
  color: var(--muted);
  max-width: 70ch;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.content-box {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

.content-box h2,
.content-box h3 {
  margin-bottom: 12px;
}

.content-box p,
.content-box li {
  color: var(--muted);
}

.content-box ul {
  padding-left: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d8dedd;
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.full-width {
  grid-column: 1 / -1;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* CHECKS LEGALES */
.legal-checks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-item input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.check-item label {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}

/* COCHES */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.car-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

.car-image-wrap {
  position: relative;
}

.car-image-wrap img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.car-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--green);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.car-badge-secondary {
  position: absolute;
  top: 54px;
  left: 14px;
  background: #ffffff;
  color: var(--green-dark);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.car-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.car-title {
  font-size: 1.25rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.car-price {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 14px;
}

.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.car-specs span {
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}

.car-description {
  color: var(--muted);
  margin-bottom: 18px;
  flex-grow: 1;
}

.car-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* DETALLE COCHE */
.detail-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  align-items: start;
}

.detail-main-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.detail-thumbs img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-thumbs img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.detail-price {
  font-size: 2rem;
  color: var(--green-dark);
  margin-bottom: 12px;
}

.detail-quick-specs {
  display: grid;
  gap: 10px;
  margin: 18px 0 22px;
}

.detail-quick-specs div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4e7e6;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-spec-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.detail-spec-table div {
  background: var(--white);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.detail-spec-table strong {
  color: var(--text);
}

.detail-spec-table span {
  color: var(--muted);
  text-align: right;
}

/* FILTROS */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-btn {
  border: none;
  background: var(--white);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--green);
  color: var(--white);
  transform: translateY(-2px);
}

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #111;
  color: #fff;
  padding: 16px;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.2);
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cookie-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-banner a {
  color: #9fe3b5;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
}

.cookie-actions button {
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

#acceptCookies {
  background: #1f7a3f;
  color: #fff;
}

#rejectCookies {
  background: #e5e7eb;
  color: #111;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .main-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
}

@media (max-width: 1100px) {
  body {
    padding-top: 155px;
  }

  .site-brand strong {
    font-size: 1.2rem;
  }

  .site-brand span {
    font-size: 0.9rem;
  }

  .menu a {
    font-size: 0.88rem;
    padding: 8px 10px;
  }

  .cars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .main-with-sidebar {
    grid-template-columns: 1fr;
  }

  .right-ads {
  position: sticky;
  top: 188px;
}

  .ads-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  body {
    padding-top: 155px;
  }

  .hero-grid,
  .grid-3,
  .page-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .slider {
    min-height: 360px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .detail-spec-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body {
    padding-top: 160px;
  }

  .menu-toggle {
    display: inline-flex;
    margin: 0 auto;
  }

  .nav-inner {
    justify-content: center;
  }

  .menu {
    display: none;
    position: absolute;
    left: 4%;
    right: 4%;
    top: 52px;
    background: var(--white);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    max-height: 75vh;
    overflow-y: auto;
    gap: 8px;
    z-index: 1200;
  }

  .menu.open {
    display: flex;
  }

  .menu a {
    width: 100%;
    justify-content: flex-start;
    color: var(--text);
  }

  .site-brand strong {
    font-size: 1.15rem;
  }

  .site-brand span {
    font-size: 0.88rem;
  }
}

@media (max-width: 700px) {
  .right-ads,
  .cars-grid {
    grid-template-columns: 1fr;
  }

  .car-image-wrap img {
    height: 220px;
  }
}

@media (max-width: 640px) {
  body {
    padding-top: 205px;
  }

  .topbar-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-group {
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 24px;
  }

  .slider {
    min-height: 320px;
  }

  .slide {
    padding: 20px;
  }

  .slide-content h2 {
    font-size: 1.45rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .floating-actions {
    right: 14px;
    bottom: 14px;
  }

  .fab {
    width: 52px;
    height: 52px;
  }

  .site-brand strong {
    font-size: 1.1rem;
  }

  .site-brand span {
    font-size: 0.88rem;
  }

  .detail-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-thumbs img {
    height: 75px;
  }

  .filter-bar {
    gap: 10px;
  }

  .filter-btn {
    width: 100%;
    justify-content: center;
  }

  .car-badge-secondary {
    top: 50px;
    font-size: 0.76rem;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 215px;
  }

  .section,
  .page-hero {
    padding-left: 0;
    padding-right: 0;
  }

  .card,
  .content-box,
  .seo-box,
  .experience {
    padding: 20px;
  }

  .site-brand strong {
    font-size: 1rem;
  }

  .site-brand span {
    font-size: 0.82rem;
  }

  .menu-toggle {
    font-size: 0.92rem;
  }

  .check-item {
    gap: 8px;
  }

  .check-item label {
    font-size: 0.95rem;
  }
}

.form-grid select {
  appearance: none;
}

@media (min-width: 981px) {
  .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-group.full-width {
    grid-column: 1 / -1;
  }
}