/* ---- style.css mayorista (basado en tienda) ---- */
:root {
  --celeste: #00BFFF;
  --azul: #292b4a;
  --rojo: #FF6347;
  --rojo2: #8e201c;
  --verde: #25D366;
  --fondomenu: #1a1a1a;
  --sub: #2a2a2a;
  --menu: #333;
  --dorado: #f0b429;
}
*:focus { outline: none; }
button, a, input, select { outline: none; }
* { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  display: flex;
  font-family: "Segoe UI", sans-serif;
  background: #f2f4f8;
}

/* Tag mayorista */
.tag-mayorista {
  font-size: 0.55em;
  background: var(--dorado);
  color: #1a1a1a;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: bold;
  vertical-align: middle;
  letter-spacing: 1px;
}

/* Sidebar */
#sidebar {
  width: 280px;
  min-width: 280px;
  background-color: var(--fondomenu);
  color: white;
  height: 100vh;
  padding: 10px;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: scroll;
}
#sidebar h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-top: 0px;
  border-bottom: 1px solid #444;
  padding-bottom: 12px;
  margin-bottom: 10px;
}
#menu {
  display: flex;
  flex-direction: column;
}
#ver-todos {
  margin: 0;
  background-color: var(--menu);
  color: var(--celeste);
  padding: 10px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border: 2px solid var(--celeste);
  border-radius: 10px;
}

.label-filtros {
  margin: 10px 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
}

/* Botones filtros especiales */
.btn-filtro-especial {
  display: block;
  width: 100%;
  text-align: left;
  background-color: var(--menu);
  color: var(--dorado);
  padding: 9px 12px;
  border: none;
  border-bottom: 1px solid #444;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: background 0.2s;
}
.btn-filtro-especial:hover,
.btn-filtro-especial.activo {
  background-color: #444;
  color: white;
}

.borde-extra {
  margin-top: 10px;
  height: 1px;
  background-color: #444;
}

/* Menu Categoria y flecha */
.menu-completo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #444;
  width: 102%;
  box-sizing: border-box;
}
.menu-categoria {
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  padding: 10px;
  display: block;
  transition: background 0.2s ease;
  width: 90%;
}
.menu-categoria:hover {
  background-color: var(--menu);
  border-radius: 4px;
}
.menu-subcategoria {
  font-size: 14px;
  color: #e0e0e0;
  display: block;
  transition: background 0.2s ease;
}
.menu-subcategoria:hover {
  background-color: var(--sub);
  border-radius: 4px;
}
#menu-categorias, #menu-filtros {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
#menu-categorias a { text-decoration: none; cursor: pointer; }
.botonflecha { font-size: 18px; }
.submenu { margin-left: 0px; display: none; }
.active .submenu { display: block; }

/* Barra búsqueda */
#busqueda-filtros {
  position: fixed;
  top: 0;
  right: 0;
  padding: 10px;
  background: #fff;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-bottom-left-radius: 10px;
}

main {
  flex-grow: 1;
  padding: 0px 12px 0px 10px;
  margin-left: 280px;
}
h2 {
  color: var(--celeste);
  border-bottom: 2px solid #ccc;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
h3 {
  margin-top: 8px;
  margin-bottom: 0px;
  color: #444;
}

/* Badge mayorista en precio */
.precio-mayorista-label {
  font-size: 10px;
  background: var(--dorado);
  color: #1a1a1a;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: bold;
  margin-left: 4px;
  vertical-align: 5%;
}

/* Grid */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 15px;
}
.producto {
  margin-bottom: auto;
  background: white;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.producto:hover { transform: scale(1.02); }
.producto img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}
.insignias-arriba {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -1.2em 0em 0em;
}
.insignias-abajo {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2em;
  margin: -1.5em 0 0.4em;
}
.insignia-texto {
  background-color: gray;
  padding: 0.2em 0.6em;
  font-size: 0.75em;
  border-radius: 0.5em;
  color: white;
  white-space: nowrap;
  font-weight: bold;
  text-align: center;
}
.insignia-texto.nuevo { background-color: var(--celeste); }

