/* =========================================================
   BIOSELF — shop.css
   Estilos exclusivos de woocommerce/archive-product.php (el Shop y las
   categorías de producto). Todo lo que es la card en sí (imagen, hover,
   precio, botón) vive en main.css porque se reusa en el carrusel del
   home, cross-sells, etc. — acá va el "chrome" propio de esta pantalla:
   título, breadcrumb, sidebar de filtros, resultados, paginación.
   ========================================================= */

.bioself-shop {
  position: relative;
  overflow-x: hidden;
}
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  #respond
  input#submit,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  a.button,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  button.button,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  input.button,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  #respond
  input#submit,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  a.button,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  button.button,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  input.button {
  font-size: 55%;
  margin: 0;
  line-height: 1;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  overflow: visible;
  padding: 0.618em 1em;
  font-weight: 700;
  border-radius: 3px;
  left: auto;
  color: #515151;
  background-color: #e9e6ed;
  border: 0;
  display: inline-block;
  background-image: none;
  box-shadow: none;
  text-shadow: none;
}
/* Encabezado */
.bioself-shop__header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 2rem;
}

.bioself-shop__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
}

.bioself-shop__description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.bioself-shop__description p {
  margin: 0;
}

.bioself-filter {
  margin-bottom: 2rem;
}

.bioself-filter__label,
.bioself-filter label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-dark);
  margin-bottom: 0.75rem;
}

.bioself-filter__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-dark);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
}

.bioself-filter__input:focus {
  outline: none;
  border-color: var(--color-sage);
}

select.bioself-filter__input {
  cursor: pointer;
}

.bioself-filter__reset {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.bioself-filter__reset:hover {
  color: var(--color-dark);
}

/* Slider de precio — dos manijas arrastrables sobre una pista común. */
.bioself-price-slider__track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--color-border);
  margin: 0 9px 1rem;
}

.bioself-price-slider__range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--color-dark);
  border-radius: 999px;
}

.bioself-price-slider__handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid var(--color-dark);
  cursor: grab;
  padding: 0;
  box-shadow: 0 1px 3px rgba(68, 57, 53, 0.25);
}

.bioself-price-slider__handle:active {
  cursor: grabbing;
}

.bioself-price-slider__values {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ---------- Barra de arriba: botón "Filtro" + conteo de resultados ---------- */
.bioself-shop__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.bioself-shop__filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  background: var(--color-dark);
  color: var(--color-white);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.bioself-shop__filter-toggle:hover {
  background: var(--color-deepforest);
}

.bioself-shop__filter-toggle svg {
  width: 18px;
  height: 18px;
}

/* ---------- Popup de filtros (modal centrado, todas las resoluciones) ---------- */
.bioself-shop__filters {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bioself-shop__filters.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bioself-shop__filters-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(54, 56, 43, 0.5);
}

.bioself-shop__sidebar {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 30px 70px rgba(54, 56, 43, 0.3);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bioself-shop__filters.is-open .bioself-shop__sidebar {
  transform: none;
}

.bioself-shop__sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.bioself-shop__sidebar-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.bioself-shop__sidebar-close {
  background: none;
  border: none;
  color: var(--color-dark);
  cursor: pointer;
  padding: 0.25rem;
}

.bioself-shop__sidebar-close svg {
  width: 20px;
  height: 20px;
}

/* ---------- Resultados ----------
   El <main> del shop no tiene .container (ver archive-product.php), así
   que esto ya ocupa el 100% del viewport sin necesidad de romper nada. */
.bioself-shop__results {
  min-width: 0;
  width: 100%;
  transition: opacity 0.25s ease;
}

/* ---------- Grilla de filas alternadas ---------- */
.bioself-shop__grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.bioself-shop-row {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: clamp(30rem, 88vh, 50rem);
  overflow: hidden;
  text-decoration: none;
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}

.bioself-shop-row.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .bioself-shop-row {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.bioself-shop-row--reverse .bioself-shop-row__image {
  order: 2;
}

.bioself-shop-row--reverse .bioself-shop-row__bg {
  order: 1;
}
img.bioself-shop-row__photo {
  max-width: 250px !important;
}
.bioself-shop-row__image {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 3rem;
  text-align: center;
  background: var(--color-white);
}

.bioself-shop-row__photo {
  width: 100%;
  max-width: 250px;
  height: auto;
  object-fit: contain;
  transition: transform 0.6s var(--ease);
}

.bioself-shop-row:hover .bioself-shop-row__photo {
  transform: scale(1.05);
}

.bioself-shop-row__title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 1rem + 2vw, 2.75rem);
  font-weight: 600;
  color: var(--color-dark);
}

.bioself-shop-row__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--color-dark);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition:
    background-color 0.3s ease,
    transform 0.3s ease;
}

.bioself-shop-row:hover .bioself-shop-row__cta {
  background: var(--color-deepforest);
  transform: translateY(-2px);
}

.bioself-shop-row__bg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 4rem;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s var(--ease);
}

.bioself-shop-row__logo {
  position: relative;
  z-index: 1;
  width: 40px;
  height: auto;
  filter: brightness(0) invert(1);
}

.bioself-shop-row:hover .bioself-shop-row__bg {
  transform: scale(1.03);
}

.bioself-shop-row__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(54, 56, 43, 0.35),
    rgba(54, 56, 43, 0.55)
  );
}

.bioself-shop-row__desc {
  position: relative;
  z-index: 1;
  max-width: 30rem;
  text-align: center;
  color: var(--color-white);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

@media (max-width: 900px) {
  .bioself-shop-row,
  .bioself-shop-row--reverse {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .bioself-shop-row--reverse .bioself-shop-row__image,
  .bioself-shop-row--reverse .bioself-shop-row__bg {
    order: initial;
  }
  .bioself-shop-row__image {
    padding: 2.25rem 1.5rem;
    min-height: 60vh;
  }

  .bioself-shop-row__bg {
    padding: 2.5rem 1.5rem;
    min-height: 60vh;
  }
}

.bioself-shop__results.is-loading {
  opacity: 0.4;
  pointer-events: none;
}

/* Avisos (carrito actualizado, sin resultados, errores, etc.) */
.bioself-shop .woocommerce-notices-wrapper:empty {
  display: none;
}

.bioself-shop .woocommerce-info,
.bioself-shop .woocommerce-message,
.bioself-shop .woocommerce-error {
  list-style: none;
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-dark);
  font-size: 0.9rem;
}

.bioself-shop .woocommerce-error {
  border-color: var(--color-error);
  color: var(--color-error);
}

.bioself-shop__empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem 0;
}

.bioself-shop .woocommerce-result-count {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Paginación propia (botones, no <a>: ver bioself_render_ajax_pagination) */
.bioself-shop__pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.bioself-shop__pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-dark);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

.bioself-shop__pagination .page-numbers:hover {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

.bioself-shop__pagination .page-numbers.current {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

/* ---------- Mobile: el popup ocupa casi toda la pantalla ---------- */
@media (max-width: 600px) {
  .bioself-shop__filters {
    padding: 0.75rem;
  }

  .bioself-shop__sidebar {
    max-width: none;
    max-height: 90vh;
    border-radius: 16px;
  }
}

body.bioself-shop-filters-open {
  overflow: hidden;
}
