/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: grid;
    grid-template-columns: 200px 1fr 200px; /* Ajusta el ancho de las columnas */
    min-height: 100vh;
    margin: 0;
    background: #ffffff; /* Color de fondo para las sidebars */
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #112522;
}

.left-sidebar, .right-sidebar {
    width: 200px; /* Ancho fijo para anuncios */
    background: #0c7866;
    border: 1px solid #0c7866; /* Bordes sutiles */
    padding: 1rem;
    box-sizing: border-box;
}

.main-container {
    width: 100%;
    max-width: 1503px; /* Ancho máximo del contenido central */
    margin: 0 ;
    padding: 0 ;
    box-sizing: border-box; /* Incluye padding en el ancho total */
}

/* Responsividad: Oculta sidebars en móviles */
@media (max-width: 1024px) {
    body {
        grid-template-columns: 1fr;
    }
    .left-sidebar, .right-sidebar {
        display: none;
    }
    .main-container {
        padding: 0 10px; /* Reduce espacio en móviles */
    }
}

header {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    background: #0c7866;
}

.logo h1 {
    font-size: 1.5rem;
    color: #333;
}

.main-nav {
    flex-grow: 1;  /* Menú ocupa el espacio restante */
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav ul li a {
    text-decoration: none;
    color: #fbf1a4;
    font-weight: 500;
}

.main-nav ul li a:hover {
    background: #ffffff;
    border-radius: 4px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive: Menú se convierte en hamburguesa en móvil */
@media (max-width: 768px) {
    /* Muestra el botón hamburguesa */
    .mobile-menu-toggle {
        display: block;
    }

    /* Oculta el menú principal inicialmente */
    .main-nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .main-nav ul {
        transition: transform 0.3s ease;
    }
    .main-nav.active ul {
        transform: translateY(0);
    }

    /* Cuando está activo (clase añadida via JS) */
    .main-nav.active {
        max-height: 300px; /* Ajusta según contenido */
    }

    /* Cambia a disposición vertical */
    .main-nav ul {
        flex-direction: column;
        padding: 1rem 0;
    }
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #e60b0b;
}

.hero {
    background: #ffffff;
    padding: 2rem;
    margin-left: 20rem;
    margin-right: 20rem;
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.product-card {
    border: 1px solid #0c7866;
    padding: 1rem;
    border-radius: 5px;
    text-align: center;
}

.product-card img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    background: #8cb484;
    color: rgb(255, 255, 255);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 0.5rem;
}

footer {
    background: #0c7866;
    color: rgb(255, 255, 255);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Estilos del carrusel */
.products-carousel {
    display: flex;
    overflow-x: auto;  /* Permite desplazamiento horizontal */
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 0 2rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;  /* Mejora el scroll en iOS */
    width: max-content; /* ¡Clave! Hace que el contenedor sea tan ancho como sus productos */
    margin: 0 auto;
    transition: transform 0.5s ease-in-out;
}

/* Oculta la barra de scroll en algunos navegadores */
.products-carousel::-webkit-scrollbar {
    display: none;
}

/* Estilos de las tarjetas de producto en el carrusel */
.products-carousel .product-card {
    scroll-snap-align: start;
    flex: 0 0 auto;  /* Evita que las tarjetas se estiren */
    width: 250px;  /* Ancho fijo para cada tarjeta */
}


.carousel-controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

.carousel-controls button:hover {
    background: var(--secondary-color);
}
/* --- Contenedor del carrusel (NUEVO) --- */
.products-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    overflow-x: auto; /* Permite scroll horizontal */
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch; /* Mejor scroll en iOS */
    scroll-snap-type: x mandatory;
}

/* --- Tarjetas (MANTÉN tus estilos actuales y AÑADE estos) --- */
.products-carousel .product-card {
    flex: 0 0 250px;
    min-width: 250px;
    scroll-snap-align: start;
    transition: transform 0.3s;
}

/* --- Controles (NUEVO) --- */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: rgb(255, 255, 255);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}