/* ============================================
   CAMPESTRE DRIVE IN — styles.css
   ============================================ */

/* ---------- Variables y reset ---------- */
:root {
  --rojo:      #731c3f;
  --rojo-dark: #621333;
  --verde: #186451;
  --gris-claro:#f5f5f5;
  --gris-borde:#e0e0e0;
  --texto:     #333333;
  --texto-suave:#666666;
  --blanco:    #ffffff;
  --navbar-h:  90px;
  --shadow:    0 4px 20px rgba(0,0,0,0.10);
  --radius:    12px;
  --transition:0.25s ease;
}

h1, h2, h3, h4 {
  font-weight: 400;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--texto);
  background: var(--blanco);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--blanco);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  height: var(--navbar-h);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links > a,
.nav-links > .dropdown > .dropdown-toggle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--texto);
  cursor: pointer;
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.nav-links > a:hover,
.nav-links > .dropdown:hover .dropdown-toggle {
  color: var(--verde);
}

.nav-phone {
  border: 2px solid var(--rojo);
  border-radius: 50px;
  padding: 8px 24px;
  font-weight: 700;
  color: var(--rojo) !important;
  transition: background var(--transition), color var(--transition);
}

.nav-phone:hover {
  background: var(--rojo);
  color: var(--blanco) !important;
}

/* Iconos sociales en el navbar */
.nav-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-social a {
  color: var(--gris-texto);
  font-size: 1.1rem;
  transition: color var(--transition);
  line-height: 1;
}

.nav-social a:hover {
  color: var(--rojo);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.dropdown-toggle .fa-chevron-down {
  transition: transform var(--transition);
  font-size: 0.7rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--blanco);
  min-width: 220px;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.14);
  overflow: hidden;
  z-index: 100;
}

.dropdown-menu.open {
  display: block;
  animation: fadeDown 0.2s ease;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-menu a {
  display: block;
  padding: 14px 22px;
  font-size: 0.92rem;
  color: var(--texto);
  transition: background var(--transition), color var(--transition);
}

.dropdown-menu a:hover {
  background: var(--gris-claro);
  color: var(--verde);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--texto);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============================================
   HERO SLIDER
   ============================================ */
.hero {
  margin-top: var(--navbar-h);
}

.slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slide {
  display: none;
  width: 100%;
}

.slide.active {
  display: flex;
  justify-content: center;
  animation: slideFade 0.7s ease;
}

@keyframes slideFade {
  from {transform: translateX(18px); }
  to   {transform: translateX(0); }
}

.slide img {
  width: 80vw;
  height: 74vh;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Botones slider — ocultos (se navega con swipe/dots) */
.slider-btn {
  display: none;
}

/* Dots */
.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  border: 2px solid rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.dot.active {
  background: var(--blanco);
  transform: scale(1.2);
}

/* ============================================
   SECCIÓN NOSOTROS
   ============================================ */
.nosotros {
  padding: 60px 24px;
  background: var(--blanco);
}

.nosotros-container {
  max-width: 940px;
  margin: 0 auto;
  text-align: center;
}

.nosotros-container h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--rojo);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.nosotros-container p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--texto-suave);
  text-align: justify;
}

/* ============================================
   CARRUSEL DE LOGOS
   ============================================ */
.logos-section {
  background: var(--gris-claro);
  padding: 50px 24px 40px;
}

.logos-carousel-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logos-carousel-viewport {
  flex: 1;
  overflow: hidden;
}

.logos-carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.logo-item {
  background: var(--blanco);
  border-radius: 10px;
  padding: 0;
  /* ancho fijo: viewport ÷ 4 items − gap */
  flex: 0 0 calc(25% - 15px);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  /* Cuadrado: altura = anchura */
  aspect-ratio: 1 / 1;
}

.logo-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.logo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(30%);
  transition: filter var(--transition);
}

.logo-item:hover img {
  filter: grayscale(0%);
}

/* Botones del carrusel de logos — ocultos (se navega con swipe/dots) */
.logos-btn {
  display: none;
}

/* Dots del carrusel de logos */
.logos-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.logos-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ccc;
  border: 2px solid #ccc;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.logos-dots .dot.active {
  background: var(--rojo);
  border-color: var(--rojo);
  transform: scale(1.2);
}

/* ============================================
   PÁGINAS DE CATEGORÍAS
   ============================================ */
.category-page {
  display: none;
  min-height: 100vh;
  padding-top: var(--navbar-h);
  background: var(--blanco);
}

.category-page.active {
  display: block;
}

/* Ocultar home cuando hay categoría activa */
body.cat-open #home-content,
body.cat-open .footer {
  display: none;
}

.cat-page-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cat-page-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--rojo);
}

