/* Splendor - Catalogo */
body.catalog-page {
  --catalog-compare-offset: 0px;
}

body.catalog-page.catalog-drawer-open {
  overflow: hidden;
}

.catalog-section {
  padding: 3rem 0 6rem;
  background:
    radial-gradient(circle at top left, rgba(201, 169, 110, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfaf8 0%, #f6f3ef 100%);
}

body.catalog-page .catalog-section {
  padding-bottom: calc(6rem + var(--catalog-compare-offset));
}

.catalog-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2.25rem;
  align-items: start;
}

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

body.catalog-page .toolbar-right {
  min-width: 0;
}

.catalog-filters {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.35rem;
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 1.25rem;
  box-shadow: 0 12px 34px rgba(20, 18, 15, 0.06);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.18);
}

.filters-header h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

#filters-clear {
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: none;
  border: none;
  cursor: pointer;
}

.filter-group {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.14);
}

.filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.filter-group h4 {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .9rem;
  color: var(--color-text-light);
}

.filter-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .92rem;
  cursor: pointer;
  padding: .45rem .6rem;
  border-radius: .75rem;
  transition: background .2s ease, color .2s ease;
}

.filter-group label:hover {
  background: rgba(201, 169, 110, 0.08);
}

.filter-group input[type=radio],
.filter-group input[type=checkbox] {
  accent-color: var(--color-primary);
}

.price-labels {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--color-text-light);
  margin-top: .5rem;
}

input[type=range] {
  width: 100%;
  accent-color: var(--color-primary);
}

.color-swatches {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.swatch:hover {
  transform: translateY(-1px);
}

.swatch.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(201, 169, 110, 0.14);
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(201, 169, 110, 0.14);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: 0 10px 26px rgba(20, 18, 15, 0.05);
}

body.catalog-page .catalog-toolbar {
  position: relative;
  z-index: 5;
}

.catalog-count {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: .85rem;
}

#catalog-sort {
  font-size: .84rem;
  border: 1px solid rgba(201, 169, 110, 0.22);
  padding: .6rem .85rem;
  background: white;
  cursor: pointer;
  border-radius: .85rem;
  color: var(--color-text);
  min-height: 44px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

body.catalog-page #catalog-sort {
  min-width: 0;
  max-width: 100%;
}

.view-toggle {
  display: flex;
  gap: .35rem;
  padding: .25rem;
  border: 1px solid rgba(201, 169, 110, 0.16);
  background: rgba(255,255,255,.9);
  border-radius: 999px;
}

.view-btn {
  background: none;
  border: 0;
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--color-text-light);
  border-radius: 999px;
  min-width: 44px;
  min-height: 44px;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.view-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 8px 20px rgba(201, 169, 110, 0.25);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.catalog-grid.list-view {
  grid-template-columns: 1fr;
}

.catalog-grid.list-view .product-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.catalog-grid.list-view .product-card__img-wrap {
  margin-bottom: 0;
}

.catalog-grid.list-view .product-card__info {
  padding: 1.25rem 1.25rem 1.35rem;
}

/* Product card (catalogo) */
.product-card {
  position: relative;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(201, 169, 110, 0.14);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(20, 18, 15, 0.06);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 110, 0.28);
  box-shadow: 0 20px 46px rgba(20, 18, 15, 0.11);
}

.product-card__img-wrap,
.product-card__img-wrapper {
  position: relative;
  overflow: hidden;
  padding-top: 125%;
  background:
    linear-gradient(180deg, rgba(232, 227, 220, 0.95), rgba(226, 219, 210, 0.92));
}

.product-card__img-wrap a,
.product-card__img-wrapper a {
  position: absolute;
  inset: 0;
}

.product-card__img-wrap img,
.product-card__img-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s ease, filter .4s ease;
}

.product-card:hover .product-card__img-wrap img,
.product-card:hover .product-card__img-wrapper img {
  transform: scale(1.055);
  filter: saturate(1.02);
}

