/*
 * Ración Ya · catalogue, product page, brands and side cart.
 *
 * Consumes the tokens storefront.css publishes on :root; defines none of its
 * own. Mobile first, with the four control widths of the spec: 390, 768, 1024
 * and 1440.
 */

/* ------------------------------------------------------------------ *
 * Breadcrumbs and archive header
 * ------------------------------------------------------------------ */

.ry-breadcrumbs {
  padding-block: 14px 0;
  color: var(--ry-muted);
  font-size: 0.8rem;
}

.ry-breadcrumbs a {
  color: inherit;
}

.ry-breadcrumbs span[aria-hidden="true"] {
  padding-inline: 6px;
  opacity: 0.5;
}

.ry-shop__header {
  padding-block: 18px 8px;
}

.ry-shop__title {
  margin: 0;
  color: var(--ry-forest);
  font-family: var(--ry-font-editorial);
  font-size: clamp(1.8rem, 5.4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.08;
}

.ry-shop__description {
  max-width: 62ch;
  margin-top: 10px;
  color: var(--ry-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ry-shop__count {
  margin: 0;
  color: var(--ry-muted);
  font-family: var(--ry-font-mono);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------------ *
 * Archive layout
 * ------------------------------------------------------------------ */

.ry-shop__layout {
  display: grid;
  gap: 26px;
  padding-block: 10px 56px;
}

.ry-shop__sidebar {
  display: none;
}

.ry-shop__results {
  min-width: 0;
}

@media (min-width: 1024px) {
  .ry-shop__layout {
    grid-template-columns: 262px minmax(0, 1fr);
    gap: 38px;
  }

  .ry-shop__sidebar {
    display: block;
    align-self: start;
    position: sticky;
    top: 18px;
  }
}

/* ------------------------------------------------------------------ *
 * Filters
 * ------------------------------------------------------------------ */

.ry-filters__group {
  border-bottom: 1px solid var(--ry-sand);
}

.ry-filters__group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 13px;
  color: var(--ry-forest);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.ry-filters__group > summary::-webkit-details-marker {
  display: none;
}

.ry-filters__group > summary::after {
  content: "+";
  font-family: var(--ry-font-mono);
  font-size: 1.05rem;
  color: var(--ry-muted);
}

.ry-filters__group[open] > summary::after {
  content: "–";
}

.ry-filters__options {
  display: grid;
  gap: 2px;
  padding-bottom: 12px;
}

.ry-filters__options--scroll {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ry-filters__option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 2px 4px;
  border-radius: var(--ry-radius-small);
  font-size: 0.88rem;
  cursor: pointer;
}

.ry-filters__option:hover {
  background: var(--ry-surface-2);
}

.ry-filters__option input {
  width: 17px;
  height: 17px;
  accent-color: var(--ry-forest);
}

.ry-filters__price {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  color: var(--ry-muted);
}

.ry-filters__price input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--ry-sand);
  border-radius: var(--ry-radius-small);
  background: var(--ry-surface);
  font-family: var(--ry-font-mono);
  font-size: 0.86rem;
}

.ry-filters__flags {
  display: grid;
  gap: 2px;
  padding-block: 12px;
  border-bottom: 1px solid var(--ry-sand);
}

.ry-filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.ry-filters__actions .ry-button {
  flex: 1 1 auto;
  justify-content: center;
}

/* ------------------------------------------------------------------ *
 * Active filter chips
 * ------------------------------------------------------------------ */

.ry-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ry-active-filters__label {
  color: var(--ry-muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ry-active-filters ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ry-active-filters li a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 11px;
  border: 1px solid var(--ry-sand);
  border-radius: 999px;
  background: var(--ry-surface);
  color: var(--ry-forest);
  font-size: 0.82rem;
  text-decoration: none;
}

.ry-active-filters li a:hover,
.ry-active-filters li a:focus-visible {
  border-color: var(--ry-copper);
  color: var(--ry-copper-deep);
}

.ry-active-filters li span[aria-hidden="true"] {
  font-size: 1rem;
  line-height: 1;
}

.ry-active-filters__clear {
  color: var(--ry-copper-deep);
  font-size: 0.82rem;
}

/* ------------------------------------------------------------------ *
 * Mobile filter bar
 * ------------------------------------------------------------------ */

.ry-catalog-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.ry-catalog-bar__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ry-sand);
  border-radius: var(--ry-radius-small);
  background: var(--ry-surface);
  color: var(--ry-forest);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.ry-catalog-bar__count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--ry-copper);
  color: var(--ry-white);
  font-family: var(--ry-font-mono);
  font-size: 0.72rem;
}

@media (min-width: 1024px) {
  .ry-catalog-bar {
    display: none;
  }
}

/* Este es el unico cajon que dependia del fondo hueso que fijaba
 * storefront.css en `dialog.ry-drawer`. Ahora lo declara el mismo. */
.ry-filters-drawer {
  max-height: 88vh;
  background: var(--ry-fondo);
  color: var(--ry-texto);
}

/* ------------------------------------------------------------------ *
 * Empty state
 * ------------------------------------------------------------------ */

.ry-empty-state {
  max-width: 46ch;
  padding: clamp(28px, 6vw, 52px) 0;
}

.ry-empty-state h2 {
  margin: 0;
  color: var(--ry-forest);
  font-family: var(--ry-font-editorial);
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  font-weight: 500;
}

.ry-empty-state p {
  margin: 10px 0 0;
  color: var(--ry-muted);
  line-height: 1.6;
}

.ry-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

/* ------------------------------------------------------------------ *
 * Brands directory
 * ------------------------------------------------------------------ */

.ry-brand-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  margin: 0;
  padding: 0 0 56px;
  list-style: none;
}

.ry-brand-grid__item a {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
  border: 1px solid var(--ry-sand);
  border-radius: var(--ry-radius);
  background: var(--ry-surface);
  color: inherit;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease;
}

.ry-brand-grid__item a:hover,
.ry-brand-grid__item a:focus-visible {
  border-color: var(--ry-forest-soft);
}

.ry-brand-grid__mark {
  display: grid;
  place-items: center;
  height: 52px;
  margin-bottom: 6px;
}

.ry-brand-grid__mark img {
  max-width: 100%;
  max-height: 52px;
  object-fit: contain;
}

.ry-brand-grid__wordmark {
  color: var(--ry-forest);
  font-family: var(--ry-font-editorial);
  font-size: 1.12rem;
}

.ry-brand-grid__item strong {
  color: var(--ry-forest);
  font-size: 0.9rem;
}

.ry-brand-grid__item small {
  color: var(--ry-muted);
  font-family: var(--ry-font-mono);
  font-size: 0.74rem;
}