.back-btn {
  background: none;
  border: 2px solid var(--rojo);
  color: var(--rojo);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background var(--transition), color var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.back-btn:hover {
  background: var(--rojo);
  color: var(--blanco);
}

/* ============================================
   GRID DE LOCALES (tarjetas)
   ============================================ */
.locals-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 24px;
}

/* Tarjeta de local */
.local-card {
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

.local-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.14);
}

/* Indicador de hover */
.local-card::after {
  content: 'Ver fotos';
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--rojo);
  color: var(--blanco);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.local-card:hover::after {
  opacity: 1;
}

.local-card-img {
  width: 170px;
  min-width: 170px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}

.local-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  padding: 8px;
}

.local-card:hover .local-card-img img {
  transform: scale(1.04);
}

.local-card-info {
  padding: 22px 24px;
  flex: 1;
}

.local-card-info h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--rojo);
  margin-bottom: 10px;
}

.local-card-info p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--texto-suave);
  margin-bottom: 2px;
}

.local-card-info p strong {
  color: var(--texto);
}

/* Social icons en tarjeta */
.local-social {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.local-social a {
  color: var(--texto-suave);
  font-size: 1.15rem;
  transition: color var(--transition), transform var(--transition);
}

.local-social a:hover {
  color: var(--rojo);
  transform: scale(1.15);
}

/* ============================================
   POPUP DE IMÁGENES
   ============================================ */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: overlayFade 0.25s ease;
}

.popup-overlay.open {
  display: flex;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.popup-box {
  background: var(--blanco);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 680px;
  width: calc(100% - 40px);
  position: relative;
  animation: popupSlide 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes popupSlide {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: var(--gris-claro);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.popup-close:hover {
  background: var(--rojo);
  color: var(--blanco);
}

.popup-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--rojo);
  margin-bottom: 18px;
}

.popup-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.popup-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  transition: transform var(--transition), box-shadow var(--transition);
}

.popup-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.popup-hint {
  text-align: center;
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 14px;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  position: relative;
  color: #fff;
  padding: 60px 24px 0;
  /* Imagen de fondo — reemplaza con tu ruta real */
  background-image: url('img/footer-bg.webp');
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a; /* fallback si no hay imagen */
  overflow: hidden;
}

/* Overlay oscuro sobre la imagen */
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 15, 0.82);
  z-index: 0;
}

.footer-container,
.footer-copy {
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-logo img {
  height: 70px;
  width: auto;
}

.footer-info h4 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--blanco);
  margin-bottom: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.footer-info li {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

.footer-info li i {
  color: var(--verde);
  margin-top: 3px;
  min-width: 14px;
}

.footer-info a {
  color: rgba(255,255,255,0.85);
  transition: color var(--transition);
}

.footer-info a:hover {
  color: var(--blanco);
}

.footer-copy {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet y mobile: hamburguesa desde 1024px */
@media (max-width: 1024px) {
  .locals-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--navbar-h);
    left: 0;
    width: 100%;
    background: var(--blanco);
    flex-direction: column;
    align-items: center;
    padding: 16px 0 24px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    gap: 0;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  /* Links de texto: centrados, sin ancho completo */
  .nav-links > a,
  .nav-links > .dropdown > .dropdown-toggle {
    padding: 12px 24px;
    width: auto;
    text-align: center;
  }

  .nav-links > .dropdown {
    position: relative;
  }

  /* Botón de teléfono: centrado pero sin ocupar todo el ancho */
  .nav-phone {
    margin-top: 8px;
    width: auto;
    display: inline-block;
    text-align: center;
  }

  .nav-social {
    margin-top: 24px;
  }

  .hamburger {
    display: flex;
  }

  .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-top: none;
    border-radius: var(--radius);
    animation: none !important;
    text-align: center;
    min-width: 200px;
    width: auto;
    z-index: 1001;
  }

  .dropdown-menu a {
    padding: 11px 24px;
    font-size: 0.9rem;
    text-align: center;
  }

  .slide img {
    height: 48vh;
  }
}

@media (max-width: 768px) {
  .slide img {
    height: 240px;
  }

  .local-card {
    flex-direction: column;
  }

  .local-card-img {
    width: 100%;
    min-width: unset;
    height: 200px;
  }

  .popup-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-container {
    gap: 24px;
  }

  /* Logos carousel: 2 por slide en mobile */
  .logo-item {
    flex: 0 0 calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .logo-item {
    flex: 0 0 calc(100% - 0px);
  }

  .popup-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .popup-gallery img {
    height: 120px;
  }

  .back-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    gap: 7px;
  }

  .cat-page-header h2 {
    font-size: 1.5rem;
  }
}