* { 
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #fdfdfd;
  color: #212529;
}

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

/* ===================== */
/* HEADER Y MENÚ SUPERIOR */
/* ===================== */

.menu-superior {
  background-color: #ffffff;
  padding: 15px 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.contenedor-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
  position: relative;
}

.logo img {
  height: 40px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  transition: all 0.3s ease-in-out;
}

.nav-links a {
  color: #0D6EFD;
  font-weight: 500;
  padding: 10px 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #0D6EFD;
}

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

#icono-carrito {
  cursor: pointer;
  position: relative;
}

#icono-carrito i {
  font-size: 1.3em;
  color: #0D6EFD;
}

#cantidad-carrito {
  background: #20C997;
  color: white;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 50%;
  position: absolute;
  top: -8px;
  right: -10px;
}

/* ===================== */
/* CATEGORÍAS AJUSTADAS */
/* ===================== */

.categorias {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 30px 20px;
  gap: 20px;
  background-color: #f1f3f5;
}

.categoria {
  background: linear-gradient(135deg, #0D6EFD, #20C997);
  color: white;
  padding: 12px;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  font-size: 0.85em;
  font-weight: 500;
}

.categoria:hover {
  transform: translateY(-4px) scale(1.03);
  background: linear-gradient(135deg, #0A58CA, #159e82);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.categoria i {
  font-size: 1.8em;
  margin-bottom: 8px;
}

/* ===================== */
/* CATÁLOGO */
/* ===================== */

.catalogo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 30px;
  max-width: 1200px;
  margin: auto;
}

.tarjeta-producto {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tarjeta-producto img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
}

.tarjeta-producto .contenido {
  padding: 15px;
}

.tarjeta-producto h4 {
  font-size: 1.1em;
  margin-bottom: 8px;
}

.tarjeta-producto .precio {
  color: #0D6EFD;
  font-weight: bold;
  margin: 10px 0;
}

.tarjeta-producto .descripcion {
  font-size: 0.9em;
  color: #495057;
  margin-bottom: 10px;
}

.tarjeta-producto button {
  background: #20C997;
  color: white;
  border: none;
  padding: 10px;
  margin-top: 5px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.tarjeta-producto button:hover {
  background: #159e82;
}

/* ===================== */
/* VISOR DE IMÁGENES */
/* ===================== */

.visor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 10, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  display: none;
}

.visor img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
  box-shadow: 0 0 10px #000;
}

.visor button {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  padding: 10px;
  font-size: 1.5em;
  cursor: pointer;
  color: black;
}

.visor .cerrar {
  top: 10px;
  right: 20px;
}

.visor .anterior {
  left: 20px;
}

.visor .siguiente {
  right: 20px;
}

/* ===================== */
/* CARRITO DE COMPRAS MODERNO */
/* ===================== */

.carrito {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #fff;
  border-radius: 14px;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  border: 1px solid #dee2e6;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.carrito.oculto {
  display: none;
}

.carrito-header {
  background: linear-gradient(135deg, #0D6EFD, #20C997);
  color: #fff;
  padding: 12px 16px;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  font-weight: 600;
  font-size: 1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#carrito-items {
  padding: 15px;
  flex-grow: 1;
  overflow-y: auto;
}

.carrito-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.95em;
  color: #343a40;
}

.carrito-item span {
  margin: 0 5px;
  flex-shrink: 0;
}

.carrito-footer {
  padding: 15px;
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carrito-footer button {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

.carrito-footer button:hover {
  background: #218838;
}

.envio-gratis-msg {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 10px;
  font-size: 0.9em;
  border-radius: 8px;
  text-align: center;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================== */
/* RESPONSIVE MENÚ Y CATEGORÍAS */
/* ===================== */

@media (max-width: 768px) {
  .contenedor-menu {
    position: relative;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }

  .nav-links.mostrar {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links a {
    text-align: center;
    padding: 12px;
    border-top: 1px solid #ddd;
    color: #0D6EFD;
  }

  .menu-toggle {
    display: block;
  }

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

  .categorias {
    gap: 12px;
    padding: 20px 10px;
  }

  .categoria {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    padding: 8px;
    font-size: 0.75em;
  }

  .categoria i {
    font-size: 1.4em;
    margin-bottom: 4px;
  }

  .carrito {
    width: 90%;
    right: 5%;
    bottom: 10px;
  }
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }

  .acciones {
    display: flex;
  }

  .nav-links {
    display: flex !important;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
  }
}
/**estilo envio gratis**/
.envio-gratis {
  color: #28a745;
  font-weight: bold;
  margin-top: 10px;
  font-size: 1rem;
}
.oculto {
  display: none;
}
/* ===================== */
/* BUSCADOR DE PRODUCTOS */
/* ===================== */

.busqueda-fija {
  position: sticky;
  top: 70px; /* debajo del menú */
  background: #ffffff;
  padding: 10px 20px;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  justify-content: center;
}

.busqueda-fija input {
  width: 100%;
  max-width: 500px;
  padding: 10px 14px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 1em;
  outline: none;
  transition: box-shadow 0.2s;
}

.busqueda-fija input:focus {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
  border-color: #0D6EFD;
}

@media (max-width: 768px) {
  .busqueda-fija {
    padding: 8px 12px;
  }

  .busqueda-fija input {
    font-size: 0.95em;
  }
}
/**estilo envio gratis**/
.envio-gratisp {
  background-color: #28a745;
  color: white;
  padding: 4px 8px;
  font-size: 0.85em;
  border-radius: 5px;
  margin: 5px 0;
  display: inline-block;
}
