/* ============================================
   HEADER PRINCIPAL
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  border-bottom-right-radius: 20px;
  border-bottom-left-radius: 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 14px 40px;
  min-height: 72px;

  /* Glass effect optimizado */
  background: linear-gradient(
    145deg,
    rgba(54, 79, 107, 0.93),
    rgba(166, 109, 212, 0.93)
  );
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);

  border-bottom: 1px solid rgba(255, 255, 255, 0.2);

  /* Sombra moderna y elegante */
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.18),
    0 1px 4px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);

  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevenir scroll cuando el menú está abierto */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ============================================
   LOGO
   ============================================ */
.logo {
  flex-shrink: 0;
}

.logo img {
  height: 50px;
  width: auto;
}

/* ============================================
   MENÚ HAMBURGUESA
   ============================================ */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #ffffff;
  z-index: 1002;
  position: relative;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 26px;
  height: 20px;
}

.hamburger-icon span {
  display: block;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animación hamburguesa activa */
.menu-toggle.is-open .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.is-open .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.is-open .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   NAVEGACIÓN PRINCIPAL (DESKTOP)
   ============================================ */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.nav-header-mobile {
  display: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: rgb(255, 255, 255);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Línea inferior animada (solo desktop) */
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-link i {
  display: none;
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Hover effect */

/* Elementos móviles ocultos en desktop */
.nav-search-mobile,
.nav-user-mobile,
.nav-login-mobile {
  display: none;
}

/* ============================================
   BÚSQUEDA COLAPSABLE (DESKTOP)
   ============================================ */
.search-container {
  position: relative;
  width: 50px;
  height: 50px;
  background: transparent;
  border-radius: 25px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Estado expandido del search */
.search-container.expanded {
  width: 340px;
  max-width: 340px;
  background: white;
  border: 1px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
  cursor: default;
}

.search-container input {
  width: 0;
  padding: 0;
  border: none;
  outline: none;
  border-radius: 25px;
  font-size: 14px;
  color: #333;
  background: transparent;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Input expandido */
.search-container.expanded input {
  width: 100%;
  padding: 12px 50px 12px 20px;
  opacity: 1;
  background: white;
}

.search-container input::placeholder {
  color: #999;
  font-size: 14px;
}

/* Botón/Icono de búsqueda */
.search-container button {
  position: absolute;
  right: 50%;
  top: 50%;
  transform: translate(50%, -50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ffffff;
  font-size: 20px;
  padding: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Botón cuando está expandido */
.search-container.expanded button {
  right: 8px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.search-container.expanded button:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  transform: translateY(-50%) scale(1.08) rotate(8deg);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.search-container:not(.expanded) button i {
  transition: transform 0.3s ease;
}

.search-container:not(.expanded):hover button i {
  transform: scale(1.15);
}

.search-desktop {
  display: flex;
}

/* ============================================
   ACCIONES DEL HEADER
   ============================================ */
.header-actions {
  display: flex;
  align-items: center;
  position: relative;
}

.action-btn {
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.action-btn i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.action-btn:hover i {
  transform: scale(1.2);
}

/* ============================================
   MENÚ DE USUARIO (DESKTOP)
   ============================================ */
.user-profile-menu {
  position: relative;
}

.user-role {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #667eea;
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #ffa06b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.user-avatar.large {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
}

.avatar-initials {
  font-size: 0.875rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.9rem;
}

.user-profile-link {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  display: none;
  z-index: 1001;
}

.user-profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: block;
}

.dropdown-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dropdown-menu {
  list-style: none;
  padding: 0.5rem;
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #333;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item i {
  width: 20px;
  color: #666;
}

.dropdown-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0.5rem 0;
  list-style: none;
}

.logout-item {
  color: #e74c3c;
}

/* ============================================
   CARRITO
   ============================================ */
.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc3545;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: none;
  background: #ffffff;
  border-radius: 12px 12px 0 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-details h3 {
  padding: 10px;
  font-size: 19px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Poppins", sans-serif;
}

.user-details .user-profile-link {
  color: #6b7280;
  font-size: 13px;
  margin-top: 4px;
  display: inline-block;
}

.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 400px;
  overflow-y: auto;
  display: block;
  width: 100%;
}

.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
}

.dropdown-item i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #667eea;
  font-size: 18px;
  flex-shrink: 0;
}

.dropdown-item:hover {
  background: #f3f4f6;
  color: #667eea;
}

.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.logout-item {
  color: #dc2626;
  margin-top: 4px;
}

.logout-item i {
  color: #dc2626;
}

.logout-item:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================
   CARRITO DROPDOWN
   ============================================ */
.cart-dropdown {
  position: fixed;
  top: calc(100% + 0.5rem);
  right: 0;
  max-width: 300px;
  max-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  display: none;
  flex-direction: column;
  z-index: 99999 !important;
}

.cart-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: flex;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.cart-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.close-cart {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
  transition: color 0.3s ease;
}

.close-cart:hover {
  color: #333;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-height: 350px;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}

.cart-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
  display: block;
}

.cart-empty p {
  margin: 0;
  font-size: 0.95rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}

.cart-item:hover {
  background: #f0f0f0;
}

.item-image {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-image i {
  font-size: 1.5rem;
  color: #ccc;
}

.item-details {
  flex: 1;
  min-width: 0;
}

.item-details h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-price {
  color: #667eea;
  font-weight: 600;
  margin: 0.25rem 0;
  font-size: 0.85rem;
}

.item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  background: white;
  border: 1px solid #ddd;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.qty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.item-quantity span {
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.item-subtotal {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.remove-item {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.remove-item:hover {
  color: #c0392b;
}

.cart-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #f0f0f0;
}

.cart-total {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: right;
  color: #333;
}

.checkout-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
}

.checkout-btn:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ============================================
   OVERLAY
   ============================================ */
.nav-overlay {
  display: none;
  position: fixed;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   MENSAJES
   ============================================ */
.messages-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10 !important;
  max-width: 420px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.msg {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
}

.msg::before {
  content: "";
  font-size: 20px;
  flex-shrink: 0;
}

.msg::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: 0.3;
  animation: progressBar 5s linear forwards;
}

.msg.success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.msg.success::before {
  content: "✓";
  background: #10b981;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.msg.error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.msg.error::before {
  content: "✕";
  background: #ef4444;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.msg.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.msg.warning::before {
  content: "⚠";
  background: #f59e0b;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.msg.info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.msg.info::before {
  content: "ℹ";
  background: #3b82f6;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes progressBar {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}

/* ============================================
   RESPONSIVE - PANTALLAS EXTRA GRANDES
   ============================================ */
@media (min-width: 1441px) {
  .header {
    padding: 14px 60px;
    max-width: 1920px;
    margin: 0 auto;
  }

  .search-container.expanded {
    max-width: 400px;
  }

  .user-profile-dropdown {
    min-width: 320px;
  }
}

/* ============================================
   RESPONSIVE - LAPTOPS GRANDES (1200px - 1440px)
   ============================================ */
@media (max-width: 1440px) {
  .header {
    padding: 14px 40px;
  }
}

/* ============================================
   RESPONSIVE - TABLETS HORIZONTALES (992px - 1200px)
   ============================================ */
@media (max-width: 1200px) {
  .header {
    padding: 12px 30px;
  }

  .nav-link {
    font-size: 14px;
    padding: 8px 16px;
  }

  .search-container.expanded {
    max-width: 300px;
  }
}

/* ============================================
   RESPONSIVE - TABLETS (768px - 992px)
   ============================================ */
@media (max-width: 992px) {
  .header {
    padding: 1rem 1.5rem;
    min-height: 65px;
  }

  .logo img {
    height: 45px;
  }

  .nav-link {
    font-size: 13px;
    padding: 8px 14px;
  }

  .search-desktop {
    max-width: 250px;
    min-width: 0;
  }

  .search-container.expanded {
    max-width: 250px;
  }

  /* Ocultar texto del usuario en tablets */
  .user-info {
    display: none;
  }

  .user-profile-btn {
    padding: 0.35rem;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
  }

  /* Ajustar acciones del header */
  .action-btn {
    font-size: 1.15rem;
    padding: 5px 12px;
  }

  .cart-count {
    font-size: 10px;
    min-width: 16px;
    padding: 1px 5px;
  }

  /* Dropdown usuario ajustado */
  .user-profile-dropdown {
    min-width: 260px;
    right: -10px;
  }

  .dropdown-header {
    padding: 1.2rem;
  }

  /* Carrito ajustado */
  .cart-dropdown {
    max-width: 280px;
    right: -10px;
  }
}

/* ============================================
   RESPONSIVE - MÓVILES
   ============================================ */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
    border-bottom-right-radius: 15px;
    border-bottom-left-radius: 15px;
  }

  /* Mostrar hamburguesa */
  .menu-toggle {
    display: block;
    order: -1;
  }

  .menu-toggle.active .hamburger-icon span {
    background: #000000;
  }

  /* Animación hamburguesa activa - para .active */
  .menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Animación hamburguesa activa - para .is-open (compatibilidad JS) */
  .menu-toggle.is-open .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .menu-toggle.is-open .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .menu-toggle.is-open .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Logo centrado */
  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .logo img {
    height: 40px;
  }

  /* Navegación móvil */
  .nav-container {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 85%;
    max-width: 320px;
    background: white;
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    /* Resetear estilos desktop */
    display: block;
    align-items: initial;
    justify-content: initial;
    flex-grow: initial;
  }

  .nav-container.active {
    left: 0;
  }

  /* Header del menú móvil */
  .nav-header-mobile {
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
  }

  .nav-close {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    padding: 0.5rem;
    transition: color 0.3s ease;
  }

  .nav-close:hover {
    color: #ff6b9d;
  }

  /* Links navegación móvil */
  .nav-links {
    flex-direction: column;
    gap: 0;
    padding: 0;
    align-items: stretch;
  }

  .nav-links > li {
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    width: 100%;
    color: #333;
    text-shadow: none;
    border-radius: 0;
    justify-content: flex-start;
    white-space: normal;
  }

  /* Remover efectos hover y línea inferior en móvil */
  .nav-link::after {
    display: none;
  }

  .nav-link:hover {
    background: #f5f5f5;
    transform: none;
  }

  .nav-link.active {
    background: linear-gradient(90deg, #ff6b9d15, transparent);
    color: #ff6b9d;
  }

  .nav-link i {
    display: block;
    font-size: 1.25rem;
    width: 24px;
    color: inherit;
  }

  /* Búsqueda móvil */
  .nav-search-mobile {
    display: block;
  }

  .search-form-mobile {
    padding: 1rem 1.5rem;
  }

  .search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .search-input-wrapper i {
    color: #666;
    font-size: 1rem;
  }

  .search-input-wrapper input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
  }

  /* Usuario móvil */
  .nav-user-mobile,
  .nav-login-mobile {
    display: block;
  }

  .user-info-mobile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(135deg, #ff6b9d15, #ffa06b15);
  }

  .user-avatar-mobile {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d, #ffa06b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .user-details-mobile {
    flex: 1;
    min-width: 0;
  }

  .user-name-mobile {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-menu-mobile {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .user-menu-mobile li {
    border-bottom: 1px solid #f0f0f0;
  }

  .logout-link {
    color: #e74c3c !important;
  }

  .login-link {
    color: #ff6b9d !important;
    font-weight: 600;
  }

  /* Ocultar elementos desktop */
  .search-desktop,
  .user-profile-menu,
  .login-btn {
    display: none !important;
  }

  /* Acciones móviles */
  .header-actions {
    gap: 0.5rem;
  }

  .action-btn {
    font-size: 1.1rem;
    padding: 0.35rem;
  }

  /* Dropdown carrito móvil */
  .cart-dropdown {
    width: calc(100vw - 2rem);
    max-width: 350px;
    right: 1rem;
  }

  .user-profile-dropdown {
    width: calc(100vw - 2rem);
    max-width: 300px;
  }
}

/* ============================================
   RESPONSIVE - MÓVILES MEDIANOS (481px - 640px)
   ============================================ */
@media (max-width: 640px) {
  .header {
    padding: 0.65rem 0.85rem;
    min-height: 62px;
  }

  .logo img {
    height: 38px;
  }

  .nav-container {
    width: 88%;
    max-width: 310px;
  }

  .action-btn {
    font-size: 1.05rem;
    padding: 0.3rem;
  }

  .cart-dropdown {
    width: calc(100vw - 1.5rem);
    max-width: 340px;
    right: 0.75rem;
  }

  .user-profile-dropdown {
    width: calc(100vw - 1.5rem);
    max-width: 290px;
  }
}

/* ============================================
   RESPONSIVE - MÓVILES PEQUEÑOS (320px - 480px)
   ============================================ */
@media (max-width: 480px) {
  .header {
    padding: 0.5rem 0.75rem;
    min-height: 58px;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;
  }

  .logo img {
    height: 35px;
  }

  .menu-toggle {
    padding: 0.3rem;
  }

  .hamburger-icon {
    width: 24px;
    height: 18px;
  }

  .hamburger-icon span {
    height: 2.5px;
  }

  .nav-container {
    width: 90%;
    max-width: 290px;
  }

  .nav-header-mobile {
    padding: 0.85rem;
  }

  .nav-link {
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
  }

  .nav-link i {
    font-size: 1.15rem;
    width: 22px;
  }

  .search-input-wrapper {
    padding: 0.65rem 0.9rem;
  }

  .user-info-mobile {
    padding: 1.2rem 1.2rem 0.85rem;
  }

  .user-avatar-mobile {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  .user-name-mobile {
    font-size: 0.95rem;
  }

  .action-btn {
    font-size: 1rem;
    padding: 0.25rem;
  }

  .action-btn i {
    font-size: 16px;
  }

  .cart-count {
    font-size: 9px;
    min-width: 15px;
    padding: 1px 4px;
  }

  .cart-dropdown {
    width: calc(100vw - 1rem);
    max-width: 320px;
    right: 0.5rem;
    max-height: 450px;
  }

  .cart-header h3 {
    font-size: 1rem;
  }

  .cart-items {
    max-height: 300px;
  }

  .item-image {
    width: 55px;
    height: 55px;
  }

  .item-details h4 {
    font-size: 0.85rem;
  }

  .item-price {
    font-size: 0.8rem;
  }

  .user-profile-dropdown {
    width: calc(100vw - 1rem);
    max-width: 280px;
    min-width: unset;
  }

  .dropdown-header {
    padding: 1rem;
  }

  .user-details h3 {
    font-size: 16px;
    padding: 8px;
  }

  .dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
  }

  .messages-container {
    top: 65px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .msg {
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* ============================================
   RESPONSIVE - MÓVILES EXTRA PEQUEÑOS (< 320px)
   ============================================ */
@media (max-width: 320px) {
  .header {
    padding: 0.4rem 0.5rem;
    min-height: 55px;
  }

  .logo img {
    height: 32px;
  }

  .hamburger-icon {
    width: 22px;
    height: 16px;
  }

  .nav-container {
    width: 95%;
    max-width: 280px;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .action-btn {
    font-size: 0.95rem;
    padding: 0.2rem;
  }

  .cart-dropdown,
  .user-profile-dropdown {
    width: calc(100vw - 0.5rem);
    right: 0.25rem;
  }

  .messages-container {
    right: 5px;
    max-width: calc(100% - 10px);
  }

  .msg {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ============================================
   LANDSCAPE ORIENTATION - MÓVILES
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    padding: 0.4rem 1rem;
    min-height: 50px;
  }

  .logo img {
    height: 32px;
  }

  .nav-container {
    width: 60%;
    max-width: 400px;
  }

  .nav-link {
    padding: 0.6rem 1rem;
  }

  .user-info-mobile {
    padding: 1rem;
  }

  .cart-dropdown {
    max-height: 380px;
  }

  .cart-items {
    max-height: 250px;
  }
}

.user-profile-dropdown{
    background:white;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 20px 40px rgba(0,0,0,0.12);
    width:260px;
}

/* header usuario */
.dropdown-header{
    background:#f5f5f5;
    padding:20px;
}

/* lista */
.profile-menu{
    list-style:none;
    margin:0;
    padding:0;
}

/* items */
.profile-menu li a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px 20px;
    text-decoration:none;
    color:#333;
    font-size:14px;
    transition:background .2s;
}

.profile-menu li a:hover{
    background:#f3f3f3;
}

/* divider */
.profile-divider{
    border-top:1px solid #eee;
    margin:0;
}

/* logout */
.logout-item{
    color:#dc3545;
}

/* Estilos del menú hamburguesa */
.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: none; /* Oculto en desktop */
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger-icon span {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
}


@media (max-width: 768px) {
    .hamburger-menu {
        display: block; /* Visible en móvil */
    }

    .nav-container {
        position: fixed;
        width: 80%;
        max-width: 300px;
        background: white;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        padding: 3px;
    }

     .nav-header-mobile {
        display: flex;
        justify-content: flex-end;
        padding: 28px;
    }

  }

  

