/* ============================================
   ESTILOS DO CATÁLOGO COM ORÇAMENTO
   ============================================ */

/* Wrapper dos botões */
.co-buttons-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100%;
    max-width: 100%;
}

.co-buttons-wrapper > * {
    margin: 0 !important;
}

/* Seletor de quantidade */
.co-quantity-selector {
    margin-bottom: 15px !important;
    padding: 0 !important;
}

.co-quantity-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.co-quantity-input {
    width: 80px;
    padding: 8px !important;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Container dos botões */
.co-buttons-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
}

/* Estilo dos botões */
.co-btn {
    padding: 12px 24px !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: opacity 0.3s;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    margin: 0 !important;
    white-space: nowrap;
}

.co-btn:hover {
    opacity: 0.8;
}

/* Ícones dos botões */
.co-btn-icon {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
}

.co-btn-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: inline-block;
    flex-shrink: 0;
}

.co-btn span {
    line-height: 1;
}

/* Remove qualquer padding ou margin herdado */
.co-buttons-wrapper * {
    box-sizing: border-box;
}

/* Ajustes específicos do Elementor */
.elementor-widget-container .co-buttons-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
}

.elementor-widget-container .co-buttons-container {
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-widget-container .co-btn {
    margin: 0 !important;
}

.elementor-element .co-buttons-wrapper {
    margin: 0 !important;
    width: 100%;
}

/* Ajuste específico para Elementor Grid/Loop */
.elementor-loop-container .co-buttons-wrapper,
.elementor-grid .co-buttons-wrapper {
    width: 100%;
    max-width: 100%;
}

.elementor-loop-container .co-btn,
.elementor-grid .co-btn {
    min-width: 0;
    flex: 1 1 auto;
}

/* Remove espaçamento de widgets */
.widget .co-buttons-wrapper,
.wp-block .co-buttons-wrapper {
    margin: 0 !important;
}

/* Remove espaçamento de parágrafos */
.co-buttons-wrapper p {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   MODAL DE ORÇAMENTO RÁPIDO
   ============================================ */

.co-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.co-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.co-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    background: none;
    border: none;
}

.co-modal-close:hover {
    color: #000;
}

.co-modal h2 {
    margin-top: 0;
}

/* Formulário do modal */
.co-form-group {
    margin-bottom: 15px;
}

.co-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.co-form-group input,
.co-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.co-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Botão de envio */
.co-submit-btn {
    background-color: #0073aa;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
}

.co-submit-btn:hover {
    background-color: #005a87;
}

.co-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Informações do produto no modal */
.co-product-info {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.co-product-info p {
    margin: 5px 0;
}

/* Mensagens de sucesso/erro */
.co-message {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.co-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.co-message.success h3 {
    font-size: 20px;
    margin: 0;
}

.co-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Barra de progresso */
.co-progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin: 15px 0;
}

.co-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* ============================================
   ÍCONE DO CARRINHO FLUTUANTE
   ============================================ */

.co-cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 9998;
}

.co-cart-icon:hover {
    background-color: #218838;
}

.co-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .co-buttons-container {
        flex-direction: column;
    }
    
    .co-btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    .co-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    /* Garante que o wrapper não quebre o grid do Elementor */
    .elementor-widget-container .co-buttons-wrapper {
        max-width: 100%;
        overflow: hidden;
    }
    
    .elementor-element .co-buttons-wrapper {
        width: 100%;
    }
}

/* ============================================
   CORREÇÃO PARA ELEMENTOR LOOP/GRID - PRIORIDADE MÁXIMA
   ============================================ */

/* Wrapper */
.elementor-widget-loop-grid .co-buttons-wrapper,
.elementor-loop-container .co-buttons-wrapper,
.elementor-grid .co-buttons-wrapper,
.elementor-posts .co-buttons-wrapper,
div.elementor-loop-container div.co-buttons-wrapper,
div.elementor-grid div.co-buttons-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Container dos botões */
.elementor-widget-loop-grid .co-buttons-container,
.elementor-loop-container .co-buttons-container,
.elementor-grid .co-buttons-container,
.elementor-posts .co-buttons-container,
div.elementor-loop-container div.co-buttons-container,
div.elementor-grid div.co-buttons-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Botões */
.elementor-widget-loop-grid .co-btn,
.elementor-loop-container .co-btn,
.elementor-grid .co-btn,
.elementor-posts .co-btn,
div.elementor-loop-container button.co-btn,
div.elementor-grid button.co-btn {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 0 !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
}

/* Card do produto */
.elementor-widget-loop-grid .elementor-post,
.elementor-loop-container .elementor-post,
.elementor-grid .elementor-post,
div.elementor-loop-container .elementor-post,
div.elementor-grid .elementor-post {
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Mobile específico para Elementor */
@media (max-width: 768px) {
    .elementor-widget-loop-grid .co-btn,
    .elementor-loop-container .co-btn,
    .elementor-grid .co-btn,
    .elementor-posts .co-btn,
    div.elementor-loop-container button.co-btn,
    div.elementor-grid button.co-btn {
        width: 100% !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    .elementor-widget-loop-grid .co-buttons-wrapper,
    .elementor-loop-container .co-buttons-wrapper,
    .elementor-grid .co-buttons-wrapper,
    div.elementor-loop-container div.co-buttons-wrapper,
    div.elementor-grid div.co-buttons-wrapper {
        max-width: 100% !important;
    }
}
