/**
 * CSS para Botões dos Produtos - Site Ferfa Gás Consigaz
 * Desenvolvedor: Roka Digital - https://rokadigital.com.br/contato/
 * Versão: 3.0 - Corrigida e otimizada
 */

/* Container dos botões de ação */
.produto-acoes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    margin-top: auto;
    background: white;
    position: relative;
    z-index: 10;
}

/* Estilos base para botões de pedido */
.btn-pedido-rapido,
.btn-pedido-detalhado {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

/* Cores específicas dos botões */
.btn-pedido-rapido {
    background: #25D366;
    color: white;
}

.btn-pedido-detalhado {
    background: #002D72;
    color: white;
}

/* Efeitos hover */
.btn-pedido-rapido:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-pedido-detalhado:hover {
    background: #001B4D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 45, 114, 0.3);
}

/* Ícones dos botões */
.btn-pedido-rapido i,
.btn-pedido-detalhado i {
    font-size: 0.8rem;
}

/* Link Ver Detalhes */
.produto-link {
    text-align: center;
    padding: 8px 0;
    margin-top: 8px;
}

.ver-detalhes {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.ver-detalhes:hover {
    color: #002D72;
}

/* Responsividade */
@media (max-width: 768px) {
    .produto-acoes {
        padding: 12px;
        gap: 6px;
    }
    
    .btn-pedido-rapido,
    .btn-pedido-detalhado {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .btn-pedido-rapido i,
    .btn-pedido-detalhado i {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .btn-pedido-rapido,
    .btn-pedido-detalhado {
        min-height: 42px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Garantir que os botões sejam clicáveis */
.produto-card {
    position: relative;
}

.produto-card .produto-acoes {
    pointer-events: auto;
}

.produto-card .produto-acoes button {
    pointer-events: auto;
    cursor: pointer;
}

/* Remover overlays que possam bloquear cliques */
.produto-card::before,
.produto-card::after {
    pointer-events: none;
}
/* Suporte para dispositivos móveis */
.btn-pedido-rapido,
.btn-pedido-detalhado {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* MODAL DE PEDIDO DETALHADO */
#modal-pedido-detalhado {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
}

#modal-pedido-detalhado.active {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

#modal-pedido-detalhado .modal-content {
    background: #ffffff;
    border-radius: 15px;
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    color: #000;
    margin: auto;
    z-index: 100000;
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    #modal-pedido-detalhado {
        padding: 10px;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #modal-pedido-detalhado .modal-content {
        width: calc(100% - 20px);
        max-width: none;
        max-height: 90vh;
        border-radius: 10px;
        margin: auto;
        position: relative;
        top: 50%;
        transform: translateY(-50%);
        overflow-y: auto;
    }
    
    #modal-pedido-detalhado .modal-header {
        padding: 15px 20px;
        border-radius: 10px 10px 0 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    #modal-pedido-detalhado .modal-title {
        font-size: 1.2rem;
    }
    
    #modal-pedido-detalhado .form-detalhado {
        padding: 20px;
        gap: 20px;
        max-height: calc(90vh - 80px);
        overflow-y: auto;
    }
    
    /* Melhorar espaçamento dos campos no mobile */
    #modal-pedido-detalhado .input-group {
        margin-bottom: 20px;
    }
    
    #modal-pedido-detalhado .input-row {
        gap: 15px;
        margin-bottom: 20px;
    }
    
    #modal-pedido-detalhado .input-group input,
    #modal-pedido-detalhado .input-group select,
    #modal-pedido-detalhado .input-group textarea {
        padding: 15px 12px;
        font-size: 16px;
        line-height: 1.4;
        min-height: 50px;
    }
    
    #modal-pedido-detalhado .input-group label {
        font-size: 14px;
        padding: 0 8px;
        top: -8px;
    }
    
    #modal-pedido-detalhado .produtos-section {
        margin: 25px 0;
    }
    
    #modal-pedido-detalhado .produto-selector-simple {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    #modal-pedido-detalhado .produto-select {
        padding: 15px 12px;
        font-size: 16px;
        min-height: 50px;
    }
    
    #modal-pedido-detalhado .btn-add-simple {
        min-width: 50px;
        min-height: 50px;
        padding: 12px;
        font-size: 18px;
    }
    
    #modal-pedido-detalhado .obs-section {
        margin: 25px 0;
    }
    
    #modal-pedido-detalhado .form-footer-simple {
        padding: 20px 0;
        margin-top: 25px;
        gap: 15px;
    }
    
    #modal-pedido-detalhado .btn-enviar-simple {
        padding: 15px 25px;
        font-size: 16px;
        min-height: 55px;
    }
    
    /* Garantir que o modal fique sempre visível */
    #modal-pedido-detalhado.active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 999999 !important;
    }
    
    /* Espaçamento específico para mobile muito pequeno */
    @media (max-width: 480px) {
        #modal-pedido-detalhado .form-detalhado {
            padding: 15px;
        }
        
        #modal-pedido-detalhado .input-group {
            margin-bottom: 18px;
        }
        
        #modal-pedido-detalhado .input-row {
            flex-direction: column;
            gap: 0;
        }
        
        #modal-pedido-detalhado .input-row .input-group {
            width: 100%;
        }
    }
}

