/* Reset básico para evitar espacios no deseados */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ===== Estilos generales del header ===== */
header {
  background-color: #4A7C59;
  border-bottom: 2px solid #6B9E7F;
  padding: 10px 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  position: relative;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

/* Agrupa logo + título */
.left-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
}
.logo img {
  height: 50px;
}

.title-text {
  color: white;
  font-size: 28px;
  font-weight: 700;
  white-space: nowrap;
}

/* Menú desktop */
.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-menu ul li.active a {
  color: #F4C75E;
  font-weight: 700;
}

.nav-menu a {
  text-decoration: none;
  color: #FDF9F5;
  font-weight: 500;
  font-size: 1.05em;
  transition: color 0.3s, opacity 0.2s;
  padding: 6px 0;
}
.nav-menu a:hover {
  color: white;
  opacity: 0.9;
}

.nav-menu i {
  margin-right: 6px;
  font-size: 0.9em;
}

/* Popup carrito */
#carrito-popup {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 14px;
  z-index: 1000;
  display: none;
}

#carrito-popup.visible {
  display: block;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.popup-item {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 12px;
}
.popup-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e8ece9;
}

.popup-item .estado {
  display: inline-block;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.estado.no-disponible {
  background: #ffebee;
  color: #c62828;
}
.estado.ajustado {
  background: #fff8e1;
  color: #ef6c00;
}

.popup-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-footer .total {
  font-weight: 600;
  color: #23A6A6;
  font-size: 16px;
}

.popup-btn {
  background: #23A6A6;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9em;
  text-decoration: none;
}

.popup-empty {
  padding: 14px;
  text-align: center;
  color: #777;
  font-style: italic;
}

/* ===== HAMBURGUESA ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Animación al abrir */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Overlay móvil */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
}

/* Menú móvil */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -320px;
  width: 280px;
  height: 100%;
  background: #4A7C59;
  border-left: 2px solid #6B9E7F;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav a {
  color: #FDF9F5;
  text-decoration: none;
  font-size: 1.2em;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.25s, color 0.25s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav a:hover,
.mobile-nav li.active a {
  background: rgba(255, 255, 255, 0.15);
  color: #F4C75E;
}

.mobile-nav i {
  font-size: 1.1em;
  min-width: 24px;
  text-align: center;
}

.mobile-nav #link-carrito {
  font-weight: 600;
  background: rgba(35, 166, 166, 0.2);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 992px) {
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Oculta el logo en móviles */
  .logo {
    display: none;
  }

  .left-section {
    gap: 12px;
  }

  .title-text {
    font-size: 22px;
  }
}

@media (max-width: 576px) {
  .header-container {
    padding: 8px 16px;
  }

  .title-text {
    font-size: 20px;
  }
}