/* Estilos generales */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Estilos del Header ---- */
.header {
    background: none;
    height: 100px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    box-sizing: border-box;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 2rem;
}

/* Imagen de fondo del header */
.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.7);
}

/* Contenedor del nombre y eslogan */
.header .logo {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: center;
    z-index: 1;
    gap: 15px;
    
    /* RECUADRO NEÓN con fondo transparente */
    padding: 10px 20px;
    border: 1px solid #fff;
    background-color: transparent;
    box-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        inset 0 0 5px #fff,
        inset 0 0 10px #fff;
}

.logo h1 {
    margin: 0;
    font-size: 2em;
    font-family: 'Arial', sans-serif;
    text-transform: none;
    color: #fff;
    text-shadow: none;
    transition: text-shadow 0.3s ease-in-out;
}

.logo a, .logo a:visited {
    color: inherit;
    text-decoration: none;
}

/* Contenedor para los iconos */
.header-icons {
    grid-column: 3 / 4;
    justify-self: end;
}

/* Menú hamburguesa */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 4px 0;
    transition: 0.4s;
}

/* Estilos del Sidebar (Menú lateral) */
.sidebar {
    height: 0;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    
    width: min(80%, 1200px);
    position: fixed;
    z-index: 10;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    
    transition: opacity 0.5s, max-height 0.5s;
    box-sizing: border-box;
    padding: 0 2rem;
}

.sidebar.open {
    height: auto;
    max-height: calc(100vh - 100px);
    opacity: 1;
    visibility: visible;
    padding: 2rem;
    overflow-y: auto;
}

/* Contenedor principal del menú con media queries */
.menu {
    column-count: 1; 
    column-gap: 40px;
}

/* Media query para pantallas más grandes (Tablets, 768px o más) */
@media (min-width: 768px) {
    .menu {
        column-count: 2;
    }
}

/* Media query para pantallas grandes (Laptops, 1024px o más) */
@media (min-width: 1024px) {
    .menu {
        column-count: 4;
    }
}

/* Estilos de los Rubros */
.rubro {
    font-size: 1.2em;
    font-weight: normal;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    break-inside: avoid-column;
}

.rubro:hover {
    color: #007bff;
}

/* Estilos de los Subrubros */
.subrubro {
    font-size: 1em;
    font-weight: normal;
    color: #666;
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
}

.subrubro:hover {
    color: #007bff;
    text-decoration: none;
}

/* Espacio entre grupos de rubros */
.rubro-group-space {
    height: 20px;
    break-inside: avoid-column;
}

/* Estilos generales para el main-content (el resto del cuerpo del sitio) */
.main-content {
    flex-grow: 1;
    padding: 6rem 2rem 2rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
    display: none;
}

/* Estilos para la sección de artículos destacados y listados */
.featured-items,
.listado-articulos {
    display: grid;
    grid-template-columns: repeat(auto-fit, 200px);
    justify-content: center;
    gap: 20px;
    margin-top: 2rem;
}

.articulo-destacado {
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.articulo-destacado:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.articulo-imagen {
    width: 180px;
    height: 150px;
    object-fit: cover;
    display: block;
    margin: 10px auto;
}

.articulo-info {
    padding: 1rem;
    text-align: center;
}

.articulo-nombre {
    font-size: 1.1em;
    font-weight: normal;
    margin: 0 0 0.5rem 0;
}

.articulo-destacado .articulo-precio {
    font-size: 1.1em;
    font-weight: normal;
    color: #333;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

.articulo-precio .precio-pesos {
    display: block;
    font-size: 0.8em;
    color: #777;
    margin-top: 5px;
}

/* --- Estilos para la página de detalle del artículo --- */
.articulo-detalle-container {
    max-width: 1100px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .articulo-detalle-container {
        grid-template-columns: 1.5fr 1fr;
        padding: 4rem;
    }
}

.media-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
}

.main-media {
    width: 100%;
    margin-bottom: 10px;
    position: relative;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    height: 40vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-media img,
.main-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
}

.thumbnails img,
.thumbnails video {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.thumbnails img:hover,
.thumbnails video:hover {
    border-color: #007bff;
}

.info-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.info-column h2 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.articulo-descripcion,
.articulo-adicionales {
    line-height: 1.6;
    color: #555;
    margin-top: 0;
}

.articulo-adicionales p {
    margin: 0.5rem 0;
    line-height: 1.4;
}

.articulo-precio {
    font-size: 1.8em;
    font-weight: normal;
    color: #333;
    margin: 1rem 0;
    text-align: left;
    line-height: 1.2;
}

.articulo-precio .precio-pesos {
    display: block;
    font-size: 0.8em;
    color: #777;
    margin-top: 5px;
}

.articulo-stock {
    color: #007bff;
    font-weight: normal;
    margin-bottom: 2rem;
}

.boton-whatsapp {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #25d366;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}

.boton-whatsapp:hover {
    background-color: #128c7e;
}

/* Estilos del visor de imágenes */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.fullscreen-overlay img,
.fullscreen-overlay video {
    max-width: 90%;
    max-height: 90%;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
}

/* Nuevos estilos para la barra de búsqueda y el ordenamiento */
.filtro-y-busqueda {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.opciones-busqueda {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.filtro-categoria {
    display: flex;
    align-items: center;
    gap: 5px;
}

@media (min-width: 600px) {
    .opciones-busqueda {
        flex-direction: row;
        justify-content: space-between;
    }
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 500px;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}

#searchInput {
    border: none;
    padding: 0.75rem;
    font-size: 1em;
    flex-grow: 1;
    outline: none;
}

#searchButton {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#searchButton:hover {
    background-color: #0056b3;
}

.resultados-info {
    text-align: center;
    width: 100%;
}

#resultadosCount {
    font-size: 1.1em;
    color: #555;
    white-space: nowrap;
}

/* Nuevo estilo para el título y el ordenamiento */
.titulo-y-ordenamiento {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* Permite que los elementos se envuelvan en pantallas pequeñas */
    gap: 1rem;
    margin-top: 2rem;
    padding: 0 1rem;
}

.titulo-seccion {
    text-align: center;
    flex-grow: 1;
    margin: 0;
}

.ordenamiento {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em; /* Letra más chica para el ordenamiento */
    white-space: nowrap; /* Evita que el texto se parta en varias líneas */
}

#ordenar {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
}

/* Estilos del nuevo Footer */
.footer {
    background-color: #333;
    color: #fff;
    padding: 0.6rem;
    margin-top: 0.6rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
    font-size: 0.9em;
}

.footer-content a {
    color: #fff;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

@media (min-width: 600px) {
    .footer-content {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-content p {
        flex: 1 1 auto;
        padding: 0 1rem;
    }

    /* En pantallas grandes, el ordenamiento va a la derecha */
    .titulo-y-ordenamiento {
        justify-content: space-between;
    }
}

/* Media query para dispositivos móviles */
@media (max-width: 768px) {
    .header {
        height: 80px;
        padding: 0 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 5px;

        /* Ajustes para el recuadro neón en móviles */
        padding: 5px 10px;
        border: 1px solid #fff;
        background-color: transparent;
        box-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            inset 0 0 5px #fff,
            inset 0 0 10px #fff;
    }

    .logo h1 {
        font-size: 1.3em;
    }
}