/*
 * Shop archive chrome: toolbar (result count + ordering select), filter
 * sidebar, active-filter chips and the mobile filter drawer.
 * Loaded on the main shop page and product taxonomy archives only.
 */

/* ------------------------------------------------------------------ *
 * Hero brand slider: square tiles (logo above, name below) to the right
 * of the hero text on desktop, a swipeable strip below the text on
 * narrow screens. Tiles are light because brand logos are dark artwork.
 * ------------------------------------------------------------------ */
.post-type-archive-product .amg-content-hero {
  padding: 124px 0 56px;
}

/* Two hero columns: text (the default __inner) + the brand slider. */
@media (min-width: 981px) {
  .post-type-archive-product .amg-content-hero .amg-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
    gap: 56px;
    align-items: center;
  }
}

/* Calmer hero typography (the SEO headline is longer than "Shop"). */
.post-type-archive-product .amg-content-hero__title {
  font-size: clamp(28px, 2.6vw, 38px);
}

.post-type-archive-product .amg-content-hero__description {
  font-size: 15px;
  line-height: 1.65;
}

/* Card-style hero CTAs: icon on the left, bold first word over a lighter
   second line (only actions that declare an icon get this treatment). */
.amg-content-hero__action--rich {
  justify-content: flex-start;
  gap: 12px;
  min-height: 60px;
  padding: 9px 22px 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #fff;
  color: #111827;
  text-decoration: none;
}

.amg-content-hero__action--rich:hover,
.amg-content-hero__action--rich:focus-visible {
  background: #fff;
  transform: translateY(-2px);
  border-color: rgba(166, 226, 46, 0.8);
  box-shadow: 0 12px 24px rgba(166, 226, 46, 0.2);
}

.amg-content-hero__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
}

.amg-content-hero__action--primary.amg-content-hero__action--rich .amg-content-hero__action-icon {
  background: var(--accent-soft);
}

.amg-content-hero__action-icon svg {
  width: 21px;
  height: 21px;
}

.amg-content-hero__action-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
  line-height: 1.15;
}

.amg-content-hero__action-strong {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.amg-content-hero__action-sub {
  overflow: hidden;
  color: rgba(17, 24, 39, 0.55);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.amg-hero-brands {
  display: grid;
  gap: 10px;
  min-width: 0;
}

@media (max-width: 980px) {
  .amg-hero-brands {
    margin-top: 30px;
  }
}

.amg-hero-brands__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.amg-hero-brands__label {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.amg-hero-brands__arrows {
  display: inline-flex;
  gap: 6px;
}

.amg-hero-brands__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.amg-hero-brands__arrow svg {
  width: 15px;
  height: 15px;
}

.amg-hero-brands__arrow:hover:not(:disabled),
.amg-hero-brands__arrow:focus-visible:not(:disabled) {
  border-color: rgba(166, 226, 46, 0.7);
  background: rgba(166, 226, 46, 0.12);
  color: #fff;
}

.amg-hero-brands__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.amg-hero-brands__track {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 2px;
  list-style: none;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.amg-hero-brands__track::-webkit-scrollbar {
  display: none;
}

.amg-hero-brands__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.amg-hero-brands__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 108px;
  padding: 14px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.amg-hero-brands__tile:hover,
.amg-hero-brands__tile:focus-visible {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(166, 226, 46, 0.8);
  box-shadow: 0 10px 22px rgba(166, 226, 46, 0.18);
}

.amg-hero-brands__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}

.amg-hero-brands__logo img,
.amg-hero-brands__logo-img {
  height: 28px !important;
  width: auto !important;
  max-width: 80px;
  object-fit: contain;
}

.amg-hero-brands__logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.amg-hero-brands__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .post-type-archive-product .amg-content-hero {
    padding: 116px 0 44px;
  }

  .post-type-archive-product .amg-content-hero__title {
    font-size: 23px;
    line-height: 1.15;
  }

  /* The intro paragraph is SEO copy; keep it in the DOM (mobile-first
     indexing) but show phone users only a two-line teaser. */
  .post-type-archive-product .amg-content-hero__description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13.5px;
    line-height: 1.6;
  }

  /* Two CTA cards side by side (like the reference), not stacked pills. */
  .post-type-archive-product .amg-content-hero__actions {
    flex-direction: row;
    gap: 10px;
  }

  .post-type-archive-product .amg-content-hero__action--rich {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 8px 12px 8px 11px;
    gap: 10px;
  }

  .post-type-archive-product .amg-content-hero__action--rich .amg-content-hero__action-icon {
    width: 34px;
    height: 34px;
  }

  .post-type-archive-product .amg-content-hero__action--rich .amg-content-hero__action-strong {
    font-size: 14px;
  }

  .post-type-archive-product .amg-content-hero__action--rich .amg-content-hero__action-sub {
    font-size: 12px;
  }

  .amg-hero-brands {
    margin-top: 26px;
  }

  .amg-hero-brands__track {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  }
}

/* Tighter rhythm between the hero and the catalog on shop archives. */
.amg-shop-wrap.amg-wrap--after-hero {
  padding-top: 22px;
  gap: 14px;
}

/* Breadcrumbs above the catalog (first item of the .amg-shop-wrap grid). */
.amg-shop-breadcrumbs {
  margin-bottom: 0;
}

.woocommerce .amg-shop-breadcrumbs .woocommerce-breadcrumb,
.woocommerce-page .amg-shop-breadcrumbs .woocommerce-breadcrumb {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Coin quick-nav above the product grid: one slim scrollable chip row.
 * Ticker icons are drawn for dark backgrounds, so each sits in a small
 * dark badge.
 * ------------------------------------------------------------------ */
.amg-shop-coins-row {
  margin-bottom: 14px;
  min-width: 0;
}

.amg-shop-coins-row__list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 2px 0 4px;
  list-style: none;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}

.amg-shop-coins-row__list::-webkit-scrollbar {
  display: none;
}

.amg-shop-coins-row__list li {
  flex: 0 0 auto;
}

.amg-coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.amg-coin-chip:hover,
.amg-coin-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(154, 205, 50, 0.8);
  box-shadow: 0 6px 14px rgba(154, 205, 50, 0.16);
}

