/* ===== VARIABLES Y CONFIGURACIÓN GLOBAL ===== */
:root {
    --primary-color: #015e31;
    --secondary-color: #0038a8;
    --accent-color: #ffcc00;
     --success-color: #02743c;
    --danger-color: #cb0000;
    --warning-gradient: linear-gradient(45deg, #f45a10, #ffb518);
    --text-light: #fdf6f3;
    --text-dark: #333;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 4px;
}
/* ===== ENCABEZADO PRINCIPAL ===== */
.main-header {
    color: white;
    padding: 1px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-header h1 {
    font-size: 50px;
    margin-bottom: 1px;
    color: var(--text-light);
}

.main-header span {
    color: var(--text-light);
    text-shadow: 0px 0px 40px rgba(0, 0, 0, 0);
}

.main-header p {
    color: var(--primary-color);
}

.header-content {
    display: flex;
    align-items: right;
    max-width: 300px;
    width: 100%;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-right: 2px;
}

.logo-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.07) rotate(-5deg);
}

.logo-text {
    text-align: center;
}

.logo-text h1 {
    font-size: 15px;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ===== BARRA DE NAVEGACIÓN ===== */
.navbar {
    background: var(--warning-gradient);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    flex-wrap: wrap;
     z-index: 1000;
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.nav-menu li {
    margin-right: 10px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: var(--border-radius);
}

.nav-menu a:hover {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Icono de galleta personalizado */
.cookie-icon {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.cookie-icon::before {
    content: "🍪";
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.nav-menu a:hover .cookie-icon::before {
    transform: rotate(15deg) scale(1.2);
}

.nav-icons {
    display: flex;
    align-items: center;
    padding-right: 25px;
}
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 20px;
}
.cart-icon a {
    position: relative;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 5px;
}
.user-icon, .cart-icon {
    color: white;
    font-size: 1.5rem;
    margin-left: 20px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.cart-icon a, .user-icon a {
    color: white;
}
.nav-icons .cart-icon {
    position: relative;
}
.nav-icons .cart-icon a {
    position: relative;
}
.user-icon a:hover, .cart-icon a:hover {
    color: var(--primary-color);
}

.user-name {
    text-decoration: none;
    text-transform: capitalize;
}

.user-icon a {
    text-decoration: none;
}

.menu-text {
    display: inline;
}

/* ===== MENÚS DESPLEGABLES UNIFICADOS ===== */
.dropdown {
    position: relative;
    transition: all 0.3s ease;
}

.dropdown-content, .user-dropdown, .language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    background-color: white;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    z-index: 10001;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-content {
    left: 0;
    min-width: 250px;
}

.user-dropdown {
    min-width: 180px;
    padding: 10px;
}
.user-dropdown a{
    font-size: 18px;
}
.language-dropdown {
    right: 0;
    min-width: 60px;
}

.dropdown:hover .dropdown-content,
.dropdown:hover .user-dropdown,
.dropdown:hover .language-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a, .user-dropdown a, .language-dropdown .dropdown-item {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
    border-bottom: 1px solid #807f7f;
}


.language-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    padding: 10px 10px;
}

.dropdown-content a:hover, 
.user-dropdown a:hover, 
.language-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--secondary-color);
}

.dropdown-content a:last-child,
.user-dropdown a:last-child,
.language-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

/* ===== ICONO CARRITO DE COMPRAS ===== */
.cart-count {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    transition: all 0.3s ease;
    line-height: 1;
}
.navbar .cart-count {
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 11px;
}
@keyframes cartAnimation {
    0% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(10deg); }
    50% { transform: scale(1.1) rotate(-10deg); }
    75% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1); }
}

.cart-animate {
    animation: cartAnimation 0.5s ease;
}

/* ===== BARRA DE BÚSQUEDA ===== */
.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 30px;
    z-index: 1002; /* Asegurar que esté por encima del menú */
}

