/* ================================================================
   Infy Theme — Página de Productos
   ================================================================ */

.page-productos {
  padding-block: var(--sp-12) var(--sp-20);
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.page-productos__breadcrumb {
  margin-bottom: var(--sp-8);
}

/* ── Barra de filtros y búsqueda ──────────────────────────────── */
.products-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  align-items: center;
  width: 100%;
}

.products-controls__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.products-controls__actions .order-dropdown {
  width: 260px;
  flex-shrink: 0;
}

/* Campo de búsqueda */
.search-field {
  position: relative;
}

.search-field__icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.search-field__icon svg {
  width: 18px;
  height: 18px;
}

.search-field__input {
  width: 100%;
  padding: 0.65rem var(--sp-4) 0.65rem var(--sp-10);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field__input:focus {
  border-color: var(--color-dark);
  box-shadow: 0 0 0 3px rgba(47, 247, 208, 0.25);
}

/* Select de orden */
.order-select {
  padding: 0.65rem var(--sp-10) 0.65rem var(--sp-5);
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--color-text);
  appearance: none;
  background: var(--color-white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23082944' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 1rem center;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  white-space: nowrap;
}

.order-select:focus {
  border-color: var(--color-primary);
}

/* ── Layout catálogo: sidebar + contenido ─────────────────────── */
.products-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
}

.products-main {
  min-width: 0;
}

.products-sidebar {
  position: sticky;
  top: calc(var(--header-height, 80px) + var(--sp-4));
  padding: var(--sp-5);
  border: 1px solid var(--color-gray);
  border-radius: var(--radius-lg);
  background: var(--color-white);
}

.products-sidebar__count {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-dark);
}

.products-filter-group + .products-filter-group {
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--color-gray);
}

.products-filter-group__title {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-dark);
}

.products-filter-group__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-height: 280px;
  overflow-y: auto;
  padding-right: var(--sp-1);
}

.products-filter-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  max-height: 260px;
  overflow-y: auto;
  padding-right: var(--sp-1);
}

/* ── Filtros de categoría (checkboxes) ────────────────────────── */
.category-filters {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-10);
  flex-wrap: wrap;
  margin-left: var(--sp-12);
  margin-top: var(--sp-10);
}

.category-filter {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--color-text);
  user-select: none;
}

.products-filter-group__list .category-filter {
  padding: var(--sp-1) 0;
}

.category-filter__input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.category-filter__label {
  font-weight: var(--fw-medium);
  transition: color var(--transition);
  line-height: 1.35;
}

.category-filter:hover .category-filter__label {
  color: var(--color-primary);
}

/* ── Filtros de etiquetas (pills) ─────────────────────────────── */
.tag-filter {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}

.tag-filter__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tag-filter__label {
  display: inline-block;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--color-gray-mid);
  border-radius: var(--radius-full);
  background: var(--color-gray-light, #f5f7fa);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  line-height: 1.25;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.tag-filter:hover .tag-filter__label {
  border-color: var(--color-primary);
  color: var(--color-dark);
}

.tag-filter__input:checked + .tag-filter__label {
  border-color: var(--color-dark);
  background: var(--color-primary);
  color: var(--color-dark);
}

