/**
 * Estilos para Tutorial/Overlay Mobile
 * Sistema de onboarding que destaca elementos da busca
 */

/* ===== OVERLAY PRINCIPAL ===== */
.mfn-tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
    -webkit-overflow-scrolling: none;
}

/* ===== BLOQUEIO DE SCROLL ===== */
body.mfn-tutorial-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* ===== BACKDROP ESCURO ===== */
.mfn-tutorial-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    animation: tutorialFadeIn 0.3s ease-out;
    z-index: 999997;
    pointer-events: none;
}

/* ===== SPOTLIGHT (DESTAQUE) ===== */
.mfn-tutorial-spotlight {
    position: absolute;
    background: transparent;
    border-radius: 8px;
    box-shadow: 
        0 0 0 4px rgba(255, 255, 255, 0.1),
        0 0 0 8px rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: tutorialPulse 2s infinite ease-in-out;
    z-index: 999998;
    pointer-events: none;
}

/* ===== ELEMENTO DESTACADO ===== */
.mfn-tutorial-highlighted {
    position: relative !important;
    z-index: 1000002 !important;
}

/* ===== MOBILE MENU TOGGLE ESPECÍFICO ===== */
.mobile-menu-toggle.mfn-tutorial-highlighted {
    position: relative !important;
    z-index: 1000001 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ===== CONTAINER LI DO MENU TOGGLE (APENAS ELE) ===== */
.menu-item-menu:has(.mobile-menu-toggle.mfn-tutorial-highlighted) {
    position: relative !important;
    z-index: 1000001 !important;
}

/* ===== FALLBACK PARA NAVEGADORES SEM :has() ===== */
.menu-item-menu .mobile-menu-toggle.mfn-tutorial-highlighted {
    position: relative !important;
    z-index: 1000001 !important;
}



/* ===== EVITA QUALQUER DESTAQUE NO STICKY MENU ===== */
.mfn-footer-stickymenu.mfn-tutorial-highlighted,
.mfn-footer-stickymenu-custom.mfn-tutorial-highlighted {
    /* Remove qualquer highlight se aplicado por engano */
    z-index: initial !important;
}

/* ===== STICKY MENU MANTÉM COMPORTAMENTO NORMAL ===== */
.mfn-footer-stickymenu,
.mfn-footer-stickymenu-custom {
    /* Não força z-index - mantém comportamento normal */
}

/* ===== BUSCA DE PRODUTOS DESTACADA ===== */
.mfn-product-search-input.mfn-tutorial-highlighted,
[data-widget="product-search"] input.mfn-tutorial-highlighted {
    position: relative !important;
    z-index: 1000002 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* ===== FORÇA ELEMENTOS POR CIMA DO OVERLAY ===== */
.mfn-tutorial-overlay.active ~ * .mfn-tutorial-highlighted {
    z-index: 1000002 !important;
    position: relative !important;
}

/* ===== CONTAINER DO ELEMENTO DESTACADO ===== */
.mfn-tutorial-highlighted,
.mfn-tutorial-highlighted * {
    pointer-events: auto !important;
}

/* ===== FORÇA VISIBILIDADE DO SPOTLIGHT ===== */
.mfn-tutorial-overlay.active .mfn-tutorial-spotlight {
    z-index: 999998 !important;
    pointer-events: none !important;
}

/* ===== TOOLTIP ===== */
.mfn-tutorial-tooltip {
    position: absolute;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: tutorialSlideIn 0.4s ease-out 0.2s backwards;
    max-width: 90vw;
    min-width: 280px;
    z-index: 1000002;
}

.tooltip-content {
    padding: 20px;
}

.tooltip-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.tooltip-message {
    font-size: 14px;
    color: #4a5568;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* ===== AÇÕES DO TOOLTIP ===== */
.tooltip-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.tooltip-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.btn-skip {
    background: transparent;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.btn-skip:hover {
    background: #f7fafc;
    color: #2d3748;
}

.btn-prev {
    background: #edf2f7;
    color: #2d3748;
}

.btn-prev:hover {
    background: #e2e8f0;
}

.btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-next:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}

/* ===== SETA DO TOOLTIP ===== */
.tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tooltip-arrow.bottom {
    top: -6px;
    left: 50%;
    margin-left: -6px;
}

.tooltip-arrow.top {
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
}

.tooltip-arrow.left {
    right: -6px;
    top: 50%;
    margin-top: -6px;
}

.tooltip-arrow.right {
    left: -6px;
    top: 50%;
    margin-top: -6px;
}

/* ===== ANIMAÇÕES ===== */
@keyframes tutorialFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tutorialPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .mfn-tutorial-tooltip {
        min-width: 260px;
        max-width: 85vw;
    }
    
    .tooltip-content {
        padding: 16px;
    }
    
    .tooltip-title {
        font-size: 16px;
    }
    
    .tooltip-message {
        font-size: 13px;
    }
    
    .tooltip-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .tooltip-actions button {
        width: 100%;
        padding: 12px;
    }
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
    .mfn-tutorial-spotlight {
        animation: none;
    }
    
    .mfn-tutorial-tooltip {
        animation: none;
    }
    
    .mfn-tutorial-backdrop {
        animation: none;
    }
}

/* ===== BOTÃO PARA REINICIAR TUTORIAL ===== */
.mfn-tutorial-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.mfn-tutorial-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.mfn-tutorial-trigger:active {
    transform: translateY(0);
}

/* Oculta em desktop */
@media (min-width: 769px) {
    .mfn-tutorial-overlay,
    .mfn-tutorial-trigger {
        display: none !important;
    }
}

/* ===== INTEGRAÇÃO COM ELEMENTOS EXISTENTES ===== */
.mfn-tutorial-overlay.active ~ * {
    pointer-events: none;
}

.mfn-tutorial-overlay.active ~ .mfn-tutorial-spotlight {
    pointer-events: auto;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .mfn-tutorial-tooltip {
        background: #2d3748;
        border: 1px solid #4a5568;
    }
    
    .tooltip-title {
        color: #f7fafc;
    }
    
    .tooltip-message {
        color: #cbd5e0;
    }
    
    .btn-skip {
        background: transparent;
        color: #a0aec0;
        border-color: #4a5568;
    }
    
    .btn-skip:hover {
        background: #4a5568;
        color: #f7fafc;
    }
    
    .btn-prev {
        background: #4a5568;
        color: #f7fafc;
    }
    
    .btn-prev:hover {
        background: #718096;
    }
    
    .tooltip-arrow {
        background: #2d3748;
    }
}