.cat-layout {
  display: flex;
  gap: 24px;
  padding: 20px;
  background: #f6f6f6;
}

.cat-sidebar {
  width: 260px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}

.cat-sidebar-title {
  font-size: 16px;
  margin-bottom: 14px;
  color: #360073;
}

.cat-filter-group {
  margin-bottom: 16px;
  font-size: 13px;
}

.cat-filter-group strong {
  display: block;
  margin-bottom: 6px;
}

.cat-filter-group label {
  display: block;
  margin-bottom: 4px;
}

.cat-filter-price {
  display: flex;
  gap: 6px;
  font-size: 16px;
}

.cat-filter-price input {
  width: 100%;
  padding: 5px;
  font-size: 16px;
}

.cat-content {
  flex: 1;
}

.cat-btn-filters {
  display: none;
  width: 100%;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid #360073;
  background: #fff;
  color: #360073;
  border-radius: 6px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.cat-producto {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px;
  transition: box-shadow 0.3s ease;
  position: relative;
}

.cat-producto:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.cat-producto-img img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 6px;
}

.cat-producto-info {
  text-align: center;
}

.cat-badge-custom {
  position: absolute;
  top: 10px;
  left: 10px;

  padding: 3px 3px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 4px;
  color: #fff;
  z-index: 2;

  max-width: 90px;    
  text-align: center;      
  white-space: normal;      
  word-break: break-word;    
  line-height: 1.2;
}

