/* Receta Magistral destacado en menú principal */
.receta-magistral-highlight {
  position: relative;
  z-index: 2;
}
.receta-magistral-link {
  font-weight: bold;
  color: #fbbf24 !important;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.08rem;
  position: relative;
  animation: recetaPulse 1.8s infinite cubic-bezier(0.4,0,0.2,1);
  transition: color 0.2s;
}
.receta-magistral-link:hover, .receta-magistral-link:focus {
  color: #fde047 !important;
}

@keyframes recetaPulse {
  0% {
    text-shadow: 0 0 0 #fbbf24;
    color: #fbbf24;
  }
  50% {
    text-shadow: 0 0 8px #fde047, 0 0 2px #fffbe6;
    color: #fde047;
  }
  100% {
    text-shadow: 0 0 0 #fbbf24;
    color: #fbbf24;
  }
}
/* Modern Navigation Styles for Pharmacy E-commerce */

/* Header styles */
.nav-header {
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 6px 1rem;

}

.nav-main-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

/* Backdrop para efecto blur - MEJORADO */
.nav-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 49;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.nav-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Efecto blur para el contenido principal - MEJORADO */
.main-content,
.nav-modern {
    transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.menu-blur-active .main-content:not(.nav-modern) {
    filter: blur(3px);
    pointer-events: none;
}

/* Mantener navegación sin blur */
body.menu-blur-active .nav-modern {
    filter: none;
    position: relative;
    z-index: 999;
}

/* Mejorar z-index de dropdowns */
.dropdown-container .dropdown-menu,
.categories-dropdown .categories-dropdown-content {
    z-index: 1000;
}

/* Indicador visual cuando el blur está "pensando" */
body.menu-blur-transitioning .nav-menu-backdrop {
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
}

@media (min-width: 768px) {
    .nav-main-row {
        flex-direction: row;
    }
}

/* Logo section */
.nav-logo-section {
    flex: 0 0 auto;
    min-width: 170px;
    display: flex;
    align-items: center;
    margin-bottom: 0;  /* Anula el margin que tenías en mobile */
}
@media (min-width: 768px) {
    .nav-logo-section {
        margin-bottom: 0;
    }
}

.nav-logo-container {
    display: flex;
    align-items: center;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e40af;
}

.nav-logo {
    height: 4.5rem;
    width: auto;
    max-width:100%;
    display: block;
}

/* Search and actions section */
/* Layout for search and actions */
.nav-search-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    min-width: 0;
    width: 100%;
}

@media (min-width: 1024px) {
  .nav-search-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0;
  }
  .nav-search-container {
    flex: 1 1 0;
    max-width: 700px; /* Doble del tamaño actual */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  .nav-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    min-width: 220px;
    margin-left: auto;
  }
  .nav-search-input {
    height: 56px;
    font-size: 1.35rem;
    padding: 0.7rem 3.5rem 0.7rem 1.5rem;
    max-width: 700px;
  }
}

/* Search bar */
.nav-search-container {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

@media (min-width: 768px) {
    .nav-search-container {
        width: auto;
    }
}

.nav-search-input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    text-align: center;
    font-size: 1.07rem;
    box-sizing: border-box;
    height: 40px;
}


.nav-search-icon {
    height: 1.25rem;
    width: 1.25rem;
    color: #9ca3af;
}

/* Action icons */
.nav-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 180px;
}

@media (min-width: 768px) {
    .nav-actions {
        gap: 1rem;
    }
}

.nav-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.9rem;
    color: #1e40af;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.nav-action-item:hover {
    color: #2563eb;
    text-decoration: none;
}

.nav-action-icon {
    height: 1.5rem;
    width: 1.5rem;
}

.nav-action-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Cart badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.7rem;
    background-color: #fbbf24;
    color: #1e40af;
    font-weight: 700;
    border-radius: 9999px;
    height: 1rem;
    width: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dropdown styles */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.01rem;
    background-color: #ffffff;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    z-index: 50;
}