.tag-filter__input:focus-visible + .tag-filter__label {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Controles: barra de búsqueda y orden ─────────────────────── */
body.infy-custom-layout .page-productos .search-field__input {
  width: 85%;
  height: 48px;
  padding: 0 3em;
  border-radius: 9999px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: var(--fs-sm);
  line-height: normal;
  color: var(--color-text);
  appearance: none;
  -webkit-appearance: none;
}

@media (max-width: 992px) {
  body.infy-custom-layout .page-productos .search-field__input {
    width: 100%;
    box-sizing: border-box;
  }
}

body.infy-custom-layout .page-productos .search-field__input:focus {
  border-color: #082944 !important;
}

body.infy-custom-layout .page-productos .search-field__icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

body.infy-custom-layout .page-productos .search-field__icon svg {
  width: 18px;
  height: 18px;
}

body.infy-custom-layout .page-productos .order-select {
  width: 100%;
  height: 48px;
  padding: 0 2.75rem 0 var(--sp-5);
  border: 2px solid #cccccc !important;
  border-radius: 9999px !important;
  background: #ffffff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23082944' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 1.1rem center !important;
  box-shadow: none !important;
  outline: none;
  font-size: var(--fs-sm);
  line-height: normal;
  color: var(--color-text);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.infy-custom-layout .page-productos .order-select:focus {
  border-color: #2ff7d0 !important;
}

/* ── Grid de productos ────────────────────────────────────────── */
.products-listing-grid {
  display: grid;
  gap: var(--sp-6);
}

.products-listing-grid--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.products-listing-grid--cols-3 .product-card--home {
  height: 100%;
}

.products-listing-grid--cols-3 .product-card--home .product-card__action {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.products-listing-grid--cols-3 .product-card--home .product-card__footer--default {
  flex: 1;
  min-height: 96px;
  align-items: center;
}

.products-listing-grid--cols-3 .product-card--home .product-card__name {
  min-height: calc(1.3em * 2);
}

.products-listing-grid--cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-3);
}

/* Ocultar tarjetas filtradas (gana al display:flex !important de WoodMart) */
body.infy-custom-layout .products-listing-grid .product-card.is-hidden {
  display: none !important;
}

/* ── Cards del catálogo (misma base que home pero sin prefijo .section-products) */
.products-listing-grid .product-card--home {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow: visible;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  transition: transform var(--transition);
}

.products-listing-grid .product-card--home:hover {
  transform: translateY(-4px);
}

.products-listing-grid .product-card--home .product-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 320px;
  padding: var(--sp-10) var(--sp-6) var(--sp-8);
  background: #ededed;
  border-radius: 20px;
  text-decoration: none;
  padding: 35px 0 0 0;
}

.products-listing-grid .product-card--home .product-card__badge {
  position: absolute;
  top: var(--sp-5);
  left: var(--sp-5);
  z-index: 1;
  padding: var(--sp-1) var(--sp-4);
  background: var(--color-dark);
  color: var(--color-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
}

.products-listing-grid .product-card--home .product-card__image {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.products-listing-grid .product-card--home .product-card__action {
  display: grid;
  grid-template-areas: 'action';
  width: 100%;
}

.products-listing-grid .product-card--home .product-card__footer--default,
.products-listing-grid .product-card--home .product-card__add-full {
  grid-area: action;
}

.products-listing-grid .product-card--home .product-card__footer--default {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  min-height: 72px;
  height: auto;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-dark);
  border-radius: 16px;
  color: var(--color-white);
  overflow: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.products-listing-grid .product-card--home .product-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.products-listing-grid .product-card--home .product-card__name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.products-listing-grid .product-card--home .product-card__prices {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--sp-2);
  min-height: 1.15em;
}

body.infy-custom-layout .products-listing-grid .product-card--home .product-card__prices {
  flex-wrap: nowrap !important;
  align-items: center !important;
}

.products-listing-grid .product-card--home .product-card__price,
.products-listing-grid .product-card--home .product-card__price--original {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

body.infy-custom-layout .products-listing-grid .product-card--home .product-card__price,
body.infy-custom-layout .products-listing-grid .product-card--home .product-card__price--original {
  white-space: nowrap !important;
  display: inline-flex !important;
}

body.infy-custom-layout .products-listing-grid .product-card--home .product-card__price {
  font-size: var(--fs-sm) !important;
  font-weight: var(--fw-semibold) !important;
}

body.infy-custom-layout .products-listing-grid .product-card--home .product-card__price--original {
  font-size: var(--fs-xs) !important;
}

.products-listing-grid .product-card--home .product-card__price {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-white);
}

.products-listing-grid .product-card--home .product-card__price--original {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-primary);
  text-decoration: line-through;
}

.products-listing-grid .product-card--home .product-card__price--original .woocommerce-Price-amount {
  color: inherit;
}

.products-listing-grid .product-card--home .product-card__cart-icon {
  flex-shrink: 0 !important;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 50% !important;
  background: var(--color-white);
  color: var(--color-dark);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform var(--transition), background-color var(--transition);
}

.products-listing-grid .product-card--home .product-card__cart-icon svg,
.products-listing-grid .product-card--home .product-card__cart-icon .infy-product-cart-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.products-listing-grid .product-card--home .product-card__cart-icon:hover {
  transform: none;
  background: var(--color-primary-hover);
  color: var(--color-primary-hover-fg);
}

