/* ============================================
   SISTEMA DE COTAÇÕES - CSS v2.0
   ============================================ */

/* ============================================
   BOTÃO DE COTAÇÃO NOS PRODUTOS
   ============================================ */
.quote-button {
    margin-top: 10px;
    background-color: #0073aa;
    color: white !important;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
}

.quote-button:hover {
    background-color: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.quote-button:active {
    transform: translateY(0);
}

.quote-button .quote-icon {
    font-size: 16px;
}

.quote-button.added {
    background-color: #46b450 !important;
    animation: pulse 0.5s;
}

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

/* ============================================
   TABELA DE PRODUTOS (LISTA DE COTAÇÃO)
   ============================================ */
.quote-products-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quote-product-item {
    display: grid;
    grid-template-columns: 80px 1fr 140px 40px;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.quote-product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #0073aa;
}

.quote-product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.quote-product-details {
    flex: 1;
}

.quote-product-details h4,
.quote-product-name {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.quote-product-sku {
    font-size: 12px;
    color: #999;
    display: block;
    margin-top: 4px;
}

/* Controles de Quantidade */
.quote-product-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.qty-btn:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.qty-btn:active {
    transform: scale(0.95);
}

.quote-quantity {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.quote-quantity:focus {
    outline: none;
    border-color: #0073aa;
}

/* Botão Remover */
.quote-product-remove {
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-from-quote {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 4px;
}

.remove-from-quote:hover {
    opacity: 1;
    background: #ffebee;
    transform: scale(1.1);
}

/* ============================================
   RESUMO DA COTAÇÃO
   ============================================ */
.quote-summary {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #d1e9ff;
}

.quote-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 115, 170, 0.1);
}

.quote-summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 8px;
    font-weight: bold;
    font-size: 18px;
    color: #0073aa;
}

.quote-summary-label {
    color: #666;
    font-size: 14px;
}

.quote-summary-value {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

/* ============================================
   CONTADOR DE COTAÇÕES (BADGE)
   ============================================ */
.quote-count-badge {
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
    line-height: 1.6;
    min-width: 20px;
    text-align: center;
}

/* ============================================
   FORMULÁRIO DE COTAÇÃO
   ============================================ */
.quote-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
}

.quote-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.quote-form p {
    margin-bottom: 20px;
}

.quote-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.quote-form input[type="text"],
.quote-form input[type="email"],
.quote-form input[type="tel"],
.quote-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.quote-form input:focus,
.quote-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.quote-form input.error {
    border-color: #dc3545;
}

.quote-form .field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.quote-form textarea {
    resize: vertical;
    min-height: 100px;
}

.quote-form button[type="submit"] {
    background: #46b450;
    color: white;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.quote-form button[type="submit"]:hover {
    background: #2e7d32;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(70, 180, 80, 0.3);
}

/* ============================================
   LISTA "MINHA CONTA"
   ============================================ */
.woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-orders-table th,
.woocommerce-orders-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.woocommerce-orders-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.woocommerce-orders-table .button {
    padding: 8px 16px;
    text-decoration: none;
    display: inline-block;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.quote-status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #28a745;
    color: white;
}

/* ============================================
   DETALHES DA COTAÇÃO
   ============================================ */
.quote-details-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #0073aa;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
    flex-wrap: wrap;
    gap: 15px;
}

.quote-header h2 {
    margin: 0;
    color: #333;
}

.quote-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.quote-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quote-info-item strong {
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-info-item span {
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.quote-section {
    margin-bottom: 40px;
}

.quote-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.quote-details-table {
    width: 100%;
    border-collapse: collapse;
}

.quote-details-table th,
.quote-details-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.quote-details-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.quote-details-table .product-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quote-details-table .product-cell img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.quote-message-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
    line-height: 1.6;
}

/* Resposta do Admin */
.admin-response-box {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.quote-value-display,
.quote-validity-display {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 115, 170, 0.2);
    font-size: 16px;
}

.quote-value-display strong {
    color: #0073aa;
    font-size: 18px;
}

/* Ações da Cotação */
.quote-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.quote-actions .button {
    flex: 1;
    text-align: center;
    padding: 15px 25px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.approve-quote-btn {
    background: #46b450 !important;
    color: white !important;
}

.approve-quote-btn:hover {
    background: #2e7d32 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(70, 180, 80, 0.3);
}

.whatsapp-btn {
    background: #25D366 !important;
    color: white !important;
}

.whatsapp-btn:hover {
    background: #1da851 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.quote-approved-msg {
    background: #d4edda;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    text-align: center;
}

.quote-approved-msg p {
    margin: 10px 0;
    color: #155724;
    font-weight: 600;
}

/* ============================================
   MENSAGENS DE SUCESSO/ERRO
   ============================================ */
.quote-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

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

.quote-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quote-message.success::before {
    content: "✓";
    font-size: 20px;
    font-weight: bold;
}

.quote-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.quote-message.error::before {
    content: "✕";
    font-size: 20px;
    font-weight: bold;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.quote-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   PÁGINA VAZIA
   ============================================ */
.quote-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.quote-empty p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .quote-product-item {
        grid-template-columns: 60px 1fr;
        gap: 15px;
    }
    
    .quote-product-image img {
        width: 60px;
        height: 60px;
    }
    
    .quote-product-quantity,
    .quote-product-remove {
        grid-column: 1 / -1;
        justify-content: center;
    }
    
    .quote-actions {
        flex-direction: column;
    }
    
    .quote-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quote-form {
        padding: 20px;
    }
    
    .quote-details-table .product-cell {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   INTEGRAÇÃO COM WOOCOMMERCE
   ============================================ */
.woocommerce .quote-button {
    width: 100%;
    margin-top: 10px;
}

.woocommerce-message {
    padding: 15px 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* ============================================
   MELHORIAS DE UX
   ============================================ */
* {
    box-sizing: border-box;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

a.button:hover {
    text-decoration: none;
}

/* Animação suave para todas as transições */
* {
    transition-property: background-color, border-color, color, box-shadow, transform;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

input, textarea, button {
    transition-property: all;
}