.amg-coin-chip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #16181d;
}

.amg-coin-chip__icon svg {
  width: 20px;
  height: 20px;
}

/* ------------------------------------------------------------------ *
 * Toolbar — a quiet meta-row: count on the left, sorting on the right.
 * No card chrome; it should barely register next to the product grid.
 * ------------------------------------------------------------------ */
.amg-shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 18px;
  padding: 0;
}

.woocommerce .amg-shop-toolbar .woocommerce-result-count,
.woocommerce-page .amg-shop-toolbar .woocommerce-result-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.woocommerce .amg-shop-toolbar .woocommerce-ordering,
.woocommerce-page .amg-shop-toolbar .woocommerce-ordering {
  margin: 0 0 0 auto;
}

.amg-shop-toolbar .orderby {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  padding: 0 36px 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.amg-shop-toolbar .orderby:hover,
.amg-shop-toolbar .orderby:focus-visible {
  border-color: var(--border);
  background-color: #fff;
  outline: none;
}

/* "Filters" trigger — desktop shows the sidebar instead, so the button only
   appears below 980px where the sidebar turns into a drawer. */
.amg-shop-toolbar__filters {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.amg-shop-toolbar__filters:hover,
.amg-shop-toolbar__filters:focus-visible {
  border-color: rgba(154, 205, 50, 0.8);
  box-shadow: 0 6px 16px rgba(154, 205, 50, 0.14);
  outline: none;
}

.amg-shop-toolbar__filters-count[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .amg-shop-toolbar__filters {
    display: inline-flex;
  }
}

.amg-shop-toolbar__filters-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.amg-shop-toolbar__filters-icon svg {
  width: 100%;
  height: 100%;
}

.amg-shop-toolbar__filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 680px) {
  .amg-shop-toolbar {
    gap: 10px 12px;
  }

  .woocommerce .amg-shop-toolbar .woocommerce-result-count,
  .woocommerce-page .amg-shop-toolbar .woocommerce-result-count {
    order: 3;
    width: 100%;
  }

  .woocommerce .amg-shop-toolbar .woocommerce-ordering,
  .woocommerce-page .amg-shop-toolbar .woocommerce-ordering {
    flex: 1;
  }

  .amg-shop-toolbar .orderby {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ *
 * Active-filter chips (between toolbar and grid).
 * ------------------------------------------------------------------ */
.amg-shop-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 18px;
}

.amg-shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(154, 205, 50, 0.55);
  border-radius: 999px;
  background: rgba(154, 205, 50, 0.12);
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.amg-shop-chip svg {
  width: 13px;
  height: 13px;
  color: rgba(17, 24, 39, 0.55);
}

.amg-shop-chip:hover,
.amg-shop-chip:focus-visible {
  border-color: rgba(231, 80, 60, 0.6);
  background: rgba(231, 80, 60, 0.08);
}

.amg-shop-chip--clear {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.amg-shop-chip--clear:hover,
.amg-shop-chip--clear:focus-visible {
  background: transparent;
  border-color: transparent;
  color: #c62828;
}

/* ------------------------------------------------------------------ *
 * Filter panel (desktop sidebar; turns into an off-canvas drawer ≤980px).
 * ------------------------------------------------------------------ */
.amg-shop-filters {
  display: grid;
  gap: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-1);
}

.amg-shop-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}

.amg-shop-filters__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.amg-shop-filters__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.amg-shop-filters__close svg {
  width: 16px;
  height: 16px;
}

.amg-shop-filters__group {
  border-top: 1px solid var(--border);
}

.amg-shop-filters__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 2px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.amg-shop-filters__summary::-webkit-details-marker {
  display: none;
}

.amg-shop-filters__summary::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 180ms ease;
}