.products-listing-grid .product-card--home .product-card__add-full {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 72px;
  padding: 0.85rem var(--sp-5);
  border: 2px solid var(--color-dark);
  border-radius: 16px;
  background: #ededed;
  color: var(--color-dark);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.products-listing-grid .product-card--home .product-card__add-full-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.products-listing-grid .product-card--home .product-card__add-full-icon svg,
.products-listing-grid .product-card--home .product-card__add-full-icon .infy-product-cart-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.products-listing-grid .product-card--home .product-card__add-full:hover {
  background: var(--color-primary);
  color: var(--color-dark);
}

.products-listing-grid .product-card--home:hover .product-card__footer--default {
  display: none;
}

.products-listing-grid .product-card--home:hover .product-card__add-full {
  display: inline-flex;
}

/* ── Vista compacta: 5 columnas (después de estilos base para ganar cascada) ── */
.products-listing-grid--cols-5 .product-card--home {
  gap: var(--sp-2);
}

.products-listing-grid--cols-5 .product-card--home:hover {
  transform: translateY(-2px);
}

.products-listing-grid--cols-5 .product-card--home .product-card__media {
  min-height: 0 !important;
  height: 250px !important;
  max-height: 250px !important;
  padding: 0.75rem 0.5rem !important;
  border-radius: 16px !important;
}

.products-listing-grid--cols-5 .product-card--home .product-card__image {
  max-height: 140px !important;
  max-width: 92% !important;
}

.products-listing-grid--cols-5 .product-card--home .product-card__badge {
  top: var(--sp-2);
  left: var(--sp-2);
  font-size: 0.6rem;
  padding: 2px var(--sp-2);
  max-width: calc(100% - 1rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.products-listing-grid--cols-5 .product-card--home .product-card__footer--default,
.products-listing-grid--cols-5 .product-card--home .product-card__add-full {
  min-height: 60px;
  height: auto;
  padding: 0.45rem 0.5rem 0.45rem 0.625rem;
}

.products-listing-grid--cols-5 .product-card--home .product-card__add-full {
  border-width: 2px;
  font-size: 0.7rem;
  gap: var(--sp-2);
}

.products-listing-grid--cols-5 .product-card--home .product-card__info {
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(100% - 38px);
}

.products-listing-grid--cols-5 .product-card--home .product-card__name {
  font-size: 0.72rem !important;
  line-height: 1.25;
  -webkit-line-clamp: 2;
}

.products-listing-grid--cols-5 .product-card--home .product-card__prices {
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.15rem;
}

body.infy-custom-layout .products-listing-grid--cols-5 .product-card--home .product-card__prices {
  flex-direction: column !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
}

.products-listing-grid--cols-5 .product-card--home .product-card__price,
.products-listing-grid--cols-5 .product-card--home .product-card__price--original {
  white-space: nowrap;
}

.products-listing-grid--cols-5 .product-card--home .product-card__price--original {
  font-size: 0.58rem !important;
  line-height: 1.1;
}

.products-listing-grid--cols-5 .product-card--home .product-card__footer--default {
  min-height: 72px;
  align-items: center;
}

.products-listing-grid--cols-5 .product-card--home .product-card__price {
  font-size: 0.7rem !important;
}

.products-listing-grid--cols-5 .product-card--home .product-card__cart-icon {
  flex-shrink: 0 !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
}

.products-listing-grid--cols-5 .product-card--home .product-card__cart-icon svg,
.products-listing-grid--cols-5 .product-card--home .product-card__cart-icon .infy-product-cart-icon {
  width: 17px !important;
  height: 17px !important;
  display: block !important;
}


.page-productos__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--sp-12) 0;
}

/* ── Decoración lateral ───────────────────────────────────────── */
.products-page__decoration {
  position: fixed;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.08;
  pointer-events: none;
}

.products-page__decoration svg {
  width: 200px;
  height: 300px;
  stroke: var(--color-primary);
  stroke-width: 2;
  fill: none;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .products-listing-grid--cols-5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── Filtros mobile (ocultos en desktop) ───────────────────────── */
.products-mobile-filters {
  display: none;
}

@media (max-width: 992px) {
  .products-sidebar {
    display: none !important;
  }

  .products-controls {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  .products-controls__actions {
    width: 100%;
    justify-content: space-between;
  }

  .products-mobile-filters {
    display: flex !important;
    gap: var(--sp-3);
    margin-bottom: 0;
    width: 100%;
  }

  .products-mobile-filters__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    border: none;
    border-radius: 14px;
    background: #ececec;
    color: var(--color-dark);
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
  }

  .products-mobile-filters__label {
    font-size: 0.72rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: left;
  }

  .products-mobile-filters__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    margin-left: var(--sp-2);
  }

  .products-mobile-filters__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--color-dark);
    color: var(--color-white);
    font-size: 0.62rem;
    font-weight: var(--fw-bold);
    line-height: 1;
  }

  .products-mobile-filters__chev {
    display: inline-flex;
    align-items: center;
    color: var(--color-dark);
    opacity: 0.85;
  }

  .products-mobile-filters__btn.is-active {
    background: var(--color-primary);
    color: var(--color-dark);
  }

  .products-mobile-filters__btn.is-active .products-mobile-filters__badge {
    background: var(--color-dark);
    color: var(--color-white);
  }
}

