/**
 * Estilos para o Sistema de Pedido por Voz - OTIMIZADO MOBILE
 * @author Roka Digital - https://rokadigital.com.br/contato/
 */

/* ========================================
   BOTÕES HERO - AMBOS ARREDONDADOS (PÍLULA)
======================================== */

/* Ambos os botões com mesmo estilo - DESKTOP */
.hero-buttons .btn-whatsapp,
.hero-buttons .btn-voice,
.hero-buttons .btn,
#btn-whatsapp-hero,
#btn-pedido-voz,
a.btn-whatsapp,
button.btn-voice {
    padding: 14px 32px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    min-width: 240px !important;
    max-width: 240px !important;
    width: 240px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    height: 52px !important;
    line-height: 1.2 !important;
}

/* Mobile - ambos iguais com MAIS DESTAQUE */
@media (max-width: 768px) {
    .hero-buttons .btn-whatsapp,
    .hero-buttons .btn-voice,
    .hero-buttons .btn,
    #btn-whatsapp-hero,
    #btn-pedido-voz,
    a.btn-whatsapp,
    button.btn-voice {
        width: 100% !important;
        max-width: 220px !important;
        padding: 12px 20px !important;
        font-size: 1rem !important;
        border-radius: 50px !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px !important;
        line-height: 1.3 !important;
        height: auto !important;
        min-height: 48px !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }
}

/* Botão Pedido por Voz */
.btn-voice,
#btn-pedido-voz {
    background: #002D72 !important;
    background-color: #002D72 !important;
    color: #FFFFFF !important;
    border-color: #002D72 !important;
    box-shadow: 0 4px 15px rgba(0, 45, 114, 0.3) !important;
}

.btn-voice:hover,
#btn-pedido-voz:hover {
    background: #001f50 !important;
    background-color: #001f50 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0, 45, 114, 0.4) !important;
}

/* Botão WhatsApp - VERDE WHATSAPP */
.btn-whatsapp,
.hero-buttons .btn-whatsapp,
#btn-whatsapp-hero,
a.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    background-color: #25D366 !important;
    background-image: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    color: #FFFFFF !important;
    border-color: #25D366 !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
    font-size: 1.05rem !important;
}

.btn-whatsapp:hover,
.hero-buttons .btn-whatsapp:hover,
#btn-whatsapp-hero:hover,
a.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%) !important;
    background-color: #128C7E !important;
    background-image: linear-gradient(135deg, #128C7E 0%, #25D366 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
}

/* Ícones dos botões */
.btn-voice i,
.btn-whatsapp i,
#btn-pedido-voz i,
#btn-whatsapp-hero i {
    font-size: 1.2rem !important;
}

/* ========================================
   MODAL - MOBILE FIRST (PRIORIDADE ABSOLUTA)
======================================== */

