/* Variables CSS para colores */
:root {
    --primary-red: #dc3545; /* Rojo principal para acentos y botones */
    --primary-red-dark: #c82333; /* Rojo más oscuro para hover */
    --secondary-green: #28a745; /* Verde para acciones positivas (WhatsApp) */
    --secondary-green-dark: #218838; /* Verde más oscuro para hover */
    --text-dark: #1f2937; /* Texto oscuro principal */
    --text-medium: #4b5563; /* Texto gris medio */
    --text-light: #6b7280; /* Texto gris claro */
    --bg-light: #f9fafb; /* Fondo muy claro */
    --bg-medium: #f3f4f6; /* Fondo gris claro */
    --border-color: #d1d5db; /* Color de borde general */
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Estilos Generales */
body {
    font-family: 'Inter', sans-serif; /* Usando Inter como fuente principal */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--bg-medium);
    color: var(--text-dark);
    line-height: 1.6; /* Mejorar legibilidad */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header */
.main-header {
    background-color: #fff;
    box-shadow: var(--shadow-light);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem; /* Espaciado más generoso */
    border-bottom: 1px solid var(--border-color);
}

.social-media a {
    margin-right: 1rem;
    color: var(--text-light);
    font-size: 1.25rem; /* Iconos un poco más grandes */
    transition: color 0.2s ease;
}

.social-media a:hover {
    color: var(--primary-red);
}

.logo img {
    height: 3.5rem; /* Ajusta según el tamaño de tu logo */
    width: auto;
}

.categories-nav {
    background-color: var(--primary-red);
    padding: 0.75rem 2rem;
}

.categories-nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem; /* Espaciado entre categorías */
}

.categories-nav a {
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}

.categories-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #fff;
    transition: width 0.3s ease-out;
}

.categories-nav a:hover::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-button {
    background: none;
    border: none;
    font-size: 1.75rem; /* Tamaño de icono más visible */
    cursor: pointer;
    color: var(--text-dark);
    display: none; /* Oculto por defecto en desktop */
}

/* Hero Banner */
.hero-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-light);
    padding: 2.5rem 1.5rem;
    text-align: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .hero-banner {
        flex-direction: row;
        justify-content: center;
        text-align: left;
        padding: 4rem;
    }
}

.promo-content {
    flex: 1;
    padding: 1.5rem;
}

.promo-content h1 {
    font-size: 2.8rem;
    color: var(--primary-red);
    margin-bottom: 0.75rem;
    font-weight: 800; /* Extra bold */
}

.promo-content p {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
}

.discount {
    font-size: 3.5rem;
    font-weight: 900; /* Black */
    color: var(--primary-red);
    margin-bottom: 1.5rem;
}

.discount span {
    background-color: var(--primary-red);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-light);
}

.benefits {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
    color: var(--primary-red);
    font-weight: 600;
}

.benefits i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-medium);
}

/* Tire Search by Size Section */
.tire-search-by-size {
    background-color: #fff;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    border-radius: 0.75rem;
    margin: 2rem auto; /* Centrar y dar espacio */
    max-width: 90%;
}

.tire-search-by-size h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-weight: 700;
}

.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .search-container {
        flex-direction: row;
        justify-content: center;
    }
}

.explanation-image {
    position: relative;
    max-width: 400px;
}

.explanation-image img {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-light);
}

.explanation-image .labels span {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.8em;
    white-space: nowrap;
}

.explanation-image .label.ancho { top: 10%; left: 5%; }
.explanation-image .label.perfil { top: 40%; left: 5%; }
.explanation-image .label.diametro { top: 70%; left: 5%; }

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    max-width: 350px; /* Un poco más ancho para selectores */
}

.search-form .form-group {
    text-align: left;
}

.search-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-medium);
}

.search-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: #fff;
    font-size: 1rem;
    color: var(--text-dark);
    appearance: none; /* Elimina el estilo por defecto del sistema */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236b7280%22%20d%3D%22M287%2C197.3L159.2%2C69.5c-3.2-3.2-8.4-3.2-11.6%2C0L5.4%2C197.3c-3.2%2C3.2-3.2%2C8.4%2C0%2C11.6l11.6%2C11.6c3.2%2C3.2%2C8.4%2C3.2%2C11.6%2C0l120.4-120.4l120.4%2C120.4c3.2%2C3.2%2C8.4%2C3.2%2C11.6%2C0l11.6-11.6C290.2%2C205.7%2C290.2%2C200.5%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E'); /* Flecha personalizada */
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
}


.btn-search {
    background-color: var(--primary-red);
    color: #fff;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: var(--shadow-light);
}

.btn-search:hover {
    background-color: var(--primary-red-dark);
    transform: translateY(-2px);
}
.btn-search:active {
    transform: translateY(0);
}


/* Featured Products / Product Grid */
.featured-products {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.featured-products h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-weight: 700;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Ajustado para mejor responsividad */
    gap: 1.5rem; /* Espaciado entre tarjetas */
    justify-items: center; /* Centra los items dentro de las celdas del grid */
    max-width: 1200px; /* Opcional: limita el ancho máximo del grid */
    margin: 0 auto; /* Centra el grid mismo */
}

.product-card {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-medium); /* Sombra más pronunciada */
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
    width: 100%;
    max-width: 300px;
    margin: 0 auto; /* Centra la tarjeta si el contenedor es más grande que el item del grid */
    display: flex; /* Para mejor control del contenido interno */
    flex-direction: column;
    align-items: center;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card .image-container {
    overflow: hidden;
    position: relative;
    cursor: zoom-in; /* Cursor para el clic (abre modal) */
    width: 100%;
    height: 180px; /* Altura fija para el contenedor de imagen en tarjetas */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    border-radius: 0.5rem; /* Bordes redondeados para el contenedor de imagen */
}