.product-card__badge {
  position: absolute;
  top: .9rem;
  left: .9rem;
  background: rgba(201, 169, 110, 0.92);
  color: #1f1a12;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .35rem .7rem;
  z-index: 1;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.product-card__badge--sale {
  background: #b94b3f;
  color: white;
  right: .9rem;
  left: auto;
}

.product-card__actions {
  position: absolute;
  bottom: .9rem;
  right: .9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all .28s ease;
  z-index: 1;
}

.product-card:hover .product-card__actions {
  opacity: 1;
  transform: none;
}

.btn-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-icon:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(201, 169, 110, 0.26);
}

.product-card__info {
  padding: 1rem 1rem 1.15rem;
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: .3rem;
}

.product-card__cat {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-light);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.product-card__material {
  color: var(--color-text-light);
  font-size: .7rem;
  font-style: italic;
}

.product-card__name {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: .5rem;
}

.product-card__name a {
  color: var(--color-text);
  transition: color .2s;
}

.product-card__name a:hover {
  color: var(--color-secondary);
}

.product-card__size-meta {
  font-size: .73rem;
  color: var(--color-text-light);
  letter-spacing: .02em;
  margin: .2rem 0 .45rem;
}

.product-card__size {
  color: var(--color-primary);
  font-family: 'Courier New', monospace;
}

.product-card__variants-count {
  color: var(--color-secondary);
  margin-left: .35rem;
}

.product-card__price {
  font-size: .95rem;
  color: var(--color-text);
  display: flex;
  align-items: baseline;
  gap: .35rem;
  flex-wrap: wrap;
}

.product-card__old-price {
  text-decoration: line-through;
  color: var(--color-text-light);
  font-size: .86em;
}

.product-card__pending {
  position: absolute;
  bottom: .9rem;
  left: .9rem;
  background: rgba(192, 126, 48, 0.92);
  color: white;
  padding: .3rem .6rem;
  font-size: .58rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-btn,
.pagination__btn {
  min-width: 44px;
  height: 44px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: white;
  cursor: pointer;
  font-size: .85rem;
  padding: 0 .85rem;
  border-radius: .8rem;
  transition: all .2s ease;
  box-shadow: 0 6px 18px rgba(20,18,15,.05);
}

.page-btn.active,
.pagination__btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 10px 22px rgba(201, 169, 110, 0.28);
}

