/* ========== BANNER DE TRADUCCIÓN GASTRONÓMICO ========== */

:root {
    --accent-rgb: 44, 90, 160;
}

/* ========== BANNER DE TRADUCCIÓN MEJORADO - CON ANIMACIONES MODERNAS ========== */
/* Posicionado más abajo del header, con animación desde la izquierda */
.translation-banner {
    position: fixed !important;
    top: 140px !important; /* Más abajo del header para mejor visibilidad */
    left: 20px !important; /* Posición desde la izquierda */
    right: auto !important;
    width: auto !important;
    max-width: 140px !important;
    z-index: 9997 !important; /* Por debajo del header y menú hamburguesa */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%) !important;
    border: 2px solid rgba(44, 90, 160, 0.25) !important;
    box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    border-radius: 25px !important;
    overflow: hidden !important;
    display: block !important;
    visibility: visible !important;
    opacity: 0 !important;
    transform: translateX(-120%) !important; /* Inicialmente fuera de la pantalla por la izquierda */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Animación combinada: entrada + destellos */
@keyframes slideInWithFlash {
    0% {
        transform: translateX(-120%) scale(1);
        opacity: 0;
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: rgba(44, 90, 160, 0.25);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%);
    }
    /* Entrada completa */
    30% {
        transform: translateX(0) scale(1);
        opacity: 1;
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: rgba(44, 90, 160, 0.25);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%);
    }
    /* Primer destello - inicio */
    40% {
        transform: translateX(0) scale(1);
        opacity: 1;
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: rgba(44, 90, 160, 0.25);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%);
    }
    /* Primer destello - pico */
    45% {
        transform: translateX(0) scale(1.1);
        opacity: 1;
        box-shadow: 0 20px 50px rgba(44, 90, 160, 0.6), 0 15px 35px rgba(212, 175, 55, 0.5), 0 0 40px rgba(212, 175, 55, 0.4) !important;
        border-color: rgba(212, 175, 55, 1) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 248, 220, 1) 100%) !important;
    }
    /* Primer destello - fin */
    50% {
        transform: translateX(0) scale(1);
        opacity: 1;
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: rgba(44, 90, 160, 0.25);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%);
    }
    /* Segundo destello - inicio */
    60% {
        transform: translateX(0) scale(1);
        opacity: 1;
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: rgba(44, 90, 160, 0.25);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%);
    }
    /* Segundo destello - pico */
    65% {
        transform: translateX(0) scale(1.1);
        opacity: 1;
        box-shadow: 0 20px 50px rgba(44, 90, 160, 0.6), 0 15px 35px rgba(212, 175, 55, 0.5), 0 0 40px rgba(212, 175, 55, 0.4) !important;
        border-color: rgba(212, 175, 55, 1) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 248, 220, 1) 100%) !important;
    }
    /* Segundo destello - fin y estado final */
    70%, 100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: rgba(44, 90, 160, 0.25);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%);
    }
}

/* Aplicar animación combinada cuando el banner está visible */
.translation-banner:not(.hidden):not(.closing) {
    animation: slideInWithFlash 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards !important;
    animation-fill-mode: forwards !important;
}

/* Asegurar visibilidad después de las animaciones */
.translation-banner.visible {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Animación de entrada desde la izquierda */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-120%) !important;
        opacity: 0 !important;
    }
    100% {
        transform: translateX(0) !important;
        opacity: 1 !important;
    }
}