/* ── Bottom sheet filtros (mobile) ─────────────────────────────── */
.catalog-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
  visibility: hidden;
}

.catalog-filter-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.catalog-filter-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 41, 68, 0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.catalog-filter-sheet.is-open .catalog-filter-sheet__backdrop {
  opacity: 1;
}

.catalog-filter-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 640px);
  background: var(--color-white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(8, 41, 68, 0.18);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.catalog-filter-sheet.is-open .catalog-filter-sheet__panel {
  transform: translateY(0);
}

.catalog-filter-sheet__handle {
  width: 40px;
  height: 4px;
  margin: var(--sp-3) auto var(--sp-2);
  border-radius: var(--radius-full);
  background: var(--color-gray-mid);
  flex-shrink: 0;
}

.catalog-filter-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--color-gray);
  flex-shrink: 0;
}

.catalog-filter-sheet__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  color: var(--color-dark);
  line-height: 1.2;
}

.catalog-filter-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #ececec;
  color: var(--color-dark);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}

.catalog-filter-sheet__close:hover {
  background: #dedede;
}

.catalog-filter-sheet__close svg {
  display: block;
  width: 18px;
  height: 18px;
}

.catalog-filter-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--sp-5);
  -webkit-overflow-scrolling: touch;
}

.catalog-filter-sheet__body .products-filter-group + .products-filter-group {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.catalog-filter-sheet__body .products-filter-group__title {
  display: none;
}

.catalog-filter-sheet__body .products-filter-group__list,
.catalog-filter-sheet__body .products-filter-group__tags {
  max-height: none;
  gap: 0;
}

.catalog-filter-sheet__body .category-filter {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--color-gray);
}

.catalog-filter-sheet__body .category-filter:last-child {
  border-bottom: none;
}

.catalog-filter-sheet__body .category-filter__input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-dark);
}

.catalog-filter-sheet__body .category-filter__label {
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--color-text);
}

.catalog-filter-sheet__body .tag-filter {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--color-gray);
}

.catalog-filter-sheet__body .tag-filter:last-child {
  border-bottom: none;
}

.catalog-filter-sheet__body .tag-filter__input {
  position: static;
  opacity: 1;
  width: 18px;
  height: 18px;
  margin: 0;
  pointer-events: auto;
  accent-color: var(--color-dark);
  flex-shrink: 0;
}

.catalog-filter-sheet__body .tag-filter__label {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin-left: var(--sp-3);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  line-height: 1.3;
}

.catalog-filter-sheet__body .tag-filter__input:checked + .tag-filter__label {
  background: transparent;
  border: none;
  color: var(--color-dark);
  font-weight: var(--fw-semibold);
}

.catalog-filter-sheet__body .tag-filter:hover .tag-filter__label {
  border: none;
  color: var(--color-text);
}

.catalog-filter-sheet__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-gray);
  flex-shrink: 0;
  background: var(--color-white);
}

.catalog-filter-sheet__clear {
  padding: 0;
  border: none;
  background: none;
  color: var(--color-dark);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.catalog-filter-sheet__apply {
  flex-shrink: 0;
  min-width: 140px;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 14px;
  background: var(--color-dark);
  color: var(--color-white);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition);
}

.catalog-filter-sheet__apply:hover {
  background: #0a3558;
}

body.catalog-filter-sheet-open {
  overflow: hidden;
}

