.panel-filtros {
  border: 1px solid #0071bd;
  border-radius: 10px;
  margin-top: 30px;
  margin-left: 20px;
  padding: 15px;
}

.panel-filtros h3,
.panel-filtros-movil h3 {
  color: #0071bd;
}

/* Catálogo: grid (no flex row) para que el panel de filtros pueda quedar sticky al scroll. */
.storefront-catalog-layout {
  display: block;
  overflow: visible;
}

.container-fluid:has(.storefront-catalog-layout) {
  overflow: visible;
}

@media (min-width: 768px) {
  .storefront-catalog-layout {
    display: grid;
    grid-template-columns: minmax(0, 16.666667%) minmax(0, 83.333333%);
    gap: 0;
    align-items: stretch;
  }

  .storefront-catalog-filters-aside {
    position: relative;
    align-self: stretch;
    min-height: 100%;
    z-index: 100;
  }

  .storefront-catalog-filters-sticky {
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Posición controlada por catalog-filters.js (fixed) cuando el scroll supera el inicio del layout. */
  .storefront-catalog-filters-sticky.is-fixed {
    position: fixed;
    z-index: 100;
  }

  .storefront-catalog-filters-sticky.is-at-bottom {
    position: absolute;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    max-height: none;
  }
}

.panel-filtros-movil {
  margin-top: 30px;
  padding: 15px;
}

.panel-filtros-movil h3 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

.panel-filtros-movil input[type='checkbox'] {
  font-size: 1.5em;
  margin-top: 14px;
  margin-left: 1px;
  margin-right: 15px;
}

.panel-filtros-movil label {
  font-size: 1.5em;
  font-weight: bold;
  margin-top: 10px;
}

.panel-filtros-movil label.form-check-label {
  font-weight: normal;
}

.panel-filtros-movil .btn {
  font-size: 1.5em;
  font-weight: bold;
  margin-top: 10px;
}

#productos-listado-container {
  min-height: 280px;
}

.productos-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  z-index: 10;
}

.productos-loading-spinner-wrapper {
  text-align: center;
}

.productos-loading-spinner {
  width: 3rem;
  height: 3rem;
}

.productos-loading-custom-spinner {
  max-width: 1200px;
  max-height: 1200px;
}

#productos-listado-container .pagination {
  --bs-pagination-color: var(--primary-color, #0d6efd);
  --bs-pagination-hover-color: color-mix(in srgb, var(--primary-color, #0d6efd) 85%, black);
  --bs-pagination-focus-color: var(--primary-color, #0d6efd);
  --bs-pagination-active-bg: var(--primary-color, #0d6efd);
  --bs-pagination-active-border-color: var(--primary-color, #0d6efd);
}

#productos-listado-container .pagination .page-item.active .page-link {
  color: #fff;
}

.storefront-catalog-product-grid {
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 1.5rem;
}

@media (min-width: 768px) {
  .storefront-catalog-product-grid {
    --bs-gutter-x: 1.75rem;
    --bs-gutter-y: 2rem;
  }
}

.storefront-catalog-product-grid > [class*='col-'] {
  display: flex;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

/* Product cards (mirror _ProductoCard inline styles) */
.a-producto-main {
  text-decoration: none;
  display: flex;
  flex: 1 1 auto;
  height: 100%;
}

.panel-producto {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  border: 1px solid rgb(232 239 246);
  background-color: #fff;
  box-shadow:
    0 1px 2px rgb(15 37 71 / 0.06),
    0 0 1px rgb(15 37 71 / 0.04);
  margin: 0;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  height: 420px;
}

.panel-producto .oferta-ribbon {
  position: absolute;
  top: 40px;
  right: -75px;
  width: 260px;
  background: #ffd600;
  color: #000;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px;
  transform: rotate(45deg);
  z-index: 10;
  font-size: 18px;
  line-height: 1.1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
  .panel-producto .oferta-ribbon {
    top: 23px;
    right: -70px;
    width: 200px;
    padding: 3px;
    font-size: 12px;
  }

  .panel-producto {
    margin: 0;
    padding: 12px;
    height: 300px;
  }

  .panel-producto .producto-titulo {
    font-size: 1em;
  }

  .panel-producto .producto-precio {
    font-size: 1.1em;
  }

  .panel-producto .producto-sku {
    font-size: 0.75em;
  }

  .panel-producto .producto-stock {
    font-size: 0.75em;
  }
}

.panel-producto:hover {
  border-color: rgb(158 183 229);
  box-shadow:
    0 8px 25px rgba(0, 113, 189, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 1);
}

.panel-producto:hover picture {
  transform: scale(1.07);
}

.panel-producto .image-container {
  overflow: hidden;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-producto picture {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.panel-producto img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

.panel-producto .producto-info {
  flex-shrink: 0;
  margin-top: auto;
}

.panel-producto .producto-sku {
  color: #888;
  margin-top: 6px;
  font-size: 0.9em;
}

.panel-producto .producto-sku span {
  margin-left: 7px;
  margin-right: 7px;
}

.panel-producto .producto-titulo {
  margin-top: 5px;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1.2em;
  color: #0071bd;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panel-producto .producto-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.panel-producto .producto-stock {
  color: #888;
  font-size: 0.9em;
  flex: 1 1 auto;
  min-width: 0;
}

.panel-producto .producto-precio {
  margin-top: 0;
  font-weight: bold;
  font-size: 1.4em;
  color: black;
  text-align: end;
  flex-shrink: 0;
}

.panel-producto .producto-precio span {
  text-decoration: line-through;
  color: red;
  font-weight: normal;
  font-size: 0.8em;
}

/* Título centrado catálogo (segmento legacy) */
.storefront-catalog-segmento.segmento.text-center > h2 {
  text-transform: uppercase;
}