/* Efecto de destello para llamar la atención (2 veces) - Mejorado */
@keyframes flashAttention {
    0% {
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        transform: translateX(0) scale(1) !important;
        border-color: rgba(44, 90, 160, 0.25) !important;
    }
    25% {
        box-shadow: 0 16px 40px rgba(44, 90, 160, 0.5), 0 12px 28px rgba(212, 175, 55, 0.4), 0 0 30px rgba(212, 175, 55, 0.3) !important;
        transform: translateX(0) scale(1.08) !important;
        border-color: rgba(212, 175, 55, 0.8) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 248, 220, 0.98) 100%) !important;
    }
    50% {
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        transform: translateX(0) scale(1) !important;
        border-color: rgba(44, 90, 160, 0.25) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%) !important;
    }
    75% {
        box-shadow: 0 16px 40px rgba(44, 90, 160, 0.5), 0 12px 28px rgba(212, 175, 55, 0.4), 0 0 30px rgba(212, 175, 55, 0.3) !important;
        transform: translateX(0) scale(1.08) !important;
        border-color: rgba(212, 175, 55, 0.8) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 248, 220, 0.98) 100%) !important;
    }
    100% {
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        transform: translateX(0) scale(1) !important;
        border-color: rgba(44, 90, 160, 0.25) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 242, 255, 0.95) 100%) !important;
    }
}

/* Efecto hover mejorado */
.translation-banner:hover {
    transform: translateX(0) scale(1.02) !important;
    box-shadow: 0 12px 32px rgba(44, 90, 160, 0.3), 0 6px 16px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(44, 90, 160, 0.4) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(237, 242, 255, 0.98) 100%) !important;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animación de pulso sutil para mantener atención */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    50% {
        box-shadow: 0 10px 28px rgba(44, 90, 160, 0.25), 0 5px 14px rgba(0, 0, 0, 0.18) !important;
    }
}

/* Aplicar pulso sutil después de las animaciones iniciales */
.translation-banner.visible {
    animation: slideInWithFlash 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards,
               subtlePulse 3s ease-in-out 2.8s infinite !important;
}

.translation-banner.hidden {
    display: none;
}

.translation-banner-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

.translation-banner-text {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #2d1a1a;
    font-size: 1rem;
    font-weight: 500;
}

.translation-banner-icon {
    font-size: 1.5rem;
    color: var(--restaurant-primary);
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}

.translation-banner-message {
    color: #2d1a1a;
    font-size: 1rem;
    line-height: 1.4;
}

.translation-banner-message strong {
    color: var(--restaurant-primary);
    font-weight: 600;
}

.translation-banner-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.translation-language-selector {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(237, 242, 255, 0.8) 100%) !important;
    border: 1px solid rgba(44, 90, 160, 0.2) !important;
    border-radius: 20px !important;
    padding: 8px 12px !important;
    color: #1e3d73 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(8px) !important;
    min-width: auto !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    width: 100% !important;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1) !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.translation-language-selector:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(237, 242, 255, 0.95) 100%) !important;
    border-color: rgba(44, 90, 160, 0.4) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 16px rgba(44, 90, 160, 0.25), 0 3px 8px rgba(0, 0, 0, 0.15) !important;
}