.product-card img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    /* Las imágenes de las tarjetas YA NO tienen 'product-image-zoom' */
}

.product-info {
    width: 100%; /* Ocupa el ancho completo de la tarjeta */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrar texto en la tarjeta */
}

.product-info .brand {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 500;
}

.product-info .model {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.product-info .price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-red);
    margin-bottom: 0.25rem;
}

.product-info .price-local {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
}

/* Services Section */
.services-section {
    background-color: var(--bg-light);
    padding: 2.5rem 1.5rem;
}

.services-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .services-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

.service-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-medium);
}

.service-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Accordion */
.accordion-item {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.accordion-header {
    background-color: var(--primary-red);
    color: white;
    padding: 1rem 1.25rem;
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: var(--primary-red-dark);
}

.accordion-header.active {
    background-color: var(--primary-red-dark);
}

.accordion-header i {
    transition: transform 0.2s ease;
}

.accordion-header.active i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 1.25rem;
    background-color: var(--bg-light);
}

.accordion-content p {
    padding: 1rem 0;
    margin: 0;
    line-height: 1.6;
    color: var(--text-medium);
    border-top: 1px solid var(--border-color);
}

.accordion-content p:first-child {
    border-top: none;
}

/* Footer */
.main-footer {
    background-color: var(--text-dark);
    color: #fff;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-attention {
    background-color: var(--primary-red);
    color: #fff;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-attention i {
    font-size: 1.1rem;
}

.footer-disclaimer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid #4b5563; /* Borde más oscuro para contraste */
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 3.75rem; /* 60px */
    height: 3.75rem; /* 60px */
    bottom: 2.5rem; /* 40px */
    right: 2.5rem; /* 40px */
    background-color: var(--secondary-green);
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 1.875rem; /* 30px */
    box-shadow: var(--shadow-medium);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* Modal para Ampliación de Imagen */
.image-zoom-overlay {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fondo más oscuro */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0; /* Para la transición de opacidad */
    transition: opacity 0.3s ease-in-out;
}

.image-zoom-overlay.active {
    opacity: 1;
    display: flex; /* Mostrar después de la transición de opacidad */
}

.image-zoom-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7); /* Sombra más pronunciada */
    border-radius: 0.5rem; /* Bordes redondeados */
}

.close-zoom-btn {
    position: absolute;
    top: 1.25rem; /* 20px */
    right: 1.875rem; /* 30px */
    color: #fff;
    font-size: 2.5rem; /* 40px */
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-zoom-btn:hover {
    color: var(--primary-red);
}

/* Estilos para el efecto de lupa (al pasar el cursor) */
/* Este estilo se aplica a la imagen *dentro* del modal (#zoomedImage) */
.product-image-zoom-modal { /* Nueva clase para la imagen dentro del modal */
    width: 100%; /* Asegura que la imagen dentro de la lupa use todo el espacio del contenedor */
    height: 100%;
    object-fit: contain;
    cursor: crosshair; /* Cursor para la lupa cuando está activa en el modal */
}

.magnifying-lens {
    position: fixed;
    border: 2px solid var(--primary-red);
    border-radius: 8px; /* Cuadrado con esquinas redondeadas */
    cursor: none;
    width: 220px; /* Tamaño de la lupa */
    height: 220px;
    background-repeat: no-repeat;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-medium);
    display: none; /* Oculto por defecto */
    pointer-events: none; /* Permite que los eventos del mouse pasen a la imagen subyacente */
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* Estilos para las imágenes de las tarjetas de producto (solo clic, no lupa aquí) */
.product-card .image-container {
    overflow: hidden;
    position: relative;
    cursor: zoom-in; /* Cursor para indicar que es clickeable para abrir modal */
    width: 100%;
    height: 180px; /* Altura fija para el contenedor de imagen en tarjetas */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5rem; /* Bordes redondeados para el contenedor */
}
/* Ajuste para product-result-card para que el contenedor de imagen sea fijo */
.product-result-card .image-container {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .product-result-card .image-container {
        margin-right: 1.5rem;
        margin-bottom: 0;
    }
}

/* La imagen dentro de la tarjeta, solo para el clic */
.product-image-clickable {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    margin: 0;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .top-bar {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .social-media, .user-nav {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.75rem;
    }

    .logo {
        order: -1;
        margin-bottom: 1rem;
    }

    .header-right-nav {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .mobile-menu-button {
        display: block;
    }

    .categories-nav {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        position: absolute;
        width: 100%;
        background-color: var(--primary-red);
        z-index: 99;
    }

    .categories-nav.active {
        display: flex;
    }

    .categories-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .categories-nav li {
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .categories-nav a {
        display: block;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    .categories-nav a::after {
        display: none;
    }

    .hero-banner {
        padding: 1.5rem;
    }

    .promo-content h1 {
        font-size: 2rem;
    }

    .discount {
        font-size: 3rem;
    }

    .tire-search-by-size {
        padding: 1.5rem;
    }
    .tire-search-by-size h2 {
        font-size: 1.8rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-form {
        max-width: 100%;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-section {
        width: 100%;
        max-width: 300px;
    }

    .contact-info ul {
        padding-left: 0;
    }

    .whatsapp-float {
        width: 3.5rem;
        height: 3.5rem;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.75rem;
    }
}