.dropdown-container:hover .dropdown-menu {
    display: block;
}

.dropdown-content {
    display: none;
    position: absolute;
    min-width: 200px;
    z-index: 50;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* User dropdown */
.user-dropdown-menu,
.user-dropdown-menu-wide {
    /* Posicionamiento centrado debajo del trigger */
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.user-dropdown-menu {
    width: 12rem;
    padding: 0.25rem 0;
}

.user-dropdown-menu-wide {
    width: 20rem;
    padding: 1rem;
}

/* Ajustes para pantallas medianas (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    .user-dropdown-menu-wide {
        width: 18rem;
    }
    
    .dropdown-menu.cart-dropdown {
        width: 18rem;
        max-width: calc(100vw - 40px);
    }
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    text-decoration: none;
}

.dropdown-item-danger {
    color: #dc2626;
}

.dropdown-divider {
    border-top: 1px solid #e5e7eb;
}

/* Form styles in dropdown */
.dropdown-form {
    padding: 0.75rem 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

.btn-primary {
    width: auto;
    height: auto;
    background-color: #2563eb;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Cart dropdown - Posicionado desde la derecha hacia la izquierda */
.dropdown-menu.cart-dropdown {
    width: 20rem;
    z-index: 50;
    overflow-x: hidden;
    /* Posicionar desde la esquina superior derecha */
    left: auto !important;
    right: 0 !important;
    transform: none !important;
}

/* Cart dropdown */
.cart-dropdown {
    width: 20rem;
    z-index: 50;
    overflow-x: hidden;
}

.cart-dropdown-content {
    padding: 1rem;
    overflow-x: hidden;
}

.cart-items-container {
    max-height: 16rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.cart-item-image {
    flex-shrink: 0;
}

.cart-item-img {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 0.25rem;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-price {
    font-size: 0.875rem;
    color: #6b7280;
}

.cart-item-remove {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-item-remove:hover {
    color: #dc2626;
}

.cart-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-secondary {
    flex: 1;
    background-color: #6b7280;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-cart-view {
    flex: 1;
    background-color: #2563eb;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-cart-view:hover {
    background-color: #1d4ed8;
    text-decoration: none;
    color: #ffffff;
}

/* Categories navbar */
.nav-categories {
    background-color: #1e40af;
    color: #ffffff;
}

.nav-categories-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

/* Categories dropdown */
.categories-dropdown {
    position: relative;
}

.categories-button {
    padding: 0.75rem 1.5rem;
    background-color: #f3e02e;
    color: #1e40af;
    font-weight: 700;
    display: flex;
    align-items: center;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.categories-button:hover {
    background-color: #f59e0b;
    text-decoration: none;
    color: #1e40af;
}

.categories-icon {
    height: 1.25rem;
    width: 1.25rem;
    margin-right: 0.5rem;
}

.categories-dropdown-content {
    background-color: #ffffff;
    color: #1e40af;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 16rem;
}

.category-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #1e40af;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.category-item:hover {
    background-color: #dbeafe;
    text-decoration: none;
    color: #1e40af;
}

.category-item-highlight {
    font-weight: 600;
}

.category-icon {
    height: 1.25rem;
    width: 1.25rem;
    margin-right: 0.5rem;
    color: #1e40af;
}

/* Navigation menu */
.nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
}

@media (max-width: 767px) {
    .nav-menu {
        display: none;
    }
}

.nav-menu-list {
    display: flex;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
}

.nav-menu-item {
    margin: 0;
}

.nav-menu-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.nav-menu-link:hover {
    background-color: #1d4ed8;
    text-decoration: none;
    color: #ffffff;
}

/* Special offers */
.nav-special-offers {
    display: none;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-special-offers {
        display: flex;
    }
}

.special-offers-link {
    display: flex;
    align-items: center;
    color: #fbbf24;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.special-offers-link:hover {
    color: #fde047;
    text-decoration: none;
}

.special-offers-icon {
    height: 1.25rem;
    width: 1.25rem;
    margin-right: 0.25rem;
}

/* Responsive utilities */
.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
}

.flex-mobile {
    display: flex;
}

@media (min-width: 768px) {
    .hidden-mobile.flex-mobile {
        display: flex;
    }
}

/* Spacing utilities */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-x-2 > * + * {
    margin-left: 0.5rem;
}

.space-x-3 > * + * {
    margin-left: 0.75rem;
}

/* Text utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Border utilities */
.border-t {
    border-top: 1px solid #e5e7eb;
}

.border-b {
    border-bottom: 1px solid #e5e7eb;
}

/* Margin and padding utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }
.pt-4 { padding-top: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

/* Z-index utilities */
.z-50 { z-index: 50; }

@media (max-width: 1023px) {
    .nav-main-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .nav-logo-section {
        justify-content: center;
        margin-bottom: 0.25rem;
    }
    .nav-search-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
        min-width: 0;
    }
    .nav-search-container {
        width: 100%;
        max-width: none;
        justify-content: center;
        min-width: 0;
    }
    .nav-search-form {
        width: 100%;
        max-width: 100vw;
        margin: 0 auto;
    }
    .nav-actions {
        justify-content: center;
        width: 100%;
        min-width: 0;
        gap: 1.2rem;
    }
}

.nav-search-form {
    position: relative;
    width: 100%;
    max-width: 1200px; /* Dóblalo si quieres aún más largo, ejemplo: 800px */
    margin: 0 auto;
}
.nav-search-input {
    width: 100%;
    padding: 0.7rem 3rem 0.7rem 1.3rem; /* Más padding a la derecha para que la lupa nunca tape el texto */
    border-radius: 9999px;
    border: 1.5px solid #cbd5e1;
    font-size: 1.25rem;
    color: #4b5563;
    background: #fff;
    outline: none;
    transition: border 0.2s;
    box-sizing: border-box;
    height: 48px; /* Un poco más alto */
    text-align: center;
}

.nav-search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
    z-index: 2;
    padding: 0;
}

/* Body del dropdown con scroll */
.categories-dropdown-body {
    max-height: 400px;
    overflow-y: auto;
    /* Ocultar scrollbar en WebKit browsers (Chrome, Safari, Edge) */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox */
}

/* Items de categorías */
.category-hover-group {
    position: relative;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #1e40af;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.category-item:hover {
    background-color: #dbeafe;
    text-decoration: none;
    color: #1e40af;
}

/* MEGAMENU - Aparece COMPLETAMENTE FUERA del dropdown */
.category-hover-group .megamenu {
    display: none;
    position: fixed;
    top: var(--megamenu-top, 128px);
    left: var(--megamenu-left, 300px) !important;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    padding: 24px;
    border-radius: 8px;
    border-left: 3px solid #1e40af;
    box-sizing: border-box;
    width: 600px; /* Por defecto, se sobrescribe con JS */
    height: 400px; /* Por defecto, se sobrescribe con JS */
    margin-left: -4px;
    overflow-y: auto;
    
    /* Animaciones */
    opacity: 0;
    transform: translateX(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Mostrar megamenu en hover con animación */
.category-hover-group:hover .megamenu {
    display: block;
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

/* Estructura de columnas del megamenu */
.megamenu-columns {
    display: flex;
    gap: 32px;
    width: 100%;
    height: 100%;
}

.megamenu-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    word-break: break-word;
}

/* Subcategorías principales */
.megamenu-subcat {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.megamenu-subcat:last-child {
    border-bottom: none;
}

/* Títulos de subcategorías - Azul igual al navbar */
.subcat-title {
    margin-bottom: 6px;
}

.subcat-title a {
    color: #1e40af;           /* Mismo azul del navbar */
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;;
}

.subcat-title a:hover {
    color: #2563eb;           /* Hover más claro */
    text-decoration: none;
    background-color: #dbeafe; /* Mismo hover del category-item */
    padding-left: 8px;
    transform: translateX(4px);
}

/* Lista de tipos de administración */
.subcat-tipos {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 12px;
}

.subcat-tipos li {
    margin-bottom: 3px;
}

/* Tipos de administración - Azul muy oscuro */
.subcat-tipos a {
    color: #1f2937;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    display: block;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap; /* Evita saltos de línea */
    overflow: hidden;
    text-overflow: ellipsis; /* ... si el texto es muy largo */
}

.subcat-tipos a:hover {
    color: #1e40af;           /* Cambia al azul del navbar en hover */
    background-color: #f3f4f6;
    text-decoration: none;
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Animación de entrada escalonada para los elementos */
.category-hover-group:hover .megamenu-col:nth-child(1) {
    animation: slideInLeft 0.4s ease-out;
}

.category-hover-group:hover .megamenu-col:nth-child(2) {
    animation: slideInLeft 0.4s ease-out 0.1s both;
}

.category-hover-group:hover .megamenu-col:nth-child(3) {
    animation: slideInLeft 0.4s ease-out 0.2s both;
}

.category-hover-group:hover .megamenu-col:nth-child(4) {
    animation: slideInLeft 0.4s ease-out 0.3s both;
}

/* Keyframes para animaciones */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll personalizado para el megamenu */
.megamenu::-webkit-scrollbar {
    width: 6px;
}

.megamenu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.megamenu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.megamenu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utilidades adicionales para el cart dropdown */
.text-center {
    text-align: center;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ===== ANIMACIONES DEL CARRITO ===== */

/* Elementos animados del carrito */
.cart-animation-element {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Animación de agregar al carrito */
.cart-add-animation {
    background: #00ff44;
    color: white;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: scale(1);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animación de remover del carrito */
.cart-remove-animation {
    transform: scale(1);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animación de limpiar carrito */
.cart-clear-animation {
    transform: scale(1);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== ALERTAS Y MODALES ===== */

/* Estilos para la alerta de límite máximo */
.max-limit-alert {
    border-radius: 16px !important;
    overflow: hidden !important;
}

.max-limit-alert .swal2-html-container {
    padding: 0 !important;
    margin: 0 !important;
}

.max-limit-alert .swal2-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #d97706 !important;
}

.max-limit-alert .swal2-actions {
    margin-top: 25px !important;
    gap: 15px !important;
}

.pulse-button {
    animation: pulse-orange 2s infinite !important;
}

/* Animación de pulso naranja */
@keyframes pulse-orange {
    0% { 
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7);
        transform: scale(1);
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
        transform: scale(1);
    }
}

/* Estilos para el modal de stock */
.stock-error-modal {
    border-radius: 12px !important;
}

.stock-error-modal .swal2-html-container {
    padding: 0 !important;
    margin: 0 !important;
}

.stock-error-modal .swal2-actions {
    margin-top: 20px !important;
}

.stock-error-modal .swal2-confirm,
.stock-error-modal .swal2-cancel {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
}

/* Animación de advertencia para productos con stock bajo */
@keyframes pulse-warning {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.low-stock-warning {
    animation: pulse-warning 2s infinite;
}

/* Badge de stock bajo */
.stock-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
}

.stock-badge.critical {
    background: #dc2626;
    animation: pulse-warning 1.5s infinite;
}

/* Efectos adicionales para la alerta de límite */
.max-limit-alert .swal2-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #d97706, #f59e0b);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* Animación shimmer */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== ANIMACIONES DE ENTRADA ===== */

/* Animación de entrada bounce */
@keyframes animate__bounceIn {
    from, 20%, 40%, 60%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(.9, .9, .9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(.97, .97, .97);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.animate__animated {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

.animate__bounceIn {
    animation-name: animate__bounceIn;
}

/* ===== UTILIDADES GENERALES ===== */

/* Control de overflow horizontal */
body {
    overflow-x: hidden !important;
}

/* Clase auxiliar para elementos voladores */
.flying-animation {
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

/* Clase para ocultar elementos temporalmente */
.temporarily-hidden {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Clase para mostrar elementos */
.show-element {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Pantallas pequeñas y tablets */
@media (max-width: 992px) {
    /* Base para dropdowns en mobile/tablet - JavaScript controlará el posicionamiento */
    .nav-actions .dropdown-container .dropdown-menu,
    .dropdown-container .dropdown-menu,
    .dropdown-menu,
    .cart-dropdown,
    .user-dropdown-menu,
    .user-dropdown-menu-wide {
        position: absolute !important;
        top: 100% !important;
        margin-top: 2px !important; /* Reducido para evitar que desaparezca */
        border-radius: 8px !important;
        z-index: 9999 !important;
        /* SOBRESCRIBIR el CSS base para user dropdowns */
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }
    
    /* Forzar posicionamiento específico para dropdown de usuario */
    .user-dropdown-menu,
    .user-dropdown-menu-wide {
        left: 0px !important;
        right: auto !important;
        transform: none !important;
    }
    
    /* Forzar posicionamiento específico para dropdown de carrito */
    .cart-dropdown,
    .dropdown-menu.cart-dropdown {
        left: auto !important;
        right: 0px !important;
        transform: none !important;
    }
    
    /* Crear un "puente invisible" para evitar que el dropdown desaparezca */
    .dropdown-container::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 5px; /* Área invisible que mantiene el hover activo */
        z-index: 9998;
        background: transparent;
    }
    
    .cart-dropdown-content {
        max-height: 60vh !important;
        overflow-y: auto !important;
    }
    
    /* Ajustes adicionales para elementos específicos */
    .cart-animation-element {
        transform: scale(0.8) !important;
    }
    
    .max-limit-alert {
        width: 90% !important;
        max-width: 400px !important;
    }
    
    .stock-error-modal {
        width: 90% !important;
        max-width: 450px !important;
    }
}

/* Solo para móviles muy pequeños */
@media (max-width: 480px) {
    .cart-animation-element {
        transform: scale(0.6) !important;
    }
    
    .pulse-button {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}

/* Reducir animaciones para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    .cart-animation-element,
    .animate__animated,
    .pulse-button,
    .low-stock-warning {
        animation: none !important;
        transition: none !important;
    }
    
    .cart-add-animation,
    .cart-remove-animation,
    .cart-clear-animation {
        transition: opacity 0.3s ease !important;
    }
}

/* BOTONES DE NAVEGACIÓN DEL CARRUSEL */
.carousel-container {
    position: relative;
    margin: 2rem 0;
    min-height: 400px; /* Altura mínima para asegurar posicionamiento correcto */
}

.owl-carousel {
    position: relative;
    z-index: 1;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid #007bff;
    background: rgba(255, 255, 255, 0);
    color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.25);
    transition: all 0.3s ease;
    z-index: 999;
}

.carousel-nav-btn:hover {
    background: #007bff57;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,123,255,0.4);
    border-color: #007bff;
}

.carousel-nav-btn:active {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

.carousel-nav-btn--left {
    left: -25px;
}

.carousel-nav-btn--right {
    right: -25px;
}

/* Ajuste dinámico basado en el contenido */
.owl-carousel .owl-stage-outer {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .carousel-nav-btn--left {
        left: -15px;
    }
    
    .carousel-nav-btn--right {
        right: -15px;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        min-height: 350px;
    }
    
    .carousel-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .carousel-nav-btn--left {
        left: -10px;
    }
    
    .carousel-nav-btn--right {
        right: -10px;
    }
}

@media (max-width: 576px) {
    .carousel-container {
        min-height: 320px;
    }
    
    .carousel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .carousel-nav-btn--left {
        left: -5px;
    }
    
    .carousel-nav-btn--right {
        right: -5px;
    }
}

/* Transición suave para el botón Google */
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    border-color: #6fb3d3 !important;
}
.btn-google .google-text {
    max-width: 0;
    opacity: 0;
    transition: max-width 0.5s ease, opacity 0.3s ease 0.1s;
    white-space: nowrap;
    overflow: hidden;
}
.btn-google:hover {
    background-color: #e3f2fd !important;
    border-color: #6fb3d3 !important;
    color: #1976d2 !important;
}
.btn-google:hover .google-text {
    max-width: 200px;
    opacity: 1;
}


/* Scroll para el menú de categorías */
.categories-dropdown-body {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6fb3d3 #f1f1f1;
    padding-left: 4px;
    direction: rtl; /* Para mover scrollbar a la izquierda */
}

.categories-dropdown-body > * {
    direction: ltr; /* Restaurar dirección normal para el contenido */
}

.categories-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.categories-dropdown-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.categories-dropdown-body::-webkit-scrollbar-thumb {
    background: #6fb3d3;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.categories-dropdown-body::-webkit-scrollbar-thumb:hover {
    background: #304f9e;
}

/* ========================================
   SLIDE MENU STYLES
   ======================================== */

/* Menu Slide Button in Categories Bar */
.menu-slide-button {
    display: none; /* Oculto por defecto en desktop */
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #1757ce 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(133, 79, 255, 0.3);
    margin-left: 1rem;
}

.menu-slide-button:hover {
    background: linear-gradient(135deg, #1757cece 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(133, 79, 255, 0.4);
}

.menu-slide-button:active {
    transform: translateY(0);
}

.menu-slide-icon {
    width: 20px;
    height: 20px;
}

/* Slide Menu Overlay */
.slide-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99998; /* Por encima de todo el contenido */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Oculto en desktop por defecto */
    pointer-events: none;
}

.slide-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Slide Menu */
.slide-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #ffffff;
    z-index: 99999; /* Por encima del overlay */
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: none; /* Oculto en desktop por defecto */
    flex-direction: column;
    overflow: hidden;
}

.slide-menu.active {
    right: 0;
}

/* Slide Menu Header */
.slide-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #304f9e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.slide-menu-logo img {
    height: 36px;
    width: auto;
}

.slide-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.slide-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.slide-menu-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* Slide Menu Content */
.slide-menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.slide-menu-content::-webkit-scrollbar {
    width: 6px;
}

.slide-menu-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.slide-menu-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.slide-menu-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Slide Menu User Section */
.slide-menu-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.slide-menu-user-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #854fff 0%, #6a29ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.slide-menu-user-avatar svg {
    width: 28px;
    height: 28px;
}

.slide-menu-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.slide-menu-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.slide-menu-user-link {
    font-size: 0.9rem;
    color: #854fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.slide-menu-user-link:hover {
    color: #6a29ff;
    text-decoration: underline;
}

/* Slide Menu Auth Section */
.slide-menu-auth {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slide-menu-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.slide-menu-auth-primary {
    background: linear-gradient(135deg, #854fff 0%, #6a29ff 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(133, 79, 255, 0.3);
}

.slide-menu-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(133, 79, 255, 0.4);
}

.slide-menu-auth-secondary {
    background: white;
    color: #854fff;
    border: 2px solid #854fff;
}

.slide-menu-auth-secondary:hover {
    background: #f9fafb;
    border-color: #6a29ff;
    color: #6a29ff;
}

.slide-menu-auth-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Slide Menu Navigation */
.slide-menu-nav {
    padding: 1rem 0;
}

.slide-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #1f2937;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.slide-menu-link:hover {
    background: linear-gradient(90deg, rgba(133, 79, 255, 0.08) 0%, transparent 100%);
    color: #854fff;
    padding-left: 1.75rem;
}

.slide-menu-link:active {
    background: linear-gradient(90deg, rgba(133, 79, 255, 0.12) 0%, transparent 100%);
}

.slide-menu-link-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke-width: 2.5;
}

.slide-menu-link span:first-of-type {
    flex: 1;
}

/* Slide Menu Link Highlight (Receta Magistral) */
.slide-menu-link-highlight {
    background: linear-gradient(90deg, #fef3c7 0%, transparent 100%);
    color: #d97706;
    font-weight: 600;
}

.slide-menu-link-highlight:hover {
    background: linear-gradient(90deg, #fde68a 0%, transparent 100%);
    color: #b45309;
}

.slide-menu-badge {
    padding: 0.25rem 0.625rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slide-menu-cart-badge {
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

/* Slide Menu Logout */
.slide-menu-logout {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.slide-menu-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.slide-menu-logout-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.slide-menu-logout-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    /* Mostrar botón de menú solo en móvil/tablet */
    .menu-slide-button {
        display: flex;
    }

    /* Mostrar slide menu y overlay en móvil/tablet */
    .slide-menu-overlay {
        display: block;
    }

    .slide-menu {
        display: flex;
    }

    /* Asegurar que el header quede por debajo del overlay SOLO cuando el menú está activo */
    body.slide-menu-active .site__header,
    body.slide-menu-active .site-header,
    body.slide-menu-active .nav-header,
    body.slide-menu-active .nav-categories {
        position: relative;
        z-index: 100 !important;
    }

    /* Asegurar que el contenido principal también quede por debajo cuando el menú está activo */
    body.slide-menu-active .site__body {
        position: relative;
        z-index: 50;
    }
}

@media (max-width: 768px) {
    .slide-menu {
        max-width: 85%;
    }

    .menu-slide-button span {
        display: none;
    }

    .menu-slide-button {
        padding: 0.625rem;
        margin-left: 0.5rem;
    }
}

/* ========================================
   TABLET RESPONSIVE (768px - 1023px)
   Modo similar a móvil: solo categorías + menú
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Ocultar los textos de los action items, solo mostrar iconos */
    .nav-action-text {
        display: none !important;
    }
    
    /* Reducir padding de action items sin texto */
    .nav-action-item {
        padding: 0.5rem;
    }
    
    /* Ajustar tamaño de iconos */
    .nav-action-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    /* Reducir gap entre action items */
    .nav-actions {
        gap: 0.25rem;
        min-width: auto;
    }
    
    /* OCULTAR el menú de navegación horizontal (Inicio, Rastrea, etc.) */
    .nav-menu {
        display: none !important;
    }
    
    /* MOSTRAR el botón de menú hamburguesa */
    .menu-slide-button {
        display: flex !important;
        margin-left: auto;
    }
    
    /* Mantener texto del botón de categorías */
    .categories-button {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Ajustar layout de la barra de categorías */
    .nav-categories-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* El botón de categorías a la izquierda */
    .categories-dropdown {
        order: 1;
    }
    
    /* El botón de menú a la derecha */
    .menu-slide-button {
        order: 2;
        margin-left: auto;
    }
    
    /* Ajustes para la búsqueda */
    .nav-search-container {
        max-width: 400px;
    }
    
    .nav-search-input {
        font-size: 0.95rem;
        height: 38px;
    }
    
    /* Logo más pequeño */
    .nav-logo {
        height: 3.5rem;
    }
    
    .nav-logo-section {
        min-width: 130px;
    }
    
    /* Reducir gaps generales */
    .nav-main-row {
        gap: 0.75rem;
    }
    
    .nav-search-actions {
        gap: 0.5rem;
    }
    
    /* Container padding */
    .nav-container {
        padding: 6px 0.75rem;
    }
}

@media (max-width: 480px) {
    .slide-menu {
        max-width: 90%;
    }

    .slide-menu-header {
        padding: 1rem 1.25rem;
    }

    .slide-menu-logo img {
        height: 32px;
    }

    .slide-menu-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .slide-menu-link-icon {
        width: 22px;
        height: 22px;
    }
}

/* Smooth scrolling */
@supports (scroll-behavior: smooth) {
    .slide-menu-content {
        scroll-behavior: smooth;
    }
}