/* =========================================================================
   Galaxy GP — Shop / archives (F4). MOBILE-FIRST.
   Cards blancas sobre papel lila, badges ciruela, filtros propios.
   ========================================================================= */

/* ---------- BANNER (breadcrumb + titulo full-width) ---------- */
.gs-shop-banner { background: var(--gs-nebula); color: #fff; }
.gs-shop-banner__inner {
  max-width: 1500px; margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) 30px;
}
.gs-shop-banner .woocommerce-breadcrumb {
  color: var(--gs-lila); font-size: .78rem; margin: 0 0 .4rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.gs-shop-banner .woocommerce-breadcrumb a { color: var(--gs-lila); }
.gs-shop-banner .woocommerce-breadcrumb a:hover { color: #fff; }
.gs-shop-banner__title { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0; }
.gs-shop-banner__desc { color: rgba(255,255,255,.75); max-width: 62ch; margin-top: .5rem; }

/* ---------- GRID de productos ---------- */
ul.products { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 0 0 2rem !important; }
/* el clearfix ::before/::after de WooCommerce se vuelve un ITEM del grid y deja
   la primera celda vacia (shop Y relacionados) → fuera */
ul.products::before, ul.products::after { display: none !important; content: none !important; }
@media (min-width: 768px) { ul.products { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
@media (min-width: 1024px) {
  ul.products { grid-template-columns: repeat(4, 1fr); }
  .gs-has-shop-sidebar ul.products { grid-template-columns: repeat(3, 1fr); }
}
ul.products li.product {
  position: relative;
  width: 100% !important; margin: 0 !important; float: none !important;
  background: var(--gs-white);
  border: 1px solid var(--gs-border);
  border-radius: var(--gs-radius);
  padding: 1rem !important;
  display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
ul.products li.product:hover { box-shadow: var(--gs-shadow-md); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { ul.products li.product, ul.products li.product:hover { transition: none; transform: none; } }

ul.products li.product a img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain;
  border-radius: var(--gs-radius-sm); margin-bottom: .75rem;
}
.gs-card-cat {
  display: block;
  font-size: .68rem; font-weight: var(--gs-fw-bold);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--gs-plum); margin-bottom: .15rem;
}
ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--gs-font);
  font-size: .98rem; font-weight: var(--gs-fw-bold);
  color: var(--gs-ink); line-height: 1.35;
  padding: 0; margin: 0 0 .35rem;
}
ul.products li.product .price {
  color: var(--gs-ink); font-weight: var(--gs-fw-bold);
  font-size: 1.05rem; margin: auto 0 .75rem;   /* empuja el boton al fondo */
  font-variant-numeric: tabular-nums;
}
ul.products li.product .price del { color: var(--gs-muted); font-weight: var(--gs-fw-regular); margin-right: .35em; }
ul.products li.product .price ins { text-decoration: none; }
ul.products li.product .button { width: 100%; text-align: center; margin: 0; }

/* badge de oferta */
ul.products li.product .onsale {
  position: absolute; top: .8rem; left: .8rem; z-index: 2;
  min-width: 0; min-height: 0; line-height: 1;
  background: var(--gs-plum); color: #fff;
  font-size: .7rem; font-weight: var(--gs-fw-bold);
  padding: .45em .7em; border-radius: var(--gs-radius-pill);
  margin: 0;
}
/* chip sin stock + card atenuada */
.gs-card-stock {
  position: absolute; top: .8rem; right: .8rem; z-index: 2;
  background: var(--gs-ink); color: #fff;
  font-size: .68rem; font-weight: var(--gs-fw-bold);
  padding: .45em .7em; border-radius: var(--gs-radius-pill);
}
ul.products li.product.outofstock a img { opacity: .55; filter: grayscale(.4); }

/* wishlist YITH en la esquina de la card */
ul.products li.product .yith-wcwl-add-to-wishlist { position: absolute; top: .55rem; right: .55rem; z-index: 3; margin: 0; }
ul.products li.product:has(.gs-card-stock) .yith-wcwl-add-to-wishlist { top: 2.6rem; }

/* categorias como cards (equivalente del snippet WPCode 4855, markup de Woo/GP) */
ul.products li.product-category { text-align: center; }
ul.products li.product-category img { border-radius: var(--gs-radius-lg); transition: transform .4s ease; }
ul.products li.product-category:hover img { transform: scale(1.04); }
ul.products li.product-category h2 { font-size: 1rem; color: var(--gs-ink); }

/* ---------- Barra superior del loop (orden + resultado) ---------- */
.woocommerce-result-count { color: var(--gs-muted); font-size: .85rem; }
.woocommerce-ordering select {
  border: 1px solid var(--gs-border); border-radius: var(--gs-radius-sm);
  padding: .5em .8em; background: var(--gs-white); color: var(--gs-ink);
}

/* ---------- SIDEBAR de filtros (desktop) ---------- */
.gs-shop-widget { background: var(--gs-white); border: 1px solid var(--gs-border); border-radius: var(--gs-radius); padding: 1.1rem 1.2rem; margin-bottom: 1.25rem; }
.gs-shop-widget__title {
  font-family: var(--gs-font);
  font-size: .78rem; font-weight: var(--gs-fw-bold);
  text-transform: uppercase; letter-spacing: var(--gs-ls-wide);
  color: var(--gs-muted); margin: 0 0 .8rem;
}
.gs-cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.gs-cat-item a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .45em .6em; border-radius: var(--gs-radius-sm);
  color: var(--gs-ink); font-size: .92rem;
}
.gs-cat-item a:hover { background: var(--gs-lila-soft); color: var(--gs-plum); }
.gs-cat-item.is-active a { background: var(--gs-plum); color: #fff; }
.gs-cat-item.is-active .gs-cat-count { color: rgba(255,255,255,.75); }
.gs-cat-count { font-size: .75rem; color: var(--gs-muted); font-variant-numeric: tabular-nums; }
.gs-tag-cloud { display: flex; flex-wrap: wrap; gap: .45rem; }
.gs-tag-pill {
  display: inline-block;
  font-size: .78rem; font-weight: var(--gs-fw-bold);
  color: var(--gs-ink);
  background: var(--gs-paper);
  border: 1px solid var(--gs-border);
  border-radius: var(--gs-radius-pill);
  padding: .35em .85em;
}
.gs-tag-pill:hover { border-color: var(--gs-plum); color: var(--gs-plum); }
.gs-tag-pill.is-active { background: var(--gs-plum); border-color: var(--gs-plum); color: #fff; }

/* sidebar de GP: sin fondo propio + aire parejo respecto del banner */
.gs-has-shop-sidebar #right-sidebar { background: transparent; }
.gs-has-shop-sidebar .widget-area .inside-right-sidebar { margin-top: 2rem; }
.gs-has-shop-sidebar .site-main { margin-top: 2rem; }

/* ---------- FILTROS MOBILE (bottom-sheet) ---------- */
.gs-filter-toggle {
  display: none;
  align-items: center; gap: .5em;
  width: 100%; justify-content: center;
  margin-bottom: 1rem;
}
.gs-filter-overlay {
  position: fixed; inset: 0; z-index: 1090;
  background: rgba(21,12,40,.5);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.gs-filter-overlay.is-open { opacity: 1; pointer-events: auto; }
.gs-filter-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1095;
  max-height: 82dvh; overflow-y: auto;
  background: var(--gs-paper);
  border-radius: var(--gs-radius-lg) var(--gs-radius-lg) 0 0;
  box-shadow: var(--gs-shadow-lg);
  transform: translateY(100%); transition: transform .3s ease;
}
.gs-filter-panel.is-open { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .gs-filter-panel, .gs-filter-overlay { transition: none; } }
.gs-filter-panel__head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gs-paper); border-bottom: 1px solid var(--gs-border);
  padding: 1rem 1.25rem;
}
.gs-filter-panel__title { font-size: 1.05rem; margin: 0; }
.gs-filter-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: var(--gs-ink);
  padding: .25rem .5rem; border-radius: var(--gs-radius-sm);
}
.gs-filter-panel__body { padding: 1.1rem 1.25rem 2rem; }
.gs-orderby { width: 100%; border: 1px solid var(--gs-border); border-radius: var(--gs-radius-sm); padding: .6em .8em; background: var(--gs-white); color: var(--gs-ink); }

@media (max-width: 1023px) {
  .gs-filter-toggle { display: inline-flex; }
  .gs-has-shop-sidebar .widget-area { display: none; }   /* filtros van en el panel */
  .woocommerce-ordering { display: none; }               /* ordenar vive en el panel */
}
@media (min-width: 1024px) {
  .gs-filter-toggle, .gs-filter-panel, .gs-filter-overlay { display: none; }
}
