body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  background-color: #ffffff;
}

header {
  background-color: white;
  color: #333;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.acciones{
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav {
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  top: 0;
  color: #daa520;
  border-bottom: 2px solid #daa520;
  background-color: white;
  z-index: 1000;
}

.menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0px;
}

section {
  padding: 2rem;
  align-items: center;
}

.menu a {
  margin: 0 15px;
  color: rgb(0, 0, 0);
  text-decoration: none;
  font-weight: bold;
}

.icon-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.count-product {
  position: absolute;
  top: 7px;
  right: 1px;
  background-color: red;
  color: white;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
}

.icon-login {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  cursor: pointer;
}

.cart-svg {
  width: 24px;
  height: 24px;
  stroke: rgb(0, 0, 0);
  
}
.login-svg {
  width: 24px;
  height: 24px;
  stroke: rgb(0, 0, 0);
}

.texto-body{
    text-align: center;
}


.catalogo {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  line-height: 2px;
}

.producto {
  padding: 10px;
  width: 300px;
  text-align: left;
  border-radius: 10px;
  background: white;
}

.img-producto {
  border: 1px solid gold;
  width: 300px;
  height: 300px;
  border-radius: 10px;
}


.contenedor-principal {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.filtros {
  width: 220px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  height: fit-content;
}

.catalogo {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}



.carrito-slide {
  position: fixed;
  top: 0;
  right: -100%;
  width: 350px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.3);
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.carrito-slide.visible {
  right: 0;
}

.carrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #ddd;
}

 .producto h3 {
    margin: 8px 0 4px;
    font-size: 20px;
    line-height: 1.3;             /* más espacio entre líneas */
    word-wrap: break-word;        /* corta palabras largas */
    overflow-wrap: break-word;
    white-space: normal; 
    
 }

.carrito-header h3 {
  margin: 0;
}

#cerrar-carrito {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.carrito-contenido {
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}

.item-carrito {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}
.usuario {
  display: flex;
  align-items: center;
  gap: 10px; /* espacio entre íconos y texto */
}



.nombre-usuario-contenedor {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 500;
  color: #333;
}

.bienvenida {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: #555;
}

.menu-desplegable {
  display: none;
  position: absolute;
  top: 60px;
  right: 60px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  flex-direction: column;
  padding: 10px 0;
  min-width: 150px;
}

.menu-desplegable a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
}

.menu-desplegable a:hover {
  background-color: #f0f0f0;
}

.usuario {
  position: relative; /* Necesario para posicionar el menú */
}

/* Estilos base para aside (desktop por defecto) */
.filtros {
  width: 260px;
  padding: 1rem;
  background: #fff;
  border-right: 1px solid #e6e6e6;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  position: relative;
  transition: transform .28s ease, opacity .28s ease;
}

/* Cuando esté cerrado en desktop lo escondemos un poco (opcional) */
.filtros[aria-hidden="true"] {
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
}

.cerrar-filtros {
    display: none;
}



@media (max-width: 768px) {
    /* Botón cerrar (visible solo en móvil) */
  .cerrar-filtros {
    display: block;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333; /* color visible */
    z-index: 1300; /* encima de todo dentro del panel */
  }
  /* Header compacto */
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
  }

  .marca {
    flex: 1;
  }

  /* Menú en una sola línea scrollable si no entra */
  .menu {
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    width: 100%;
  }

  .acciones {
    flex: 1;
    justify-content: flex-end;
    gap: 10px;
  }

  /* Ajustar iconos */
  .icon-cart, .icon-login {
    width: 30px;
    height: 30px;
  }

  .cart-svg, .login-svg {
    width: 20px;
    height: 20px;
  }

  /* Hero */
  .hero {
    flex-direction: column;
    padding: 2rem;
    gap: 20px;
    text-align: center;
  }

  .hero img {
    width: 100%;
    max-width: 280px;
  }

  /* Productos */
  .img-producto {
    width: 100%;
    max-width: 220px;
    height: auto;
  }

  /* Carrito en móvil ocupa todo */
  .carrito-slide {
    width: 100%;
  }
}


@media (max-width: 480px) {
  .menu a {
    font-size: 14px;
    margin: 5px 0;
  }

  h2 {
    font-size: 28px;
  }

  .btn-comprar {
    padding: 10px 16px;
    font-size: 14px;
  }
}






















/* ===== LAYOUT: Desktop / Tablet (>= 769px) ===== */
@media (min-width: 769px) {
  .contenedor-principal {
    display: grid;
    grid-template-columns: 260px 1fr; /* filtros a la izquierda, catálogo a la derecha */
    gap: 24px;
    align-items: start;
    padding: 20px;
  }

  .filtros {
    display: block;
    position: static;
    width: auto;
    height: auto;
    box-shadow: none;
    transform: none;
    transition: none;
    padding: 0;
    background: transparent;
  }

  /* Oculta el botón de filtros en desktop */
  .btn-filtros { display: none; }
}

/* ===== CORRECCIÓN: móvil — filtros OFFCANVAS + catálogo 2 columnas llenando ancho ===== */
@media (max-width: 768px) {

  /* Asegurar que el contenedor principal no rompa el flujo */
  .contenedor-principal {
    display: block;
    padding: 8px;
    box-sizing: border-box;
  }

  /* Botón hamburguesa visible en móvil (arriba a la izquierda) */
  .btn-filtros {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 12px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    z-index: 1100;
    position: relative; /* no sticky (evita que empuje) */
  }

  /* Off-canvas filtros: fuera del flujo y encima del contenido */
   .filtros {
    position: fixed;
    inset: 0;             /* top:0; right:0; bottom:0; left:0; */
    width: 100%;
    height: 100%;
    z-index: 1200;
    transform: translateY(100%); /* fuera de pantalla abajo */
    background: #fff;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    opacity: 0;
    transition: transform .28s ease, opacity .28s ease;
  }
  /* Cuando esté abierto */
  .filtros.open {
    transform: translateY(0);
    opacity: 1;
  }

  /* Detrás del overlay: un backdrop semitransparente */
  .filtros-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1100;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
  }
  .filtros-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* Ocultar el aside inline (sidebar) en mobile cuando no abierto */
  .contenedor-principal {
    display: block; /* tu layout se mantiene, pero aside está overlay */
  }

  .filtros.abierto { left: 0; }

  /* Overlay cuando el panel está abierto */
  .filtros-overlay {
    display: none;
  }
  .filtros-overlay.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1240;
  }

  /* CATALOGO: ocupando TODO el ancho disponible y con 2 columnas */
  .catalogo {
    display: flex;
    flex-wrap: wrap;
    gap: 0; /* los márgenes van en .producto */
    width: 100%;
  }





  .producto {
    width: 50%; /* mitad exacta */
    padding: 5px;
    box-sizing: border-box;
    text-align: center;
  }

  .producto img.img-producto {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
  }

  .producto h3 {
    margin: 8px 0 4px;
    font-size: 0.95rem;
    line-height: 1.3;             /* más espacio entre líneas */
    word-wrap: break-word;        /* corta palabras largas */
    overflow-wrap: break-word;
    white-space: normal; 
    

  }

  .producto p {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #444;
  }
  .producto h3 {
    margin: 8px 0 4px;
    font-size: 0.95rem;
    white-space: normal; /* permite saltos de línea */
    word-break: break-word; /* corta si una palabra es muy larga */
    line-height: 1.2; /* más compacto */
    max-height: 2.4em; /* limita a 2 líneas */
    overflow: hidden; /* oculta lo que exceda */
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

}



