/* Variables base - Colores de la marca y diseño limpio */
:root {
    --primary-color: #0033a0; /* Azul oscuro del logo SR */
    --secondary-color: #f4f4f9;
    --text-color: #333333;
    --light-text: #ffffff;
    --accent-color: #25D366; /* Verde WhatsApp */
    --border-color: #e0e0e0;
    --hover-color: #002277;
    --bg-body: #f9fafc;
}

/* Reset y configuraciones generales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Banner Superior */
.top-banner {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
}

.banner-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.phone-link, .whatsapp-link {
    color: var(--light-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.phone-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.whatsapp-link {
    background-color: var(--accent-color);
}

.whatsapp-link:hover {
    background-color: #1ebd5a;
}

/* Cabecera / Header */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo-container .logo {
    max-height: 80px;
    object-fit: contain;
}

/* Buscador */
.search-container {
    display: flex;
    flex: 1;
    max-width: 500px;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background-color: var(--hover-color);
}

/* Filtros de Marca */
.brand-filters {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.brand-btn {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-color);
}

.brand-btn:hover {
    background-color: var(--secondary-color);
}

.brand-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Catálogo y Tarjetas */
.brand-group {
    margin-bottom: 40px;
}

.brand-title {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.engines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.engine-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.engine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.engine-image-container {
    height: 220px;
    width: 100%;
    background-color: #eee;
    overflow: hidden;
    cursor: pointer;
}

.engine-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.engine-image:hover {
    transform: scale(1.05);
}

.engine-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.engine-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.engine-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.contact-btn {
    display: block;
    text-align: center;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.contact-btn:hover {
    background-color: #1ebd5a;
}

/* Modal de Imagen */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo-container {
        text-align: center;
    }
    
    .search-container {
        max-width: 100%;
    }
}
