body
{
    font-family: 'Noto Sans', sans-serif;
    padding: 0;
    margin: 0;
    background-color: #e7ebf3;
}
nav
{
    background-color: #16366d;
}
main
{
    padding: 10px;
}
nav img
{
  margin-left: 25px;
  margin-top: 10px;
  width: 200px;
  height: 80px;
  transition: 0.5s;
}
nav img:hover
{
  transition: 0.5s;
  filter: drop-shadow(0 0 5px rgb(250, 250, 250));
}
.navbar 
{
    background-color: #16366d;
}
.menu
{
  font-family: 'Noto Sans', sans-serif;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}
.menu > li
{
  position: relative;
}
.menu > li > a
{
  display: block;
  padding: 12px 20px;
  color: rgb(255, 255, 255);
  text-decoration: none;
}
.menu > li > a:hover
{
  border-radius: 8px;
  transition: 0.5s;
  background: #0b1c38;
  color: rgb(104, 104, 104);
}
/* Submenús ocultos inicialmente */
.submenu {
  display: none;           /* se ocultan de entrada */
  position: absolute;
  top: 100%;
  left: 0;
  background: #102850;
  min-width: 180px;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1000;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
/* Ítems dentro del submenú */
.submenu li a 
{
  display: block;
  padding: 10px 15px;
  color: rgb(255, 255, 255);
  text-decoration: none;
  white-space: nowrap;
}
.submenu li a:hover 
{
  border-radius: 8px;
  background: #112b57;
}
/* Mostrar submenú al pasar el mouse */
.dropdown:hover > .submenu
{
  display: block;
}
/* Submenú en cascada hacia la derecha */
.subderecha {
  top: 0;
  left: 100%;
}
.barraup
{
  display: flex;
  justify-content: space-between;
}
.barra_inicio
{
    background-color: #16366d;
}
.boton_busca
{
    margin-right: 5px;
    height: 28px;
    width: 28px;
    border-radius: 25px;
    border-style: none;
}
.boton_busca:hover
{
    transition: 0.5s;
    color:white;
    background-color: #0545da;
}
.buscador
{
    margin-top: 35px; 
}
.barra_busqueda
{
  margin-right: 8em;
    height: 25px;
    width: 250px;
    border-radius: 15px;
    border-style: none;
}
.carro
{
    margin-right: 25px;
    margin-top: 45px;
    color: white
  }
  .carro:hover
  {
    transition: 0.5s;
    color:#0545da
  }
  .barra_inicio img
  {
    width: 200px;
    height: 80px;
    filter: drop-shadow(0 0 5px rgb(250, 250, 250));
  }
  #termo
  {
    width: 300px;
    height: 300px;
}
footer
{
    background-color: #16366d;
}
.socialmedia
{
    display: flex;
    padding-top: 25px;
    padding-bottom: 25px;
}
.facebook
{
    margin-right: 15px;
}
.icono-social
{
    font-size: 3em;
    margin-right: 15px;
    transition: color 0.3s;
}
.fa-square-facebook
{
  transition: 0.5s;
  margin-left: 20px;
  color: #ffffff;
}
.fa-square-facebook:hover
{
  transition: 0.5s;
  color: #0545da;
  filter: drop-shadow(0 0 5px rgb(250, 250, 250));
}
.fa-instagram
{
  transition: 0.5s;
  color: #ffffff;
}
.fa-instagram:hover
{
  transition: 0.5s;
  color: #ff0095;
  filter: drop-shadow(0 0 5px rgb(250, 250, 250));
}
.contenedor
{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;        /* permite saltar a nueva fila */
  gap: 20px;              /* separación entre items */
  width: 100%;
}
.contenedorterm
{
  background-color: #ffffff;
  margin-left: 15px;
  margin-right: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  height: 500px;
  box-sizing: border-box;
  flex: 0 0 calc(25% - 40px);   /* 4 por fila (ajusta el -40px según gap/márgenes) */
  max-width: calc(25% - 40px);
  transition: 0.3s;
}

/* Responsive: 2 por fila en pantallas medianas, 1 por fila en móviles */
@media (max-width: 900px) {
  .contenedorterm { flex: 0 0 calc(50% - 20px); max-width: calc(50% - 20px); }
}
@media (max-width: 480px) {
  .contenedorterm { flex: 0 0 calc(100% - 20px); max-width: calc(100% - 20px); }
}
.contenedorterm a
{
  color: rgb(255, 255, 255);
  text-decoration: none;
}
.contenedorterm a h3
{
  padding-top: 19px;
  text-align: center;
}
.contenedorterm a p
{
  text-align: center;
  padding-top: 2px;
}
.underlime
{
  font-family: 'Noto Sans', sans-serif;
  padding: 0;
  background: #0b1c38;
  padding-bottom: 5em;

  border-end-end-radius: 8px;
  border-end-start-radius: 8px;
}
h1
{
  text-transform: uppercase;
  margin-left: 4.2em
}
/* Submenús ocultos inicialmente */
.submenu 
{
  display: none;           /* se ocultan de entrada */
  position: absolute;
  top: 100%;
  left: 0;
  background: #102850;
  min-width: 180px;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1000;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
/* Ítems dentro del submenú */
.submenu li a 
{
  display: block;
  padding: 10px 15px;
  color: rgb(255, 255, 255);
  text-decoration: none;
  white-space: nowrap;
}
.submenu li a:hover 
{
  border-radius: 8px;
  background: #112b57;
}
/* Mostrar submenú al pasar el mouse */
.dropdown:hover > .submenu 
{
  display: block;
}
/* Submenú en cascada hacia la derecha */
.subderecha 
{
  top: 0;
  left: 100%;
}
.agregarcarro
{
  border-radius: 5px;
  padding: 5px 20px 5px 20px;
  border: none;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(-2em);
  margin-left: 6.5em;
}
.contenedorterm:hover .agregarcarro
{
  cursor: pointer;
  margin-left: 6.5em;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-4em);
}
.agregarcarro:hover
{
  background: #b1b1b1;
}
.agregarcarro:active
{
  background: #838383;
}
#valorContador
{
  color: white;
  display: flex;
  justify-content: center;
  position: absolute;
  z-index: 10;
  transform: translateX(-6px) translateY(-8px);
  padding-left: 6px;
  padding-right: 6px;
  border-radius: 50%;
  background-color: red;
}
.contenedorterm:hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 10px 20px rgba(16, 40, 80, 0.18);
    border-radius: 8px;
    will-change: transform, box-shadow;
}

