/* --- ESTILOS DEL MODAL DE REPUESTOS A PANTALLA COMPLETA (parts.css) --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 19, 43, 0.90);
    z-index: 9999;
    display: none; /* Controlado por JS para mostrar como flex */
    justify-content: center;
    align-items: center;
    padding: 0;
    backdrop-filter: blur(8px);
}

.modal-window {
    background: #ffffff;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    background: #0b132b;
    color: #ffffff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.modal-close:hover {
    color: #fca311;
}

.modal-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    max-height: none; /* Ocupa todo el alto disponible debajo del header */
}

.modal-step h4 {
    text-align: center;
    color: #0b132b;
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.hidden-step {
    display: none;
}

/* Tarjetas de Marcas */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.brand-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brand-card:hover {
    border-color: #fca311;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -3px rgba(0,0,0,0.1);
}

.brand-card img {
    max-width: 140px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.brand-card span {
    display: block;
    font-weight: bold;
    color: #0b132b;
    font-size: 1.2rem;
}

/* Buscador dentro del modal */
.search-box-container {
    max-width: 800px;
    margin: 0 auto 25px auto;
}

.search-box-container input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-box-container input:focus {
    border-color: #fca311;
}

/* Botón Volver */
.btn-back {
    background: none;
    border: none;
    color: #1d4ed8;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Cuadrícula de Modelos / Motores */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.model-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.model-card:hover {
    border-color: #0b132b;
    background: #f1f5f9;
}

.model-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.model-card h5 {
    margin: 5px 0;
    color: #0b132b;
    font-size: 1.1rem;
}

.model-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 12px 0;
}

.model-card .btn-whatsapp-sm {
    display: inline-block;
    background-color: #25d366;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: bold;
}

.model-card .btn-whatsapp-sm:hover {
    background-color: #20ba5a;
}
/* Tarjetas de Modelos y Motores dentro del Modal */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.catalog-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.catalog-card:hover {
    border-color: #fca311;
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.catalog-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.catalog-card h5 {
    color: #0b132b;
    font-size: 1.1rem;
    margin: 5px 0;
}

.catalog-card p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 10px 0;
}

.badge-motor {
    display: inline-block;
    background: #0b132b;
    color: #fca311;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}