/* ============================================================
   PÁGINA DE PIEZAS — /piezas
   ============================================================ */

/* Ocultar el navbar flotante del landing en esta página */
.navbar-header { display: none; }

/* ============================================================
   NAVBAR ESTÁTICO DE PIEZAS
   ============================================================ */
.piezas-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
}

/* Zona izquierda fija al ancho del sidebar */
.piezas-navbar__izquierda {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.piezas-navbar__volver {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}

.piezas-navbar__volver:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.piezas-navbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.piezas-navbar__lista {
  flex: 1;
  justify-content: center;
}

/* ============================================================
   LAYOUT: SIDEBAR + CONTENIDO
   ============================================================ */
.piezas-layout {
  display: flex;
  min-height: 100vh;
  background: #000;
  padding-top: 64px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Header del sidebar */
.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar__header-titulo {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}


/* Nav */
.sidebar__nav {
  padding: 0.5rem 0;
}

/* Opción "Todos los productos" */
.sidebar__item-todos {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.5rem 0.75rem;
}

.sidebar__todos-link {
  display: block;
  padding: 0.55rem 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.sidebar__todos-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.sidebar__item-todos--activo .sidebar__todos-link {
  color: #f8a737;
  background: rgba(248, 167, 55, 0.08);
}

/* Ítem de categoría */
.sidebar__item {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Fila de categoría: nombre (link) + chevron (botón) */
.sidebar__cat-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.sidebar__cat-nombre {
  flex: 1;
  display: block;
  padding: 0.7rem 0.5rem 0.7rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.sidebar__cat-nombre:hover {
  color: #fff;
}

.sidebar__cat-nombre--activo {
  color: #f8a737;
}

.sidebar__item--activo .sidebar__cat-nombre {
  color: #f8a737;
}

/* Botón del chevron (solo el icono) */
.sidebar__chevron-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  border-radius: 6px;
  margin-right: 0.4rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.sidebar__chevron-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

/* Chevron */
.sidebar__chevron {
  transition: transform 0.25s ease;
}

.sidebar__item--activo .sidebar__chevron {
  transform: rotate(90deg);
}

/* Subcategorías */
.sidebar__subs {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar__subs--abierto {
  max-height: 400px;
}

.sidebar__sub-link {
  display: block;
  padding: 0.45rem 1rem 0.45rem 1.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  border-left: 2px solid transparent;
  margin-left: 0.5rem;
}

.sidebar__sub-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.03);
  border-left-color: rgba(248,167,55,0.4);
}

.sidebar__sub-link--activo {
  color: #f8a737;
  border-left-color: #f8a737;
}


/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.piezas-main {
  flex: 1;
  padding: 2rem 2.5rem 5rem;
  min-width: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
}

.breadcrumb__link {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb__link:hover { color: rgba(255,255,255,0.7); }

.breadcrumb__sep { color: rgba(255,255,255,0.2); }

.breadcrumb__actual {
  color: rgba(255,255,255,0.65);
}

/* Título */
.piezas-header {
  margin-bottom: 2rem;
}

.piezas-header__titulo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: #ffffff;
  letter-spacing: 2px;
  line-height: 1;
}

.piezas-header__categoria {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #f8a737;
  margin-top: 0.4rem;
}

/* Estado carga / vacío */
.piezas-estado {
  text-align: center;
  padding: 5rem 0;
  color: rgba(255, 255, 255, 0.35);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Grid de productos — 5 columnas en desktop */
#productos-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

@media (max-width: 1200px) {
  #productos-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  #productos-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Botón Ver más */
.btn-ver-mas {
  display: block;
  margin: 2rem auto 0;
  padding: 0.65rem 2.5rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-ver-mas:hover {
  border-color: #f8a737;
  color: #f8a737;
  background: rgba(248,167,55,0.05);
}

#productos-grid .producto-card {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

#productos-grid .producto-card:hover {
  border-color: rgba(248, 167, 55, 0.35);
  box-shadow: 0 8px 28px rgba(245, 129, 52, 0.12);
}

#productos-grid .producto-card__nombre { color: #ffffff; }

#productos-grid .producto-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.4rem;
}

#productos-grid .producto-card__precio {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #22C55E;
  letter-spacing: 0.3px;
}

#productos-grid .producto-card__cantidad {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #ffffff;
}

#productos-grid .producto-card__cantidad-q {
  color: #f8a737;
  font-weight: 600;
}
#productos-grid .producto-card__imagen-wrapper {
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
}

/* ============================================================
   MODAL DE PRODUCTO
   ============================================================ */
.modal-producto-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: mp-fade-in 0.25s ease;
}

.modal-producto-overlay--salir {
  animation: mp-fade-out 0.3s ease forwards;
}

@keyframes mp-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes mp-fade-out { from { opacity: 1; } to { opacity: 0; } }