@media (min-width: 993px) {
  .catalog-filter-sheet {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .products-layout {
    grid-template-columns: 1fr;
  }

  .products-listing-grid--cols-3,
  .products-listing-grid--cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .products-listing-grid--cols-5 .product-card--home .product-card__media {
    height: 250px !important;
    max-height: 250px !important;
  }

  .products-listing-grid--cols-5 .product-card--home .product-card__image {
    max-height: 140px !important;
  }
}

@media (max-width: 600px) {
  .products-controls {
    grid-template-columns: 1fr;
  }

  .products-controls__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .products-controls__actions .order-dropdown {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .products-listing-grid--cols-3,
  .products-listing-grid--cols-5 {
    grid-template-columns: 1fr;
  }

  .category-filters {
    gap: var(--sp-4);
  }

  .products-filter-group__list,
  .products-filter-group__tags {
    max-height: none;
  }
}

/* ================================================================
   Controles modernos del catálogo: orden, búsqueda live, paginado
   ================================================================ */

/* Ocultar el input hidden que guarda el valor de orden */
.order-dropdown .order-select { display: none; }

/* ── Dropdown de orden ───────────────────────────────────────── */
.order-dropdown {
  position: relative;
}

body.infy-custom-layout .order-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  height: 48px;
  padding: 0 var(--sp-4);
  border: 2px solid var(--color-gray-mid);
  border-radius: 9999px;
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: border-color var(--transition);
  text-transform: none;
}

body.infy-custom-layout .order-dropdown.is-open .order-dropdown__toggle,
body.infy-custom-layout .order-dropdown__toggle:hover {
  border-color: var(--color-primary);
}

.order-dropdown__icon {
  display: flex;
  color: var(--color-dark);
}

.order-dropdown__icon svg { width: 18px; height: 18px; }

.order-dropdown__current {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-dropdown__chev {
  display: flex;
  color: var(--color-dark);
  transition: transform var(--transition);
}

.order-dropdown.is-open .order-dropdown__chev { transform: rotate(180deg); }

.order-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 50;
  margin: 0;
  padding: var(--sp-2);
  list-style: none;
  background: var(--color-white);
  border: 1px solid var(--color-gray);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(8, 41, 68, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.order-dropdown.is-open .order-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.order-dropdown__menu li { list-style: none; }

body.infy-custom-layout .order-dropdown__opt {
  display: block;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 0.65rem var(--sp-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
  text-transform: none;
  transition: background var(--transition), color var(--transition);
}

.order-dropdown__opt svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

body.infy-custom-layout .order-dropdown__opt:hover {
  background: var(--color-gray);
}

body.infy-custom-layout .order-dropdown__opt.is-active {
  background: var(--color-primary);
  color: var(--color-dark);
}

.order-dropdown__opt.is-active svg { color: var(--color-dark); }

/* ── Selector de columnas del grid ───────────────────────────── */
body.infy-custom-layout .grid-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  padding: 4px;
  border: 2px solid var(--color-gray-mid);
  border-radius: 9999px;
  background: var(--color-white);
  flex-shrink: 0;
}

body.infy-custom-layout .grid-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

body.infy-custom-layout .grid-view-toggle__btn:hover {
  color: var(--color-dark);
  background: rgba(8, 41, 68, 0.06);
}

body.infy-custom-layout .grid-view-toggle__btn.is-active {
  background: var(--color-primary);
  color: var(--color-dark);
  box-shadow: 0 4px 14px rgba(47, 247, 208, 0.35);
}

body.infy-custom-layout .grid-view-toggle__btn.is-active:hover {
  background: var(--color-primary);
  color: var(--color-dark);
}

.grid-view-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-view-toggle__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ── Dropdown de resultados de búsqueda ──────────────────────── */
.search-field { position: relative; }

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 60;
  padding: var(--sp-2);
  background: var(--color-gray);
  border: 1px solid var(--color-gray);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  max-height: 220px;
  overflow-y: auto;
  width: 85%;
  margin: 0 2.5em;
}

.search-results__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.search-results__item:hover,
.search-results__item:focus-visible {
  background: rgba(47, 247, 208, 0.12);
  border-color: var(--color-primary);
  transform: translateX(3px);
  outline: none;
}

.search-results__item:hover .search-results__name {
  color: var(--color-primary-hover);
}

.search-results__item:hover .search-results__thumb {
  background: var(--color-white);
}

.search-results__thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--color-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.search-results__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

.search-results__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.search-results__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results__price {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.search-results__empty {
  padding: var(--sp-4);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ── Paginación ──────────────────────────────────────────────── */
.products-no-results {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--sp-10) 0;
}

.products-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-12);
  flex-wrap: wrap;
}

body.infy-custom-layout .products-pagination__btn {
  min-width: 42px;
  height: 42px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--color-gray-mid);
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-dark);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

body.infy-custom-layout .products-pagination__btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: var(--color-gray);
}

body.infy-custom-layout .products-pagination__btn.is-active {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

body.infy-custom-layout .products-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
