/*
 * PETRORAC Web — Proyecto piloto
 * created & helped by gpt, jb & a friend
 */
:root {
  --bg-body: #ffffff;
  --text-body: #222222;
  --bg-section-alt: #f5f5f5;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, .1);
  --hero-bg: url('../assets/doncellas.jpg');
  --hero-overlay: rgba(0, 0, 0, .35);
}

body.theme-dark {
  --bg-body: #14141a;
  --text-body: #f0f0f0;
  --bg-section-alt: #1e1e26;
  --card-bg: #24242e;
  --card-shadow: rgba(0, 0, 0, .5);
  --hero-bg: url('../assets/doncellasnoche.jpg');
  --hero-overlay: rgba(0, 0, 0, .55);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background: var(--bg-body);
  color: var(--text-body);
  scroll-behavior: smooth;
  transition: background .3s ease, color .3s ease;
}

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(var(--hero-overlay), var(--hero-overlay)), var(--hero-bg);
  background-size: cover;
  background-position: center;
  height: 100vh;
  color: #fff;
  transition: background .4s ease;
}

.theme-toggle {
  background: none;
  border: 2px solid rgba(255, 255, 255, .6);
  border-radius: 20px;
  width: 52px;
  height: 30px;
  position: relative;
  cursor: pointer;
  margin-left: auto;
  margin-right: 16px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
}

.theme-toggle .icon-sun { left: 6px; }
.theme-toggle .icon-moon { right: 6px; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 8%;
  position: relative;
}

.logo {
  height: 60px;
}

.navbar ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

.navbar a {
  color: #fff;
  text-decoration: none;
}

.navbar a:hover {
  opacity: .8;
}

.hero-content {
  padding: 12% 8%;
  max-width: 700px;
}

.hero-content h1 {
  font-size: 4rem;
}

.btn {
  display: inline-block;
  margin-top: 20px;
  background: #bb3b34;
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  border: 2px solid #bb3b34;
  transition: background .2s, color .2s;
}

.btn:hover {
  background: #9c2f29;
}

.btn-outline {
  background: transparent;
  color: #bb3b34;
}

.btn-outline:hover {
  background: #f5c518;
  border-color: #f5c518;
  color: #222;
}

.btn-whatsapp {
  background: #25d366;
  border-color: #25d366;
}

.btn-whatsapp:hover {
  background: #1ebc59;
}

/* ---------- Menú hamburguesa (solo se ve/activa en móvil) ---------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
}

/* ---------- Secciones ---------- */
.section {
  padding: 80px 10%;
  position: relative;
}