.modal-producto {
  background: #111;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  animation: mp-slide-in 0.25s ease;
}

@keyframes mp-slide-in {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   ANIMACIONES DE BOTONES EN EL MODAL
   ============================================================ */

/* Estructura interna */
.modal-producto__main {
  display: flex;
  flex-direction: row;
}

/* Botón cerrar */
.modal-producto__cerrar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.25s ease;
}
.modal-producto__cerrar:hover {
  background: rgba(255,255,255,0.18);
  transform: rotate(90deg);
}
.modal-producto__cerrar:active { transform: rotate(90deg) scale(0.88); }

/* Galería izquierda */
.modal-producto__galeria {
  width: 320px;
  flex-shrink: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-right: 1px solid rgba(255,255,255,0.07);
}

.modal-producto__img-principal-wrapper {
  width: 100%;
  aspect-ratio: 1;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-producto__img-principal {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
}

.modal-producto__thumbnails {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-producto__thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-producto__thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(248, 167, 55, 0.2);
}

.modal-producto__thumb:active {
  transform: scale(0.92);
}

.modal-producto__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.modal-producto__thumb--activo {
  border-color: #f8a737;
}

/* Info derecha */
.modal-producto__info {
  flex: 1;
  padding: 1.8rem 1.8rem 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.modal-producto__categoria {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #f8a737;
}

.modal-producto__nombre {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.05;
}

.modal-producto__precio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-producto__precio {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #22C55E;
}

.modal-producto__cantidad {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
}

.modal-producto__cantidad-q {
  color: #f8a737;
  font-weight: 700;
}

/* Fila de modelos compatibles */
.modal-producto__modelos-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-producto__modelos-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  padding-top: 2px;
}

.modal-producto__modelos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modal-producto__modelo {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

/* Tabs */
.modal-producto__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-top: 0.25rem;
}

.modal-producto__tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.4);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.modal-producto__tab:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.modal-producto__tab:active { transform: scale(0.95); }

.modal-producto__tab--activo {
  color: #f8a737;
  border-bottom-color: #f8a737;
}

.modal-producto__tab-contenido { flex: 1; }

.modal-producto__descripcion {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin-top: 0.5rem;
}

.modal-producto__fotos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.modal-producto__fotos-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 0.5rem;
}

/* Botón consultar */
.modal-producto__btn-contacto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
  align-self: center;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(90deg, #f58134, #f8a737);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  width: fit-content;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal-producto__btn-contacto:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 129, 52, 0.35);
}

.modal-producto__btn-contacto:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

/* ============================================================
   PRODUCTOS RELACIONADOS (dentro del modal)
   ============================================================ */
.modal-producto__relacionados {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 1.5rem;
}

.modal-producto__relacionados-titulo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
}

.modal-producto__relacionados-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.rel-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.rel-card:hover {
  border-color: rgba(248,167,55,0.4);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245,129,52,0.12);
}

.rel-card:active { transform: scale(0.97); }

.rel-card__img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rel-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

.rel-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: #1e1e2e;
}