/* Respetar preferencia de reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  .contenedorterm,
  .contenedorterm:hover {
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
  }
}
@media screen and (max-width: 768px) {
    /* --- ESTRUCTURA BÁSICA --- */
    html, body {
        /* Evita la barra blanca lateral */
        overflow-x: hidden; 
        width: 100%;
    }

    /* ========================================================================= */
    /* BARRA SUPERIOR (nav.barraup) */
    /* ========================================================================= */
    .barraup {
        flex-direction: column; /* Apila logo, buscador y carrito */
        align-items: center;
        padding-bottom: 10px;
    }

    nav img {
        margin: 10px auto;
        width: 150px;
        height: 60px;
    }

    .buscador {
        margin-top: 5px; 
        margin-bottom: 10px;
        display: flex;
        justify-content: center;
        width: 90%; 
    }

    .barra_busqueda {
        width: 70%;
        margin-right: 5px;
    }

    .carro {
        position: absolute;
        top: 15px;
        right: 15px;
        margin-top: 0;
    }
    
    /* ========================================================================= */
    /* MENÚ DE NAVEGACIÓN (navbar y menu) - Adaptado para Clic/Acordeón */
    /* ========================================================================= */
    .navbar {
        width: 100%;  
    }

    .menu {
        flex-direction: column; /* Menú vertical en móvil */
        align-items: center; 
        width: 100%;
    }

    .menu > li {
        width: 90%; 
        border-bottom: 1px solid #285592; /* Separador */
    }

    .menu > li > a {
        text-align: center;
        padding: 15px 0;
    }

    .submenu {
        position: static; /* Se comporta como un acordeón */
        display: none; /* Oculto por defecto, se mostrará con JavaScript */
        background-color: #0b1c38;
        width: 100%;
        padding: 5px 0;
    }

    /* Clase para mostrar el submenú con JavaScript */
    .dropdown.active-menu > .submenu {
        display: block !important; 
    }

    /* Deshabilitar hover en móvil */
    .dropdown:hover > .submenu {
        display: none;
    }
    
    /* ========================================================================= */
    /* CONTENEDOR DE PRODUCTOS (.contenedor) */
    /* ========================================================================= */
    .contenedor {
        /* Fuerza una sola columna, o una grilla que fluya */
        display: flex; 
        flex-direction: column;
        align-items: center;
    }

    .contenedorterm {
        width: 90%; /* Hace que cada producto ocupe casi todo el ancho */
        max-width: 350px; /* Limita el tamaño en pantallas muy anchas */
        margin: 10px 0; /* Espacio entre productos apilados */
        padding: 10px;
        height: auto;
    }

    .contenedorterm img {
        width: 80%;
        height: auto;
        max-height: 200px; /* Limita la altura de la imagen */
        margin-bottom: 10px;
    }
    
    .contenedorterm h3, .contenedorterm p {
        text-align: center;
    }

    /* Mover el botón 'agregarcarro' para que sea más fácil de tocar */
    .agregarcarro {
        opacity: 1; /* Mostrar el botón siempre en móvil */
        pointer-events: auto;
        transform: none; /* Desactivar el efecto de movimiento (transform) */
        margin: 10px auto; /* Centrar el botón */
        display: block;
        width: 80%;
        padding: 10px 20px;
    }
    
    .contenedorterm:hover .agregarcarro {
        /* Desactivar cualquier cambio al pasar el mouse */
        transform: none; 
        margin-left: auto;
    }

    /* ========================================================================= */
    /* FOOTER */
    /* ========================================================================= */
    footer {
        flex-direction: column; 
        align-items: center;
        padding: 15px 0;
    }

    .socialmedia {
        padding: 10px 0;
        justify-content: center;
    }
    
    .Secciones {
        flex-direction: column; 
        width: 100%;
        align-items: center;
    }

    .Secciones ul {
        margin-bottom: 20px;
        text-align: center;
    }
    
}

