/* Profile & Cart Consistency CSS */
/* Fixes styling inconsistencies across different pages */

/* Cart Button Consistency */
.cart-button,
button[onclick="openCartModal()"] {
    position: relative;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background-color: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cart-button:hover,
button[onclick="openCartModal()"]:hover {
    background-color: #f3f4f6;
}

/* Cart Counter Badge Consistency */
#cart-counter,
#cart-counter-mobile,
#cart-counter-header,
.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

/* Mobile Cart Button Specific Styles */
.cart-button-mobile {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-button-mobile:hover {
    background-color: #e5e7eb;
    color: #111827;
}

/* Cart Modal Consistency */
.cart-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
}

.cart-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #dc7a1f 100%);
    padding: 24px;
}

.cart-modal-body {
    flex: 1;
    overflow: hidden;
}

.cart-modal-footer {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

/* Profile Layout Consistency */
.profile-layout {
    background-color: #f9fafb;
}

/* Header Consistency */
.header-logo-link {
    text-decoration: none;
    color: inherit;
}

.header-logo-link:hover {
    text-decoration: none;
}

/* Navigation Consistency */
.nav-link {
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--primary);
    background-color: #fef3e7;
    text-decoration: none;
}

/* Mobile-specific fixes */
@media (max-width: 1023px) {
    .cart-counter {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -6px;
        right: -6px;
    }
    
    .cart-button {
        padding: 8px;
    }
}

/* Responsive Design Fixes */
@media (max-width: 640px) {
    .cart-modal-content {
        margin: 16px;
        height: calc(100vh - 32px);
    }
    
    .cart-modal-header,
    .cart-modal-footer {
        padding: 16px;
    }
}

/* Z-index hierarchy for proper layering */
.cart-modal {
    z-index: 1000;
}

.mobile-menu {
    z-index: 999;
}

.mobile-menu-backdrop {
    z-index: 998;
}

/* Animation improvements */
.cart-button,
.cart-counter {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.cart-button:focus,
button[onclick="openCartModal()"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Ensure buttons work consistently */
button {
    font-family: inherit;
}

/* ========== MODAIS DE EXEMPLO DE CONSULTAS ========== */

/* Overlay e estrutura base do modal */
.consultation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.consultation-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-container {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 900px;
    max-height: 90vh;
    width: 95%;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    border: 2px solid rgba(232, 138, 48, 0.1);
}

/* Header do modal */
.modal-header {
    background: linear-gradient(135deg, #fefaf7 0%, #ffffff 100%);
    padding: 24px 32px;
    border-bottom: 2px solid rgba(232, 138, 48, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-title-section h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* Badges dos modais */
.premium-badge, .basic-badge, .intermediate-badge, 
.gravame-badge, .empresarial-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.premium-badge {
    background: linear-gradient(135deg, var(--primary-500, #E88A30) 0%, var(--primary-600, #d17821) 100%);
}

.basic-badge {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.intermediate-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gravame-badge {
    background: linear-gradient(135deg, var(--secondary-500, #4d9999) 0%, var(--secondary-600, #3d7a7a) 100%);
}

.empresarial-badge {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.premium-badge i, .basic-badge i, .intermediate-badge i,
.gravame-badge i, .empresarial-badge i {
    width: 14px;
    height: 14px;
}

/* Botão de fechar */
.modal-close-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-close-btn i {
    width: 20px;
    height: 20px;
}

/* Conteúdo do modal */
.modal-content {
    padding: 32px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

/* Header do veículo no modal */
.example-vehicle-info {
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    border: 1px solid #e0f2fe;
}

.vehicle-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vehicle-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-500, #E88A30) 0%, var(--primary-600, #d17821) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(232, 138, 48, 0.3);
}

.vehicle-logo i {
    width: 28px;
    height: 28px;
}

.vehicle-details h3 {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
}

.vehicle-details p {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
}

/* Seções de exemplo */
.example-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.example-section h4 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.example-section h4 i {
    width: 20px;
    height: 20px;
    color: var(--primary-500, #E88A30);
}

/* Grid de cards de exemplo */
.example-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.example-card {
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.example-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.example-card.status-positivo {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.example-card.status-negativo {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.example-card.status-amarelo {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.example-card .card-header {
    background: rgba(255, 255, 255, 0.6);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.example-card .card-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.example-card .card-content {
    padding: 16px;
    text-align: center;
}

/* Indicadores de status */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.status-indicator.status-positivo {
    color: #15803d;
    background: rgba(34, 197, 94, 0.1);
}

.status-indicator.status-negativo {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.status-indicator.status-amarelo {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.status-indicator i {
    width: 16px;
    height: 16px;
}

/* Grid de dados */
.example-data-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.data-row:hover {
    background: #f9fafb;
    border-color: rgba(232, 138, 48, 0.3);
}

.data-row.highlight {
    background: linear-gradient(135deg, #fefaf7 0%, #ffffff 100%);
    border: 2px solid rgba(232, 138, 48, 0.2);
    font-weight: 600;
}

.data-row .label {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.9rem;
}

.data-row .value {
    font-weight: 600;
    color: #1f2937;
    text-align: right;
}

.data-row .value.status-positivo {
    color: #15803d;
}

.data-row .value.status-negativo {
    color: #dc2626;
}

/* Seção específica de débitos empresariais */
.debitos-empresarial {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.debito-categoria {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.debito-categoria h5 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.total-debitos {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fca5a5;
    border-radius: 12px;
    padding: 16px 20px;
}

/* Footer do modal */
.modal-footer {
    padding: 24px 32px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid #e5e7eb;
}

.modal-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.modal-note i {
    width: 20px;
    height: 20px;
    color: var(--primary-500, #E88A30);
    flex-shrink: 0;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 20px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .modal-title-section {
        flex-direction: column;
        gap: 12px;
    }

    .modal-content {
        padding: 20px;
        max-height: calc(95vh - 160px);
    }

    .vehicle-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .vehicle-details h3 {
        font-size: 1.2rem;
    }

    .example-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .data-row {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .data-row .label,
    .data-row .value {
        text-align: center;
    }

    .example-section h4 {
        font-size: 1.1rem;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-content {
        padding: 16px;
        max-height: calc(100vh - 140px);
    }

    .example-vehicle-info {
        padding: 16px;
        margin-bottom: 24px;
    }

    .vehicle-logo {
        width: 50px;
        height: 50px;
    }

    .vehicle-logo i {
        width: 24px;
        height: 24px;
    }

    .example-sections {
        gap: 24px;
    }

    .debito-categoria {
        padding: 16px;
    }
}