.amg-shop-filters__group[open] > .amg-shop-filters__summary::after {
  transform: rotate(180deg);
}

.amg-shop-filters__selected-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-size: 11px;
  font-weight: 700;
}

.amg-shop-filters__body {
  display: grid;
  gap: 2px;
  padding: 2px 0 14px;
}

.amg-shop-filters__body--scroll {
  max-height: 236px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.amg-shop-filters__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.amg-shop-filters__option:hover {
  background: var(--surface);
}

.amg-shop-filters__option input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #9acd32;
  cursor: pointer;
}

.amg-shop-filters__option-name {
  color: #111827;
  line-height: 1.3;
}

.amg-shop-filters__option-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.amg-shop-filters__price {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amg-shop-filters__price-field {
  flex: 1;
  min-width: 0;
}

.amg-shop-filters__price input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.amg-shop-filters__price input::-webkit-outer-spin-button,
.amg-shop-filters__price input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.amg-shop-filters__price-sep {
  color: var(--muted);
}

.amg-shop-filters__price-go {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.amg-shop-filters__price-go:hover {
  background: var(--accent-2);
}

.amg-shop-filters__actions {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.amg-shop-filters__apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.amg-shop-filters__apply:hover,
.amg-shop-filters__apply:focus-visible {
  background: var(--accent-2);
}

.amg-shop-filters__reset {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.amg-shop-filters__reset:hover,
.amg-shop-filters__reset:focus-visible {
  color: #c62828;
}

.amg-shop-filters__no-results-reset {
  margin: 12px 0 0;
}

.amg-shop-filters-backdrop[hidden] {
  display: none;
}

/* Desktop sidebar: keep it scrollable within the viewport while sticky. */
@media (min-width: 981px) {
  .amg-shop-sidebar {
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* With the sidebar taking 280px, three columns fit the content area best. */
.amg-shop-layout .amg-shop-content ul.products {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .amg-shop-layout .amg-shop-content ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ≤980px the sidebar leaves the flow (drawer), grid gets the full width back. */
@media (max-width: 980px) {
  .amg-shop-layout .amg-shop-content ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .amg-shop-layout .amg-shop-content ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .amg-shop-layout .amg-shop-content ul.products {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ *
 * Mobile / tablet: sidebar becomes an off-canvas drawer.
 * ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .amg-shop-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    width: min(380px, 88vw);
    height: 100dvh;
    margin: 0;
    padding: 18px 16px 28px;
    overflow-y: auto;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.3);
    transform: translateX(-105%);
    transition: transform 240ms ease;
  }

  body.amg-filters-open .amg-shop-sidebar {
    transform: translateX(0);
  }

  .amg-shop-sidebar .amg-shop-filters {
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .amg-shop-filters__close {
    display: inline-flex;
  }

  .amg-shop-filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(17, 24, 39, 0.5);
  }

  body.amg-filters-open {
    overflow: hidden;
  }
}