#modal-pedido-detalhado .modal-header {
    background: linear-gradient(135deg, #D33100, #FF6B47);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

#modal-pedido-detalhado .modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

#modal-pedido-detalhado .close-modal {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-pedido-detalhado .form-detalhado {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #000;
}

#modal-pedido-detalhado .cliente-section,
#modal-pedido-detalhado .produtos-section,
#modal-pedido-detalhado .obs-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    color: #000;
}

#modal-pedido-detalhado .input-group {
    position: relative;
    margin-bottom: 20px;
}

#modal-pedido-detalhado .input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

/* Estilos para inputs do modal */
#modal-pedido-detalhado .input-group input,
#modal-pedido-detalhado .input-group select,
#modal-pedido-detalhado .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    color: #000;
}

#modal-pedido-detalhado .input-group input:focus,
#modal-pedido-detalhado .input-group select:focus,
#modal-pedido-detalhado .input-group textarea:focus {
    outline: none;
    border-color: #D33100;
    box-shadow: 0 0 0 3px rgba(211, 49, 0, 0.1);
}

/* Footer do modal */
#modal-pedido-detalhado .form-footer-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    margin: 0 -24px -24px -24px;
    border-radius: 0 0 15px 15px;
}

/* Botão de envio */
#modal-pedido-detalhado .btn-enviar-simple {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Display do total */
#modal-pedido-detalhado .total-display {
    font-size: 18px;
    font-weight: 600;
    color: #D33100;
}

/* Lista de produtos selecionados */
#modal-pedido-detalhado .produtos-lista-simple {
    margin-top: 15px;
}

#modal-pedido-detalhado .produto-item-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    background: white;
}

#modal-pedido-detalhado .produto-info-simple {
    flex: 1;
}

#modal-pedido-detalhado .produto-nome-simple {
    font-weight: 600;
    color: #000;
}

#modal-pedido-detalhado .produto-preco-simple {
    font-size: 14px;
    color: #6b7280;
}

/* Controles de quantidade */
#modal-pedido-detalhado .produto-quantidade-simple {
    display: flex;
    align-items: center;
    gap: 5px;
}

#modal-pedido-detalhado .qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

#modal-pedido-detalhado .qty-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #000;
}

#modal-pedido-detalhado .remove-produto {
    width: 30px;
    height: 30px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

/* Seletor de produtos */
#modal-pedido-detalhado .produto-selector-simple {
    display: flex;
    gap: 10px;
    align-items: center;
}

#modal-pedido-detalhado .produto-select {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #000;
}

#modal-pedido-detalhado .btn-add-simple {
    width: 40px;
    height: 40px;
    border: none;
    background: #D33100;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layout responsivo */
#modal-pedido-detalhado .input-row {
    display: flex;
    gap: 15px;
}

#modal-pedido-detalhado .input-row .input-group {
    flex: 1;
}

/* Títulos das seções */
#modal-pedido-detalhado .produtos-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #002D72;
}