.link-producto {
  text-decoration: none;
  color: var(--fondomenu);
}
.producto h4 {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4rem;
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  margin: 0px 0 0px;
}
.titulo-producto {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 4.8em;
  line-height: 1.6em;
}
.producto p { color: white; margin: 2px 0; font-size: 14px; }
.stock {
  display: flex;
  justify-content: space-between;
  padding: 5px 10%;
  border: 2px solid var(--dorado);
  border-radius: 10px;
  background-color: var(--menu);
}
.sin-stock { opacity: 0.3; }
.sin-stock .precio { display: none; }
.stock-left { color: var(--dorado); font-weight: bolder; }

.boton-comprar, .boton-comprar2 {
  display: flex;
  justify-content: center;
  max-width: 500px;
  margin-top: 4px;
  padding: 3px;
  background-color: var(--verde);
  color: white;
  text-align: center;
  border-radius: 10px;
  text-decoration: none;
  font-size: 18px;
  align-items: normal;
}
.boton-comprar i, .boton-comprar2 i { font-size: 1.5rem; padding-left: 10px; }

/* Detalle producto */
.producto-detalle img {
  max-width: 100%;
  width: 500px;
  height: auto;
  margin-top: 20px;
}
.boton-accion {
  display: flex;
  justify-content: left;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 10px;
}
.boton-atras, .boton-compartir {
  text-align: center;
  font-size: 18px;
  color: #ccc;
  border: 2px solid var(--dorado);
  border-radius: 10px;
  background-color: var(--menu);
  padding: 3px;
  width: 100%;
  max-width: 250px;
  cursor: pointer;
}
.boton-atras i { display: inline; justify-content: center; font-size: 1.2rem; padding-right: 10px; }
.boton-compartir i { display: inline; justify-content: center; font-size: 1.2rem; padding-left: 10px; }

.producto { position: relative; }
.stock-e-insignias {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

/* ---- Responsive ---- */
@media (min-width: 601px) {
  #topbar-movil {
    display: none;
  }
}

@media (max-width: 600px) {
   #sidebar.oculto {
    transform: translateX(-100%);
  }
  #topbar-movil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    background-color: #1a1a1a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1001;
    border-bottom: 1px solid #444;
    box-sizing: border-box;
  }
  #topbar-movil h1 { font-size: 22px; margin: 0; }
  .menu-toggle { background: none; border: none; color: white; font-size: 30px; cursor: pointer; }

  #busqueda-filtros {
    top: 0; left: 0; right: 0; width: 100%;
    margin-top: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  #busqueda-filtros.visible { transform: translateY(60px); }
  #toggle-filtros { background: none; border: none; color: white; font-size: 28px; cursor: pointer; }
  .topbar-izquierda { display: flex; align-items: center; justify-content: center; }

  #sidebar {
    transition: transform 0.3s ease-in-out;
    width: 100vw;
    height: 94%;
    min-width: 100vw;
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 999;
  }
  #sidebar h1 { display: none; }
  #ver-todos { font-size: 20px; }
  .menu-categoria { font-size: 20px; }
  .botonflecha { font-size: 30px; }
  .menu-subcategoria { margin: 10px; font-size: 15px; }
  .submenu { font-size: 20px; }
  .btn-filtro-especial { font-size: 18px; padding: 12px; }

  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(40vw, 1fr));
    gap: 15px;
  }
  .producto h4 { margin-top: -8px; height: 4.6rem; }
  .stock { padding: 6px 8%; }
  .producto img { width: 100%; height: 36.67vw; }

  main {
    margin-top: 50px;
    margin-right: 5px;
    margin-left: 5px;
    padding: 0px;
  }
}

@media (max-width: 395px) {
  main { margin-right: 5px; margin-left: 5px; flex-grow: 1; padding: 0px; }
  .stock { padding: 6px 5%; }
}
@media (max-width: 370px) {
  .stock { padding: 5px 2%; }
}
@media (max-width: 335px) {
  .stock { display: flex; flex-direction: column; text-align: center; padding: 5px 1%; }
}