.translation-language-selector:focus {
    outline: none !important;
    border-color: rgba(212, 175, 55, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2), 0 6px 16px rgba(44, 90, 160, 0.25) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.translation-language-selector option {
    background: #FFFFFF;
    color: #2d1a1a;
    padding: 8px;
}

.translation-banner-button {
    background: linear-gradient(135deg, #3278bf 0%, #2e68a3 35%, #3461a7 50%, #4a7bb8 70%, #b8d0e5 90%, #d6e1ed 100%);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 120, 191, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 170px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.translation-banner-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.translation-banner-button:hover::before {
    left: 100%;
}

.translation-banner-button:hover {
    background: linear-gradient(135deg, #3a84c9 0%, #3272b3 35%, #366db1 50%, #4e83c2 70%, #c0d8ed 90%, #dee9f5 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(50, 120, 191, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.translation-banner-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(50, 120, 191, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
}

.translation-banner-close {
    display: none !important; /* Ocultar botón de cerrar - no necesario en botón flotante */
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.translation-banner-close:hover {
    background: var(--restaurant-primary-dark);
    border-color: var(--restaurant-primary);
    color: var(--restaurant-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

/* Animaciones */
@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.translation-banner.closing {
    animation: slideUp 0.2s ease-in forwards;
}

/* Ajustar contenido cuando el banner está visible */
body.translation-banner-visible {
    padding-top: 60px;
}

body.translation-banner-visible header {
    margin-top: 60px;
}

/* Indicador de traducción */
.translation-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #FFFFFF 0%, #EEF3FF 100%);
    border: 2px solid var(--restaurant-primary);
    border-radius: 15px;
    padding: 12px 18px;
    color: #2d1a1a;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.translation-indicator.show {
    opacity: 1;
    transform: translateX(0);
}

.translation-indicator span:first-child {
    color: var(--restaurant-primary);
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}

.translation-indicator .close {
    background: rgba(196, 30, 58, 0.8);
    color: #2d1a1a;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: bold;
    margin-left: 10px;
}

.translation-indicator .close:hover {
    background: #722f37;
    color: var(--restaurant-primary);
    transform: scale(1.1);
}

/* Estilos para el widget de Google Translate */
.goog-te-banner-frame {
    display: none !important;
}

.goog-te-gadget {
    display: none !important;
}

.goog-te-combo {
    background: #FFFFFF;
    color: #2d1a1a;
    border: 2px solid var(--restaurant-primary);
    border-radius: 25px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
}

.goog-te-combo:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: #f4e4bc;
}

.goog-te-gadget-simple {
    background: transparent !important;
    border: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .translation-banner-content {
        flex-direction: row;
        gap: 12px;
        justify-content: space-between;
    }
    
    .translation-banner-text {
        display: none;
    }
    
    .translation-banner-controls {
        flex: 1;
        justify-content: center;
        gap: 6px;
        padding: 6px 12px;
        flex-wrap: nowrap;
    }
    
    .translation-banner-controls > * {
        flex: 0 0 auto;
    }
    
    .translation-banner-controls .translation-language-selector,
    .translation-banner-controls .translation-banner-button,
    .translation-banner-controls .translation-banner-close {
        width: auto;
        min-width: unset;
    }
    
    .translation-language-selector {
        min-width: 0;
        font-size: 0.85rem;
        padding: 8px 16px;
    }
    
    .translation-banner-button {
        font-size: 0.85rem;
        padding: 8px 14px;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    
    .translation-banner-button span:first-child {
        display: inline;
    }
    
    .translation-banner-close {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
    }
    
    .translation-indicator {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    body.translation-banner-visible {
        padding-top: 0px !important;
        margin-top: 0px !important;
    }
    
    body.translation-banner-visible header {
        margin-top: 0px !important;
        padding-top: 0px !important;
    }
    
    .translation-banner {
        top: 120px !important; /* Más abajo en tablets */
        left: 15px !important; /* Posición desde la izquierda */
        max-width: 110px !important;
        animation: slideInWithFlash 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards !important;
    }
    
    .translation-language-selector {
        font-size: 11px !important;
        padding: 6px 10px !important;
        max-width: 110px !important;
    }
}

@media (max-width: 480px) {
    .translation-banner-content {
        gap: 8px;
    }
    
    .translation-banner-controls {
        gap: 8px;
        padding: 4px 0;
    }
    
    .translation-language-selector {
        min-width: 110px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .translation-banner-button {
        font-size: 0.75rem;
        padding: 6px 14px;
        min-width: 120px;
    }
    
    .translation-banner-close {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
    
    body.translation-banner-visible {
        padding-top: 0px !important;
        margin-top: 0px !important;
    }
    
    body.translation-banner-visible header {
        margin-top: 0px !important;
        padding-top: 0px !important;
    }
    
    .translation-banner {
        top: 110px !important; /* Más abajo en móviles */
        left: 10px !important; /* Posición desde la izquierda */
        max-width: 100px !important;
        animation: slideInWithFlash 2.3s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards !important;
    }
    
    .translation-language-selector {
        font-size: 10px !important;
        padding: 6px 10px !important;
        max-width: 100px !important;
    }
}
