/* ===== BODY ===== */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: white;
  -webkit-text-size-adjust: 100%;
}

/* Truco para evitar el bug de Safari iOS con background-attachment: fixed */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: url("fondo.jpg");
  background-size: cover;
  background-position: center;
}

/* ===== LOGO ===== */
.logo {
  text-align: center;
  padding: 30px 20px 20px 20px;
  /* Halo oscuro radial para asegurar que el logo resalte siempre */
  background: radial-gradient(circle, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 70%);
}

.logo img {
  width: 160px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); /* Sombra extra al logo */
}

/* ===== NAV ===== */
.categorias {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  padding: 8px 10px; /* Reducimos el margen interno (antes 10px) */
  display: flex;
  align-items: center;
  overflow-x: auto;
  gap: 8px;
  z-index: 999;
}

.categorias .nav-logo {
  height: 28px;
  width: 0;
  opacity: 0;
  object-fit: contain;
  transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.categorias.is-scrolled .nav-logo {
  width: 28px;
  opacity: 1;
  margin-right: 8px;
}

.categorias a {
  color: white;
  text-decoration: none;
  font-size: 13px; /* Letra un poco más pequeña y fina */
  padding: 6px 12px; /* Botones más compactos */
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  transition: 0.3s;
}

.categorias a:hover {
  background: #fbbf24;
  color: black;
}

/* ===== CONTAINER ===== */
.menu-container {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  backdrop-filter: blur(8px);
}

/* ===== TITULOS ===== */
h1 {
  text-align: center;
  margin-bottom: 20px;
  color: white !important;
}

h2 {
  margin-top: 40px;
  color: #fbbf24;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  
  padding-bottom: 20px;
  padding-top: 15px;
  font-size: 24px !important;
  
  position: sticky;
  top: var(--nav-height, 42px); /* Pegado justo debajo calculado dinámicamente */
  
  /* Por defecto: transparente y sin efecto */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 100;
  
  /* Transición suave cuando cambia el fondo */
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Solo se aplica cuando está pegado arriba gracias al JS */
h2.is-stuck {
  background: rgba(0, 0, 0, 0.4); 
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); /* Soporte extra para Safari/iOS */
  border-bottom: 2px solid #fbbf24;
}

/* ===== ITEMS ===== */
.item {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.25s;
}

/* Solo aplicar hover/zoom en ordenadores (ratón) */
@media (hover: hover) {
  .item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
  }
}

/* Forzar cursor pointer para iOS en elementos clicables */
.item[data-image] {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(251, 191, 36, 0.2);
}

/* ===== TOP ITEMS ===== */
.item.top {
  border-left: 4px solid #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

/* ===== INFO ===== */
.info {
  max-width: 75%;
}

.name {
  font-weight: 600;
  font-size: 16px !important;
}

.desc {
  font-size: 13px !important;
  opacity: 0.7;
}

/* ===== PRICE ===== */
.price {
  color: #fbbf24;
  font-weight: bold;
}

/* ===== SCROLL ===== */
html {
  scroll-behavior: smooth;
}

.seccion {
  /* Margen extra alto para que al darle a la nav quede perfecto bajo ambas barras */
  scroll-margin-top: 130px;
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  .info {
    max-width: 75%;
  }

  .price {
    margin-left: 10px;
  }
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 40px 20px 20px 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer a {
  color: #fbbf24;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: 0.3s;
}

.footer a:hover {
  color: white;
}

/* ===== AVISO ENVASES ===== */
.aviso-envases {
  text-align: center;
  font-size: 13px;
  color: #fff;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 10px 15px;
  border-radius: 8px;
  margin: 0 auto 10px auto;
  max-width: 90%;
  line-height: 1.4;
  font-weight: 300;
}

/* ===== LANGUAGE SWITCHER ===== */
.language-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto 20px auto;
  max-width: 90%;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-weight: 600;
}

.lang-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  color: #fff;
}

.lang-btn.active {
  background: #fbbf24;
  color: #000;
  border-color: #fbbf24;
}

/* Ocultar elementos de Google Translate */
.goog-te-banner-frame.skiptranslate, 
.goog-te-gadget-icon,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}

body {
  top: 0px !important;
}

.goog-text-highlight {
  background: transparent !important;
  box-shadow: none !important;
}

/* ===== MODAL DE PRODUCTOS ===== */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 10001; /* Por encima de todo */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 85%;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.close-modal {
  position: fixed;
  top: 20px;
  right: 20px;
  color: #fbbf24;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  z-index: 10002;
  padding: 10px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.close-modal:hover {
  color: white;
  transform: scale(1.1);
}

/* Ajustes para móviles */
@media (max-width: 600px) {
  .modal-content {
    max-width: 95%;
  }
  
  .close-modal {
    top: 15px;
    right: 15px;
    font-size: 50px; /* Más grande en móvil para facilitar el toque */
  }
}

/* ===== CARGADOR (SPINNER) ===== */
.loader-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 10001;
}

.loader {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #fbbf24;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-container::after {
  content: "Cargando foto...";
  color: white;
  font-size: 14px;
  font-weight: 300;
}

.loading .loader-container {
  display: flex;
}

.loading .modal-content {
  opacity: 0;
}