.gota {
  position: absolute;
  right: 5%;
  width: 220px;
  opacity: .08;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  background: var(--bg-section-alt);
  padding: 40px;
  text-align: center;
  transition: background .3s ease;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.card {
  background: var(--card-bg);
  box-shadow: 0 4px 20px var(--card-shadow);
  border-radius: 14px;
  overflow: hidden;
  transition: background .3s ease;
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card h3 {
  padding: 15px 15px 0;
}

.card p {
  padding: 5px 15px;
}

.whatsapp-link {
  display: inline-block;
  margin: 5px 15px 15px;
  color: #1ebc59;
  font-weight: 600;
  text-decoration: none;
}

.whatsapp-link:hover {
  text-decoration: underline;
}

/* ---------- Precios / tablero digital ---------- */
.precios-intro {
  max-width: 760px;
  margin-top: 10px;
  color: #666;
  line-height: 1.5;
}

.precios-estaciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 18px;
  max-width: 900px;
}

.precio-estacion-tab {
  flex: 1 1 180px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-body);
  padding: 11px 14px;
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.precio-estacion-tab span,
.precio-estacion-tab small {
  display: block;
}

.precio-estacion-tab span {
  font-weight: 700;
  font-size: .98rem;
}

.precio-estacion-tab small {
  margin-top: 2px;
  opacity: .65;
  font-size: .76rem;
}

.precio-estacion-tab:hover {
  transform: translateY(-1px);
}

.precio-estacion-tab.active {
  border-color: #bb3b34;
  box-shadow: 0 0 0 2px rgba(187, 59, 52, .12);
}

.precios-tablero {
  width: min(900px, 100%);
  max-width: 900px;
  background:
    linear-gradient(180deg, #171717, #050505);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .2);
  overflow: hidden;
}

.precio-fila {
  display: grid;
  grid-template-columns: minmax(130px, .55fr) minmax(220px, 1fr);
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.precio-fila:last-child {
  border-bottom: none;
}

.precio-producto {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 16px;
  color: #f4f4f4;
  font-weight: 700;
  letter-spacing: .01em;
}

.precio-indicador {
  width: 8px;
  align-self: stretch;
  border-radius: 2px;
  background: #168447;
  box-shadow: 0 0 10px rgba(22, 132, 71, .55);
}

.precio-fila-premium .precio-indicador {
  background: #b23a35;
  box-shadow: 0 0 10px rgba(178, 58, 53, .45);
}

.precio-fila-diesel .precio-indicador {
  background: #686868;
  box-shadow: 0 0 10px rgba(180, 180, 180, .25);
}

.precio-nombre {
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.precio-digital {
  justify-self: stretch;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 18px;
  font-family: "Courier New", "Lucida Console", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: .055em;
  text-shadow:
    0 0 4px rgba(58, 255, 116, .75),
    0 0 12px rgba(58, 255, 116, .45);
}

.precio-digital > span:not(.precio-unidad):not(.precio-signo) {
  color: #56ff7f;
  font-size: clamp(2.45rem, 7vw, 4.6rem);
  font-weight: 800;
  line-height: 1;
}

.precio-signo,
.precio-unidad {
  color: #43ec6d;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(67, 236, 109, .42);
}

.precio-signo {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.precio-unidad {
  font-size: .92rem;
  opacity: .86;
  letter-spacing: .04em;
}

.precios-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  margin-top: 14px;
}

.precios-actualizado,
.precios-fuente {
  margin: 0;
  font-size: .82rem;
  color: #777;
}

.precios-fuente {
  font-weight: 700;
}

.precios-disclaimer {
  margin-top: 9px;
  font-size: .76rem;
  color: #999;
  max-width: 760px;
  line-height: 1.45;
}

body.theme-dark .precios-intro,
body.theme-dark .precios-actualizado,
body.theme-dark .precios-fuente {
  color: #bbb;
}

body.theme-dark .precio-estacion-tab {
  border-color: #3a3a46;
}

@media (max-width: 600px) {
  .precio-fila {
    grid-template-columns: 1fr;
  }

  .precio-producto {
    min-height: 54px;
    padding: 12px 14px 6px;
  }

  .precio-indicador {
    width: 7px;
    align-self: center;
    min-height: 28px;
  }

  .precio-digital {
    min-height: 78px;
    padding: 8px 12px 16px;
  }
}

/* ---------- Mapa desplegable ---------- */
.map-toggle {
  display: block;
  width: calc(100% - 30px);
  margin: 0 15px 15px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: #444;
}

.map-toggle:hover {
  background: #f5f5f5;
}

.map-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}

.map-wrap.open {
  max-height: 300px;
}

.map-wrap iframe {
  width: 100%;
  height: 250px;
  border: 0;
  display: block;
}

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
}

.wa-float button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
  padding: 10px;
  margin-bottom: 12px;
  min-width: 150px;
}

.wa-menu.open {
  display: flex;
}

.wa-menu a {
  text-decoration: none;
  color: #222;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: .9rem;
}

.wa-menu a:hover {
  background: #f0f0f0;
}

.dark {
  background: #202020;
  color: #fff;
}

/* ---------- Lightbox de imágenes ---------- */
.lightbox-img {
  cursor: zoom-in;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Promociones ---------- */
.promos-intro {
  margin-bottom: 20px;
  opacity: .85;
}

.promo-card {
  background: #2a2a2a;
  box-shadow: none;
  padding: 20px;
}

.promo-card h3 {
  padding: 0 0 8px;
  color: #f5c518;
}

.promo-card p {
  padding: 0;
  opacity: .85;
}

.promos-nota {
  margin-top: 20px;
  font-size: .8rem;
  opacity: .6;
}


/* ---------- Promociones con imagen ---------- */
.promo-card-petrorac {
  padding: 0;
}

.promo-card-petrorac > .lightbox-img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  cursor: zoom-in;
}

.promo-card-contenido {
  padding: 15px 20px 20px;
}

.promo-card-contenido h3 {
  padding: 0 0 8px;
}

.promo-card-contenido p {
  padding: 0;
  margin-bottom: 0;
}

#petroracPromosCards > p,
#yayaPromosCards > p {
  width: 100%;
  grid-column: 1 / -1;
}

/* ---------- Feed de Facebook ---------- */
.fb-feed {
  margin-top: 40px;
  max-width: 700px;
}

.fb-feed h3 {
  margin-bottom: 12px;
}

.fb-feed .fb-page,
.fb-feed iframe {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 600px) {
  .fb-feed {
    max-width: 100%;
  }
}

.fb-ham-link {
  display: inline-block;
  margin-top: 12px;
  color: #bb3b34;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}

.fb-ham-link:hover {
  text-decoration: underline;
}

.grupo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
}

.grupo img {
  max-width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.contact-buttons {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ---------- Grupo HAM / Socios comerciales ---------- */
.ham-banner {
  display: block;
  max-width: 100%;
  width: 500px;
  margin: 20px auto;
  border-radius: 14px;
  box-shadow: 0 4px 20px var(--card-shadow);
}

.socios-desplegable {
  max-width: 900px;
  margin: 10px auto 0;
  border: 1px solid rgba(150, 150, 150, .3);
  border-radius: 10px;
  padding: 12px 18px;
}

.socios-desplegable summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
  list-style: none;
}

.socios-desplegable summary::-webkit-details-marker {
  display: none;
}

.socios-tabla-wrap {
  margin-top: 15px;
  overflow-x: auto;
}

.socios-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.socios-tabla th,
.socios-tabla td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(150, 150, 150, .2);
  text-align: left;
  vertical-align: top;
}

.socios-tabla th {
  color: #bb3b34;
  font-size: .8rem;
  text-transform: uppercase;
}

.socios-nota {
  margin-top: 12px;
  font-size: .8rem;
  opacity: .7;
}

footer {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 30px;
}

/* ---------- Animación al hacer scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .navbar ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, .9);
    flex-direction: column;
    gap: 0;
    text-align: center;
  }

  .navbar ul.open {
    display: flex;
  }

  .navbar ul li {
    padding: 14px 0;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .stats {
    flex-direction: column;
    gap: 20px;
  }

  .grupo {
    grid-template-columns: 1fr;
  }
}