.modal-pedido-voz {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* iOS otimizações */
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

.modal-content-voz {
    background: #FFFFFF;
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0.8rem 1rem 1rem 1rem;
    margin: 0;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    padding-bottom: 120px;
    /* iOS otimizações */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Botão Fechar Mobile (estilo nativo) */
.btn-fechar-modal-mobile {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F1F1F1;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.btn-fechar-modal-mobile i {
    font-size: 1.2rem;
    color: #666;
}

.btn-fechar-modal-mobile:active {
    background: #E1E1E1;
    transform: scale(0.95);
}

.modal-header-voz {
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

#modal-icone {
    font-size: 1.8rem;
    color: #FF8931;
    margin-bottom: 0.2rem;
}

#modal-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* ========================================
   TRANSCRIÇÃO
======================================== */

.transcricao-container {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#transcricao-texto {
    color: #666;
    font-size: 1rem;
    text-align: center;
}

/* ========================================
   RESULTADO
======================================== */

.resultado-container {
    display: none;
    width: 100%;
}

.resultado-secao {
    background: #F8F9FA;
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0 0 0.4rem 0;
    width: 100%;
    box-sizing: border-box;
}

.resultado-secao h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.form-group-voz {
    margin-bottom: 0.5rem;
    width: 100%;
}

.form-group-voz label {
    display: block;
    color: #555;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group-voz input,
.form-group-voz textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #E1E8ED;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
    font-family: inherit;
    /* iOS: permitir seleção */
    -webkit-user-select: text;
    user-select: text;
    -webkit-tap-highlight-color: rgba(255, 137, 49, 0.2);
}

.form-group-voz textarea {
    resize: vertical;
    min-height: 45px;
}

.form-group-voz input:focus,
.form-group-voz textarea:focus {
    outline: none;
    border-color: #FF8931;
}

.produto-item {
    background: #FFFFFF;
    padding: 0.8rem;
    border-radius: 8px;
    margin: 0 0 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #E1E8ED;
    width: 100%;
    box-sizing: border-box;
}

.produto-nome {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.produto-qtd {
    background: #FF8931;
    color: #FFFFFF;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.texto-vazio {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

#aviso-dados-incompletos {
    display: none !important;
}

#mensagem-erro {
    background: #F8D7DA;
    border: 1px solid #F5C6CB;
    color: #721C24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    text-align: center;
    font-size: 0.9rem;
}

/* ========================================
   BOTÕES - ESTILO HERO (UM EMBAIXO DO OUTRO)
======================================== */

.modal-botoes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.8rem;
    width: 100%;
    flex-shrink: 0;
    padding-bottom: 0.5rem;
}

.btn-modal {
    width: 100%;
    padding: 11px 20px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-modal i {
    font-size: 1.2rem;
}

.btn-modal:active {
    transform: translateY(-2px);
}

/* Botão Iniciar Gravação */
.btn-gravar {
    background: #243834;
    color: #FFFFFF;
}

.btn-gravar:hover {
    background: #FF8931;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 137, 49, 0.4);
}

/* Botão Cancelar */
.btn-cancelar {
    background: #6C757D;
    color: #FFFFFF;
}

.btn-cancelar:hover {
    background: #5A6268;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Botão Parar Gravação */
.btn-parar {
    background: #DC3545;
    color: #FFFFFF;
    display: none;
}

.btn-parar:hover {
    background: #C82333;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Botão Enviar WhatsApp */
.btn-enviar {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #FFFFFF;
    display: none;
}

.btn-enviar:hover {
    background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-enviar i {
    font-size: 1.3rem;
}

/* ========================================
   ESTADOS DO MODAL
======================================== */

/* Estado: Inicial */
.modal-pedido-voz .btn-gravar {
    display: flex;
}

/* Estado: Gravando */
.modal-pedido-voz.gravando .btn-gravar {
    display: none;
}

.modal-pedido-voz.gravando .btn-parar {
    display: flex;
}

.modal-pedido-voz.gravando .transcricao-container {
    display: flex;
}

/* Estado: Processando */
.modal-pedido-voz.processando .btn-parar,
.modal-pedido-voz.processando .btn-gravar {
    display: none;
}

.modal-pedido-voz.processando .transcricao-container {
    display: none;
}

/* Estado: Resultado */
.modal-pedido-voz.resultado .btn-parar,
.modal-pedido-voz.resultado .btn-gravar,
.modal-pedido-voz.resultado .btn-cancelar {
    display: none;
}

.modal-pedido-voz.resultado .btn-enviar {
    display: flex;
}

.modal-pedido-voz.resultado .transcricao-container {
    display: none;
}

.modal-pedido-voz.resultado .resultado-container {
    display: flex;
    flex-direction: column;
}

.modal-pedido-voz.resultado .modal-botoes {
    margin-top: auto;
    padding-top: 1rem;
}

/* Ícone pulsante durante gravação */
.gravando #modal-icone {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ========================================
   DESKTOP - ADAPTAÇÃO SECUNDÁRIA
======================================== */

@media (min-width: 769px) {
    .modal-pedido-voz {
        align-items: center;
        justify-content: center;
    }
    
    .modal-content-voz {
        width: 600px;
        max-width: 600px;
        min-height: auto;
        max-height: 85vh;
        border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        padding: 2.5rem;
    }
    
    .btn-fechar-modal-mobile {
        display: none;
    }
    
    #modal-icone {
        font-size: 3.5rem;
    }
    
    #modal-titulo {
        font-size: 1.6rem;
    }
    
    .btn-modal {
        padding: 16px 32px;
        font-size: 1.1rem;
    }
    
    .btn-modal i {
        font-size: 1.3rem;
    }
}

/* ========================================
   ANIMAÇÕES
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   SCROLLBAR CUSTOMIZADA
======================================== */

.modal-content-voz::-webkit-scrollbar {
    width: 6px;
}

.modal-content-voz::-webkit-scrollbar-track {
    background: #F1F1F1;
    border-radius: 10px;
}

.modal-content-voz::-webkit-scrollbar-thumb {
    background: #FF8931;
    border-radius: 10px;
}

.modal-content-voz::-webkit-scrollbar-thumb:hover {
    background: #F0B355;
}