.page-btn:hover:not(.active),
.pagination__btn:hover:not(.active) {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.pagination__dots {
  display: flex;
  align-items: center;
  color: var(--color-text-light);
}

.catalog-empty {
  grid-column: 1 / -1;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(255,255,255,.8);
  border: 1px dashed rgba(201, 169, 110, 0.3);
  border-radius: 1.25rem;
  color: var(--color-text-light);
}

.catalog-empty p {
  max-width: 34ch;
}

.catalog-empty .btn {
  min-width: 220px;
}

/* Mobile filter button */
.mobile-filter-btn {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  border: none;
  padding: .8rem 1.5rem;
  font-size: .85rem;
  cursor: pointer;
  display: none;
  z-index: 50;
  border-radius: 999px;
  min-height: 44px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.catalog-filters-backdrop {
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  border: 0;
  padding: 0;
  margin: 0;
  width: auto;
  display: none;
  background: rgba(20, 18, 15, 0.42);
  z-index: 85;
}

.catalog-filters-backdrop.is-visible {
  display: block;
}

@media (max-width: 1024px) {
  .catalog-layout {
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .catalog-grid.list-view .product-card {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .catalog-section { padding: 2rem 0 5rem; }

  body.catalog-page .catalog-section {
    padding-bottom: calc(5rem + var(--catalog-compare-offset));
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .catalog-filters {
    display: none;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    z-index: 80;
    overflow-y: auto;
    background: rgba(255,255,255,.98);
    padding: 1.25rem 1rem 6rem;
    border-radius: 0;
    box-shadow: none;
  }

  .catalog-filters.mobile-open { display: block; }

  body.catalog-page #catalog-filters.mobile-open {
    top: var(--nav-height);
    bottom: 0;
    width: min(360px, 88vw);
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    border-radius: 0 1.25rem 0 0;
    box-shadow: 14px 0 36px rgba(20,18,15,.18);
    overscroll-behavior: contain;
    z-index: 95;
  }

  body.catalog-page #catalog-filters .filters-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
  }

  body.catalog-page .mobile-filter-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + var(--catalog-compare-offset));
    z-index: 90;
  }

  body.catalog-page.has-open-filters .mobile-filter-btn {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
  }

  .catalog-grid {
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
  }

  .catalog-toolbar {
    flex-wrap: wrap;
    gap: .75rem;
  }

  .catalog-toolbar .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  body.catalog-page .catalog-toolbar {
    position: sticky;
    top: calc(var(--nav-height) + .75rem);
    z-index: 40;
    gap: .8rem;
  }

  body.catalog-page .toolbar-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    width: 100%;
  }

  body.catalog-page #catalog-sort {
    width: 100%;
  }

  body.catalog-page #catalog-grid:not(.list-view) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .85rem !important;
  }

  body.catalog-page #catalog-grid.list-view {
    grid-template-columns: 1fr !important;
    gap: .9rem !important;
  }

  body.catalog-page #catalog-grid.list-view .product-card {
    grid-template-columns: minmax(132px, 32vw) minmax(0, 1fr);
    align-items: start;
  }

  body.catalog-page .product-card__info {
    padding: .85rem !important;
  }

  body.catalog-page .product-card__name {
    font-size: .93rem !important;
    line-height: 1.28;
  }

  body.catalog-page .product-card__price {
    font-size: .9rem !important;
  }

  body.catalog-page .product-card__size-meta {
    font-size: .71rem !important;
  }

  body.catalog-page .product-card__compare {
    top: .65rem;
    left: .65rem;
    min-height: 44px;
    padding: .42rem .72rem;
    font-size: .74rem;
    border-radius: 999px;
    gap: .45rem;
  }

  body.catalog-page .product-card__compare input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
  }

  body.catalog-page .compare-bar {
    bottom: env(safe-area-inset-bottom, 0px);
    padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
    gap: .8rem;
  }

  body.catalog-page .compare-bar__thumbs {
    flex: 1 1 auto;
    overflow-x: auto;
    padding-bottom: .15rem;
  }

  body.catalog-page .compare-bar__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
  }

  body.catalog-page .compare-bar .btn {
    width: 100%;
    justify-content: center;
  }

  body.catalog-page #whatsapp-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + var(--catalog-compare-offset));
  }

  body.catalog-page:has(#catalog-filters.mobile-open)::before {
    content: none !important;
    display: none !important;
  }

  .product-card__info {
    padding: .9rem .9rem 1rem;
  }

  .product-card__name {
    font-size: .92rem;
  }

  .product-card__price {
    font-size: .88rem;
  }

  .product-card__actions {
    bottom: .65rem;
    right: .65rem;
  }

  .product-card__pending {
    font-size: .52rem;
    padding: .22rem .45rem;
    bottom: .65rem;
    left: .65rem;
  }

  .catalog-grid.list-view .product-card {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .catalog-toolbar {
    padding: .9rem .95rem;
  }

  .catalog-grid,
  .catalog-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-card__name { font-size: .98rem; }
  .product-card__price { font-size: .95rem; }
}

@media (max-width: 560px) {
  body.catalog-page .catalog-toolbar {
    top: calc(var(--nav-height) + .5rem);
    padding: .85rem;
  }

  body.catalog-page .toolbar-right {
    grid-template-columns: 1fr;
  }

  body.catalog-page .view-toggle {
    width: 100%;
  }

  body.catalog-page .view-btn {
    flex: 1 1 0;
    min-height: 44px;
  }

  body.catalog-page #catalog-grid:not(.list-view) {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  body.catalog-page #catalog-grid.list-view .product-card {
    grid-template-columns: minmax(118px, 34vw) minmax(0, 1fr);
  }

  body.catalog-page .compare-bar__actions {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) {
  body.catalog-page .product-card__actions {
    opacity: 1;
    transform: none;
  }
}

/* Filtros: nuevos materiales */
.filter-group .swatches-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.material-chip {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--color-border);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}

.material-chip:hover,
.material-chip.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