.rel-card__nombre {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  padding: 0.5rem 0.6rem 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rel-card__precio {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #22C55E;
  padding: 0 0.6rem 0.6rem;
}

/* ============================================================
   ZOOM DE IMAGEN
   ============================================================ */
.modal-zoom {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  transition: background 0.25s ease;
}

.modal-zoom--visible {
  background: rgba(0, 0, 0, 0.92);
}

.modal-zoom__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.modal-zoom--visible .modal-zoom__img {
  opacity: 1;
  transform: scale(1);
}

/* Cursor en imagen principal para indicar que es clicable */
.modal-producto__img-principal {
  cursor: zoom-in;
}

/* Flechas prev/next — ocultas en desktop */
.modal-producto__flecha {
  display: none;
}

/* ============================================================
   MODAL — RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 640px) {
  /* Overlay: centrado en pantalla */
  .modal-producto-overlay {
    padding: 1rem;
    align-items: center;
  }

  .modal-producto {
    border-radius: 16px;
    max-height: 90vh;
    max-width: 100%;
  }

  /* Galería arriba, info abajo */
  .modal-producto__main {
    flex-direction: column;
  }

  /* Galería: columna centrada, ancho completo */
  .modal-producto__galeria {
    width: 100%;
    padding: 1rem 1rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  /* Imagen principal: ocupa todo el ancho, posición relativa para las flechas */
  .modal-producto__img-principal-wrapper {
    width: 100%;
    position: relative;
  }

  /* Flechas: visibles en mobile, absolutas sobre la imagen */
  .modal-producto__flecha {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s ease;
  }

  .modal-producto__flecha:hover  { background: rgba(0, 0, 0, 0.8); }
  .modal-producto__flecha:active { transform: translateY(-50%) scale(0.88); }

  .modal-producto__flecha--prev { left: 0.6rem; }
  .modal-producto__flecha--next { right: 0.6rem; }

  /* Thumbnails: fila centrada debajo de la imagen */
  .modal-producto__thumbnails {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .modal-producto__thumb {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
  }

  /* Info: padding ajustado */
  .modal-producto__info {
    padding: 1rem 1rem 1.2rem;
    gap: 0.6rem;
  }

  .modal-producto__nombre {
    font-size: 1.55rem;
  }

  /* Botón contacto: ancho completo */
  .modal-producto__btn-contacto {
    width: 100%;
    justify-content: center;
  }

  /* Productos relacionados: 2 columnas */
  .modal-producto__relacionados-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-producto__relacionados {
    padding: 1rem;
  }
}

/* ============================================================
   ELEMENTOS SOLO MOBILE — ocultos en desktop por defecto
   ============================================================ */
.sidebar__cerrar        { display: none; }
.sidebar-backdrop       { display: none; }
.busqueda-piezas__filtro-btn { display: none; }

/* ============================================================
   RESPONSIVE MOBILE — ≤ 768 px
   ============================================================ */
@media (max-width: 768px) {

  /* --- Navbar: de fixed a sticky, más compacto --- */
  .piezas-navbar {
    position: sticky;
    height: 56px;
    padding: 0 1rem;
  }

  .piezas-navbar__izquierda {
    width: auto;
  }

  /* Ocultar links centrales */
  .piezas-navbar__lista {
    display: none !important;
  }

  /* --- Layout: sin padding-top (navbar ya está en el flujo) --- */
  .piezas-layout {
    flex-direction: column;
    padding-top: 0;
  }

  /* --- Sidebar: drawer desde la izquierda --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 75vw;
    max-width: 320px;
    height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    overflow-y: auto;
  }

  .sidebar--abierto {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.6);
  }

  /* --- Backdrop con blur --- */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.32s ease;
  }

  .sidebar-backdrop--visible {
    opacity: 1;
    pointer-events: all;
  }

  /* --- Botón cerrar dentro del sidebar --- */
  .sidebar__cerrar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .sidebar__cerrar:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
  }

  /* --- Barra de búsqueda: sticky bajo el navbar --- */
  .busqueda-piezas {
    position: sticky;
    top: 56px;
    z-index: 90;
    background: #0a0a0a;
    padding: 0.65rem 1rem;
    margin: -1.5rem -1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    gap: 0.5rem;
  }

  /* --- Botón "Categorías" visible en mobile --- */
  .busqueda-piezas__filtro-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.58rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.75);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .busqueda-piezas__filtro-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
  }

  /* --- Contenido principal --- */
  .piezas-main {
    padding: 1.5rem 1rem 4rem;
  }
}

/* ============================================================
   BARRA DE BÚSQUEDA DE PIEZAS
   ============================================================ */
.busqueda-piezas {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* Campo genérico */
.busqueda-piezas__campo {
  position: relative;
  display: flex;
  align-items: center;
}

/* Campo de texto ocupa el espacio restante */
.busqueda-piezas__campo--texto {
  flex: 1;
  min-width: 200px;
}

/* Ícono decorativo dentro del campo */
.busqueda-piezas__icono {
  position: absolute;
  left: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  flex-shrink: 0;
}

.busqueda-piezas__icono--select {
  left: 0.7rem;
}

/* Input de texto */
.busqueda-piezas__input {
  width: 100%;
  padding: 0.62rem 0.9rem 0.62rem 2.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.busqueda-piezas__input:focus {
  border-color: #FF6B00;
  background: rgba(255, 107, 0, 0.04);
}

.busqueda-piezas__input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

/* Select de modelo y sucursal */
.busqueda-piezas__select {
  padding: 0.62rem 2.2rem 0.62rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.35)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.9rem;
  transition: border-color 0.2s ease;
  min-width: 155px;
}

.busqueda-piezas__select--icono {
  padding-left: 2.3rem;
}

.busqueda-piezas__select:focus {
  border-color: #FF6B00;
  color: #fff;
}

.busqueda-piezas__select option,
.busqueda-piezas__select optgroup {
  background: #111;
  color: #fff;
}

/* Botón limpiar filtros */
.busqueda-piezas__limpiar {
  padding: 0.6rem 0.9rem;
  background: none;
  border: 1px solid rgba(255, 107, 0, 0.35);
  border-radius: 9px;
  color: #FF6B00;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.busqueda-piezas__limpiar:hover {
  background: rgba(255, 107, 0, 0.08);
  border-color: #FF6B00;
}

/* Responsive */
@media (max-width: 640px) {
  .busqueda-piezas {
    gap: 0.5rem;
  }

  .busqueda-piezas__campo--texto {
    min-width: 100%;
    order: -1;
  }

  .busqueda-piezas__select {
    flex: 1;
    min-width: 0;
  }
}