/* ========================================================================= */
/* MENÚ FULL-SCREEN PARA MÓVIL */
/* ========================================================================= */

/* Botón hamburguesa - solo visible en móvil */
.menu-hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    padding: 10px;
    cursor: pointer;
    z-index: 100;
}

/* Full-Screen Menu */
.menu-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #16366d 0%, #0b1c38 100%);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.menu-fullscreen.active {
    display: flex;
}

.close-menu {
    align-self: flex-end;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    padding: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-menu:hover {
    color: #0545da;
}

.menu-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Logo en full-screen */
.fullscreen-logo {
    text-align: center;
    margin-bottom: 20px;
}

.fullscreen-logo img {
    max-width: 200px;
    height: auto;
    filter: brightness(0) invert(1);
}

/* Búsqueda en full-screen */
.fullscreen-search {
    display: flex;
    margin: 20px 0;
    background: white;
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-input-full {
    flex: 1;
    border: none;
    background: none;
    padding: 15px 20px;
    font-size: 1.1em;
    outline: none;
    font-family: "Noto Sans", sans-serif;
}

.search-btn-full {
    background: #0545da;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn-full:hover {
    background: #033099;
}

/* Navegación full-screen */
.fullscreen-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 20px 0;
}

.nav-item {
    color: white;
    text-decoration: none;
    font-size: 1.2em;
    padding: 18px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border-radius: 8px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-item i:first-child {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.accordion-arrow {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

/* Submenús acordeón */
.nav-submenu {
    display: none;
    padding-left: 20px;
    background: rgba(11, 28, 56, 0.5);
    border-radius: 8px;
    margin: 5px 0;
}

.nav-submenu.active {
    display: flex;
    flex-direction: column;
}

.nav-submenu a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.nav-submenu a:last-child {
    border-bottom: none;
}

.nav-submenu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding-left: 25px;
}

.nav-submenu a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Información de contacto */
.contact-info {
    margin-top: 30px;
    color: white;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 25px;
}

.contact-info h4 {
    margin-bottom: 15px;
    color: #0545da;
    font-size: 1.2em;
}

.contact-info p {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1em;
}

/* Redes sociales en full-screen */
.fullscreen-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.fullscreen-social a {
    color: white;
    font-size: 1.8em;
    transition: all 0.3s;
}

.fullscreen-social a:hover {
    transform: translateY(-3px);
}

.fullscreen-social .fa-square-facebook:hover {
    color: #0545da;
}

.fullscreen-social .fa-instagram:hover {
    color: #ff0095;
}

/* ========================================================================= */
/* MEJORAS ESPECÍFICAS PARA PÁGINA DE CATEGORÍA */
/* ========================================================================= */

/* Mejora para el título de categoría */
#titulo-categoria {
    text-align: center;
    margin: 20px 0;
    font-size: 2em;
    color: #16366d;
}

/* Mejora para el contador del carrito */
#valorContador {
    font-size: 0.8em;
    padding: 2px 6px;
    transform: translateX(-8px) translateY(-8px);
}

/* ========================================================================= */
/* MEDIA QUERIES - RESPONSIVE */
/* ========================================================================= */

@media screen and (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Mostrar botón hamburguesa en móvil */
    .menu-hamburger {
        transform: translateX(-5em);
        display: block;
        order: 1;
        z-index: 100;
        position: relative;
    }
    
    /* Ocultar menú original en móvil */
    .navbar .menu {
        display: none;
    }
    
    /* Ocultar barra de búsqueda original en móvil */
    .buscador {
        display: none;
    }
    
    /* Reorganizar barra superior para móvil */
    .barraup {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
        position: relative;
        min-height: 70px;
    }
    
    /* Logo centrado */
    nav img {
        margin: 0;
        width: 140px;
        height: 55px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
    }
    
    /* Carrito a la derecha */
    .carro {
        margin: 0;
        order: 3;
        transform: translateY(-1em);
        position: relative;
        z-index: 100;
    }
    
    /* --- MEJORAS PARA EL CONTENEDOR DE PRODUCTOS --- */
    #titulo-categoria {
        margin-left: 0;
        text-align: center;
        font-size: 1.6em;
        padding: 0 15px;
    }
    
    .contenedor {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 10px;
    }
    
    .contenedorterm {
        width: 100%;
        max-width: 350px;
        margin: 0;
        height: auto;
        min-height: 400px;
    }
    
    .contenedorterm img {
        width: 80%;
        max-width: 200px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    
    /* Botón agregar al carro siempre visible en móvil */
    .agregarcarro {
        opacity: 1;
        pointer-events: auto;
        transform: none;
        margin: 15px auto;
        display: block;
        width: 80%;
        padding: 12px 20px;
        font-size: 1em;
    }
    
    /* Desactivar efectos hover en móvil */
    .contenedorterm:hover {
        transform: none;
        box-shadow: none;
    }
    
    .contenedorterm:hover .agregarcarro {
        transform: none;
        margin-left: auto;
    }
    
    /* --- FOOTER MÓVIL --- */
    footer {
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
    }
    
    .socialmedia {
        padding: 10px 0;
        justify-content: center;
        width: 100%;
    }
}

/* Para desktop - asegurar que el full-screen no interfiera */
@media screen and (min-width: 769px) {
    .menu-fullscreen {
        display: none !important;
    }
    
    .menu-hamburger {
        display: none;
    }
    
    /* Asegurar que la barra de búsqueda original sea visible en desktop */
    .buscador {
        display: flex;
    }
    .contenedor {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 20px !important;
        width: 100% !important;
        flex-direction: row !important;
        align-items: stretch !important;
    }
    
    .contenedorterm {
        flex: 0 0 calc(25% - 40px) !important;
        max-width: calc(25% - 40px) !important;
        margin: 0 !important;
    }
    
    #titulo-categoria {
        margin-left: 4.2em !important;
        text-align: left !important;
    }
}