.search-form {
    display: flex;
    width: 100%;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-input:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--accent-color);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: #888;
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #e6b800 100%);
    border: none;
    padding: 12px 25px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    color: #002d80;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-btn:hover {
    background: linear-gradient(135deg, #e6b800 0%, #cc9900 100%);
    transform: translateX(2px) scale(1.05);
}

/* ===== RESULTADOS DE BÚSQUEDA ===== */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 350px;
    overflow-y: auto;
    z-index: 1003;
    display: none;
    border: 1px solid #e0e0e0;
    border-top: none;
    animation: slideDown 0.3s ease;
    margin-top: 2px;
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:first-child:hover {
    border-radius: 0 0 0 15px;
}

.result-icon {
    margin-right: 15px;
    color: var(--secondary-color);
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
    transition: transform 0.2s ease;
}

.search-result-item:hover .result-icon {
    transform: scale(1.1);
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: bold;
    color: #002d80;
    margin-bottom: 4px;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-category {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.result-price {
    font-weight: bold;
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-left: 10px;
    white-space: nowrap;
}

/* Animación de carga */
.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-loading .fa-spinner {
    color: var(--secondary-color);
}

.no-results {
    padding: 25px 20px;
    text-align: center;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.no-results i {
    font-size: 1.5rem;
    color: #ccc;
}

/* Scrollbar personalizado para resultados */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Efecto cuando la búsqueda está activa */
.search-container.active .search-input {
    border-radius: 15px 0 0 0;
}

.search-container.active .search-btn {
    border-radius: 0 15px 0 0;
}
/* ===== SELECTOR DE IDIOMA ===== */
.language-selector {
    position: relative;
    margin: 0 10px;
}

.language-trigger {
    display: flex;
    align-items: center;
    padding: 5px 5px;
    border-radius: var(--border-radius);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.language-flag {
    margin-right: 5px;
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.language-code {
    font-weight: bold;
    margin-right: 5px;
}

.language-selector .fa-chevron-down {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-selector:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* ===== ENLACE PARA PAGAR ===== */
.checkout-link {
    margin-left: 5px;
}

.checkout-btn {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.checkout-btn i {
    margin-right: 2px;
}

/* ===== MENÚ HAMBURGESA PARA MÓVILES ===== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    margin-right: 15px;
    z-index: 10001;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--warning-gradient);
    z-index: 10001;
    flex-direction: column;
    padding: 0;
    margin: 0;
    list-style: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu li {
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-menu a:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--primary-color);
}

.mobile-menu .dropdown-content {
    position: static;
    display: none;
    background: rgba(0,0,0,0.1);
    box-shadow: none;
    border-radius: 0;
    width: 100%;
}

.mobile-menu .dropdown:hover .dropdown-content {
    display: block;
}

.mobile-menu .dropdown-content a {
    padding-left: 40px;
    font-size: 0.9rem;
}

/* ===== AJUSTES PARA TEXTO MÁS PEQUEÑO EN DROPDOWN DE USUARIO ===== */
.user-dropdown .dropdown-item {
    font-size: 14px; /* Tamaño más pequeño */
    padding: 8px 12px; /* Padding reducido */
}

.user-dropdown .dropdown-item i {
    font-size: 13px; /* Iconos más pequeños */
    margin-right: 8px;
}

/* ============================================= */
/* ESTILOS LOCALES PARA NOTIFICACIONES */
/* ============================================= */

.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    animation: slideInRight 0.3s ease;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-left: 4px solid #1e7e34;
}

.cart-notification.error {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    border-left: 4px solid #c82333;
}

.cart-notification.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    border-left: 4px solid #e0a800;
    color: #212529;
}

.cart-notification.info {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
    border-left: 4px solid #138496;
}

.cart-notification .btn-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    margin-left: 10px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-notification .btn-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== MEDIA QUERIES ORGANIZADAS ===== */

/* 📱 Móviles Pequeños (hasta 480px) */
@media (max-width: 480px) {
    .navbar {
        padding: 10px 15px;
        position: relative;
         z-index: 10001;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu {
        display: none;
    }
    
    .logo-text h1 {
        font-size: 1.3rem;
    }
    
    .menu-text {
        display: inline;
    }
    
    .nav-menu a {
        justify-content: flex-start;
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .search-btn {
        padding: 10px 20px;
    }
    
    .search-results {
        max-height: 250px;
    }
    
    .language-trigger .language-code {
        display: inline;
    }
    
    .checkout-btn span {
        display: none;
    }
    
    .checkout-btn {
        padding: 8px;
    }
    
    .nav-icons {
        padding-right: 2px;
    }
    
    .user-icon, .cart-icon {
        margin-left: 10px;
        font-size: 1.2rem;
    }
    
    /* Ajustes específicos para dropdown de usuario en móviles */
    .user-dropdown {
        min-width: 110px;
        
    }
    
    .user-dropdown .dropdown-item {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* 📱 Móviles Grandes / Tablets Pequeñas (481px - 768px) */
@media (max-width: 768px) {
    .navbar {
        padding: 12px;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .menu-toggle {
        display: block;
        order: 1;
    }
    
    .nav-menu {
        display: none;
    }
    
    .main-header {
        order: 2;
        flex: 1;
        justify-content: center;
        padding: 0 10px;
    }
    
    .nav-icons {
        order: 3;
        padding-right: 0;
    }
    
    .search-container {
        max-width: 100%;
        margin: 10px 0 0 0;
        order: 4;
    }
     .search-results {
        border-radius: 0 0 10px 10px;
        max-height: 300px;
    }
    
    .search-result-item {
        padding: 12px 15px;
    }
    
    .result-name {
        font-size: 0.9rem;
    }
    
    .result-category {
        font-size: 0.75rem;
    }
    .header-content {
        max-width: 200px;
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
     .cart-item-detailed {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .cart-item-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-item-controls {
        justify-content: center;
    }
    
    .cart-item-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* 💻 Tablets / Laptops (769px - 1024px) */
@media (max-width: 1024px) {
    .navbar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .search-container {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .nav-menu {
        justify-content: center;
        flex: 1 1 100%;
    }
    
    .main-header h1 {
        font-size: 45px;
    }
}


/* 🖥️ Escritorios Grandes (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .navbar {
        padding: 10px 20px;
    }
    
    .search-container {
        max-width: 400px;
    }
    
    .nav-menu {
        flex-wrap: nowrap;
    }
}

/* 📺 Televisiones / Pantallas Extra Grandes (1441px+) */
@media (min-width: 1441px) {
    .navbar {
        padding: 15px 20px;
        margin: 0;
    }
    
    .search-container {
        max-width: 500px;
    }
    
    .nav-menu a {
        font-size: 20px;
        padding: 12px 15px;
    }
    
    .main-header h1 {
        font-size: 20px;
    }
    
    .logo-image {
        width: 40px;
        height: 40px;
    }
}

/* ===== CLASES ADICIONALES PARA RESPONSIVIDAD ===== */

/* Utilidades de visibilidad */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

.tablet-hidden {
    display: flex;
}

/* Estados responsive */
.nav-collapsed .nav-menu {
    display: none;
}

.nav-expanded .nav-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--warning-gradient);
    z-index: 1000;
}

/* Para menú hamburguesa en móviles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Media queries para utilidades */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .tablet-hidden {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
}
/* ===== ANIMACIONES PARA EL MENÚ HAMBURGESA ===== */
.menu-toggle {
    transition: transform 0.3s ease;
}

.menu-toggle.active {
    transform: rotate(90deg);
}

.mobile-menu {
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
}

/* ===== UTILIDADES ADICIONALES ===== */
.hidden-mobile {
    display: flex;
}

.visible-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }
    
    .visible-mobile {
        display: flex;
    }
}