.cat-badge-custom {
  display: -webkit-box;
  -webkit-line-clamp: 2;    
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mayorista-msg {
  font-size: 11px;
  margin-top: 4px;
  color: #8b0000;
  font-weight: 500;
  text-decoration: none;
  display: block;  
}

.mayorista-msg:hover {
  text-decoration: underline;
}

.mayorista-msg.no-click {
  color: #8b0000;
  cursor: default;
  text-decoration: none;
}

.mayorista-msg.no-click:hover {
  text-decoration: none;
}

.cat-filter-actions {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.cat-btn-aplicar {
  background: #360073;
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
}

.cat-btn-limpiar {
  font-size: 13px;
  color: #666;
  text-decoration: none;
}

.cat-producto-desc {
  font-size: 13px;
  font-weight: 400;
  color: #360073;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-producto-rating {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.cat-producto-rating .fas,
.cat-producto-rating .fas.fa-star-half-alt {
  font-size: 13px;
  color: #f5a623;
}

.cat-producto-rating .far {
  font-size: 13px;
  color: #ddd;
}

.cat-producto-precio {
  margin: 10px 0;
}

.cat-producto-link-img,
.cat-producto-link-title {
  text-decoration: none;
  color: inherit;
  display: block;
}

.cat-btn-cart:disabled,
.cat-btn-minus:disabled,
.cat-btn-plus:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cat-agotado {
  color: #b30000;
  font-weight: 600;
  margin-top: 6px;
}

.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #2e7d32;
}

.toast.warning {
  background: #c62828;
}

.cat-precio-normal {
  text-decoration: line-through;
  color: #888;
  margin-right: 8px;
  font-size: 13px;
}

.cat-precio-oferta {
  color: #360073;
  font-weight: 550;
  font-size: 17px;
}

.cat-precio-mayorista-text {
  display: block;
  font-size: 12px;
  color: #A8324A;
  margin-top: 6px;
}

.cat-precio-mayorista {
  display: block;
  font-size: 20px;
  font-weight: 550;
  color: red;
  margin-top: 2px;
}

.cat-liquidacion-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.cat-badge-liquidacion {
  background: #e00000;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

.cat-liquidacion-precios {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.cat-precio-normal-liquidacion {
  text-decoration: line-through;
  opacity: .6;
  font-size: 13px;
}

.cat-precio-liquidacion {
  font-size: 18px;
  font-weight: 800;
  color: #e00000;
}


.cat-producto-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cat-btn-minus,
.cat-btn-plus {
  width: 28px;
  height: 26px;
  border: 1px solid #360073;
  background: #fff;
  color: #360073;
  font-size: 18px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 2px;
}

.cat-btn-minus:hover,
.cat-btn-plus:hover {
  background: #360073;
  color: #fff;
}

.cat-cantidad {
  width: 30px;
  height: 20px;
  font-size: 16px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.cat-cantidad::-webkit-inner-spin-button,
.cat-cantidad::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cat-cantidad[type=number] {
  -moz-appearance: textfield;
}

.cat-btn-cart {
  border: none;
  background: #360073;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-btn-cart:hover {
  background: #4a0099;
}

.cat-cart-ico {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.btn-favorito {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.btn-favorito i {
  font-size: 18px;
  color: #360073;
}

.btn-favorito .fas {
  color: #e53935;
}

.cat-paginador {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0 10px;
  flex-wrap: wrap;
}

.cat-paginador a {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #360073;
}

.cat-paginador a.active {
  background: #360073;
  color: #fff;
}

/*arriba*/
.cat-hero {
  width: 95%;
  max-height: 160px;
  margin: 20px auto 2px auto;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.cat-hero-image {
  position: absolute;
  inset: 0;
}

.cat-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-hero-content {
  position: relative;
  z-index: 2;
  max-width: 55%;
  padding: 25px 50px;
  box-sizing: border-box;
}

.cat-categorias {
  margin-top: 0;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

.cat-categorias {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cat-categorias::-webkit-scrollbar {
  display: none;
}


.cat-categoria-item {
  flex: 0 0 auto;
  width: 280px;
  height: 93px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}

.cat-categoria-circle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  z-index: 3;
}

.cat-categoria-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-categoria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-categoria-item span {
  position: absolute;
  top: 30px;
  left: 20px;
  z-index: 2;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  max-width: 60%;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}


.cat-breadcrumb {
  width: 100%;
  padding: 18px 20px 0;
  font-size: 13px;
}

.cat-breadcrumb ol {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.cat-producto-actions {
  position: relative;
}

.cat-cantidad-msg {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.cat-breadcrumb a {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #360073;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.cat-breadcrumb a:hover {
  opacity: 0.7;
}

.breadcrumb-home {
  width: 14px;
  height: 14px;
  fill: #360073;
}

.breadcrumb-separator {
  color: #bbb;
  font-size: 14px;
  margin: 0 2px;
}

.breadcrumb-current {
  color: #111;
  font-weight: 600;
}


.cat-hero-content h1 {
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 12px;
  margin-top: 2px;
}

.cat-hero-content p {
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
}

.cat-rating-count {
  font-size: 11px;
}

/*flechas*/
.cat-categorias-container {
  position: relative;
}

.cat-resultados-info {
  font-size: 14px;
  color: #666;
  margin: 10px 0 15px;
}
.cat-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;

  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  font-size: 26px;
  line-height: 1;
}

.cat-arrow.left {
  left: 6px;
}

.cat-arrow.right {
  right: 6px;
}


.cat-sidebar-close {
  display: none;
}

.cat-section-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  margin: 20px 0 12px;
}

.cat-section-title-text {
  grid-column: 2;
  justify-self: center;
  font-size: 20px;
  font-weight: 600;
  color: #360073;
}

.cat-sort-select {
  grid-column: 3;
  justify-self: end;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #360073;
  cursor: pointer;
}



@media (max-width: 768px) {

  /* layout normal */
  .cat-layout {
    flex-direction: column;
    padding: 10px;
  }

  /* ===== OVERLAY ===== */
  .cat-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
  }

  .cat-sidebar.open {
    display: block;
  }

  /* ===== PANEL ===== */
  .cat-sidebar-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 90%;   
    min-width: 260px;
    max-width: 290px;
    height: 100%;
    background: #fff;
    overflow-y: auto;
    padding: 5px;
  }

  /* bloquear fondo */
  body.cat-filters-open {
    overflow: hidden;
  }

  /* botón filtros */
  .cat-btn-filters {
    display: block;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-hero {
    display: none;
  }

  .cat-categoria-item {
    width: 280px;
    height: 80px;
  }

  .cat-categoria-circle {
    width: 64px;
    height: 64px;
    right: 12px;
  }

  .cat-sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 22px;
    background: none;
    border: none;
    cursor: pointer;
    display: block;
  }

  .cat-section-title {
    grid-template-columns: 1fr;
    row-gap: 10px;
    text-align: center;
    margin: 0;
  }

  .cat-section-title-text {
    grid-column: 1;
    justify-self: center;
    font-size: 18px;
    margin: 0;
  }

  .cat-sort-select {
    grid-column: 1;
    justify-self: center;
    width: 100%;
    max-width: 260px;
  }


  .cat-breadcrumb {
    padding: 12px 12px 0;
    font-size: 12px;
  }


}


/* ============================
   TABLET (769px - 1024px)
============================ */
@media (min-width: 769px) and (max-width: 1024px) {

  /* Layout */
  .cat-layout {
    padding: 16px;
    gap: 16px;
  }

  /* Sidebar */
  .cat-sidebar {
    width: 220px;
  }

  /* Grid productos - 3 columnas en tablet */
  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .cat-producto-img img {
    height: 150px;
  }

  /* Hero categoría */
  .cat-hero {
    max-height: 130px;
  }

  .cat-hero-content {
    padding: 20px 30px;
    max-width: 65%;
  }

  .cat-hero-content h1 {
    font-size: 18px;
  }

  .cat-hero-content p {
    font-size: 14px;
  }

  /* Subcategorías scroll */
  .cat-categoria-item {
    width: 240px;
    height: 85px;
  }

  .cat-categoria-circle {
    width: 74px;
    height: 74px;
  }

  /* Título sección */
  .cat-section-title {
    padding: 0 16px;
  }

  .cat-section-title-text {
    font-size: 18px;
  }

  /* Breadcrumb */
  .cat-breadcrumb {
    padding: 14px 16px 0;
  }

}


/* Botones siempre al fondo de la ficha, alineados entre tarjetas */
.cat-producto-info {
  flex: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.cat-producto-info > .cat-agotado,
.cat-producto-info > .cat-producto-actions { margin-top: auto; }
.cat-producto-info > .cat-agotado + .cat-producto-actions { margin-top: 0; }

.cat-producto{position:relative}
.cat-producto-img{position:relative}