/* Collection page — hydrates #mq-collection-shell. Layout:
     [full-width banner]
       ↓
     [inner: tabs] [toolbar: count | sort] [grid]
   Grid layout itself is inherited from product-grid.css via
   .mq-home-product-grid. */

#mq-collection-shell {
  background: #ffffff;
  color: #131917;
  padding: 0 0 80px 0;             /* banner is edge-to-edge; inner has its own side padding */
  font-family: var(--font-body--family);
}
.mq-collection-loading {
  text-align: center;
  color: rgba(19, 25, 23, 0.6);
  padding: 60px 0;
}

/* ---- Banner --------------------------------------------------------- */
.mq-collection-banner {
  position: relative;
  width: 100%;
  min-height: 343px;
  padding: 56px 4vw;
  display: flex;
  align-items: center;
  color: #ffffff;
  overflow: hidden;
  /* Fallback: brand-tokened dark gradient with a subtle orange glow.
     Overridden by inline background-image when a collection image is set. */
  background-color: #131917;
  background-image:
    radial-gradient(circle at 82% 50%, rgba(241, 90, 39, 0.22), transparent 60%),
    linear-gradient(135deg, #131917 0%, #1f2420 100%);
  background-size: cover;
  background-position: center 20%;   /* shifts image content ~30% down within the frame */
}
/* When an image URL is set via inline style, the two backgrounds stack:
   inline `background-image: url(...)` wins for the image; we layer a dark
   overlay via .mq-collection-banner__overlay for text legibility. */
.mq-collection-banner--has-image {
  background-image: none;          /* inline style provides the url() */
  background-color: #1f2420;
}
.mq-collection-banner--has-image .mq-collection-banner__overlay {
  opacity: 1;
}
.mq-collection-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(19, 25, 23, 0.72) 0%,
    rgba(19, 25, 23, 0.45) 100%
  );
  opacity: 0;                      /* only shown when has-image */
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mq-collection-banner__inner {
  position: relative;              /* above the overlay */
  z-index: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mq-collection-banner__title {
  font-family: var(--font-heading--family);
  font-weight: var(--font-heading--weight);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}
.mq-collection-banner__desc {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 640px;
}

/* ---- Inner container (constrains tabs / toolbar / grid) ------------- */
.mq-collection__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 4vw 0;
}

/* Slot into which the shared tabs component is injected. Keeps the tabs
   spacing consistent with the rest of the layout without extending their
   underline rail full-width. */
.mq-collection__tabs-slot .mq-collection-tabs {
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(19, 25, 23, 0.08);
}

/* ---- Toolbar (count + sort) ---------------------------------------- */
.mq-collection__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px 0;
}
.mq-collection__count {
  font-size: 13px;
  letter-spacing: 0.05em;
  color: rgba(19, 25, 23, 0.6);
  text-transform: uppercase;
}
.mq-collection__sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  cursor: pointer;
}
.mq-collection__sort-label {
  font-size: 13px;
  color: rgba(19, 25, 23, 0.6);
}
.mq-collection__sort-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(19, 25, 23, 0.15);
  background: #ffffff;
  color: #131917;
  font-family: var(--font-body--family);
  font-size: 13px;
  padding: 8px 32px 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23131917' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 200px;
}
.mq-collection__sort-select:hover  { border-color: rgba(19, 25, 23, 0.35); }
.mq-collection__sort-select:focus  { outline: 2px solid #F15A27; outline-offset: 2px; }

/* ---- Grid ---------------------------------------------------------- */
.mq-collection__grid {
  margin: 0 auto;
}

/* ---- Mobile -------------------------------------------------------- */
@media (max-width: 749px) {
  .mq-collection-banner {
    min-height: 238px;
    padding: 36px 20px;
  }
  .mq-collection-banner__title {
    font-size: clamp(26px, 7vw, 34px);
  }
  .mq-collection-banner__desc  {
    font-size: 14px;
  }
  .mq-collection__inner {
    padding: 24px 20px 0;
  }
  .mq-collection__toolbar {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }
  .mq-collection__sort-select {
    min-width: 160px;
    font-size: 16px;     /* a11y audit item 1: kill iOS Safari auto-zoom on focus */
    min-height: 44px;    /* item 7 rider: matches touch-target min */
  }
}

/* ---- Skeleton bits ------------------------------------------------- */
.mq-skel {
  background: linear-gradient(90deg, #eeeeee 0%, #f6f6f6 50%, #eeeeee 100%);
  background-size: 200% 100%;
  animation: mq-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
.mq-skel--collection-title { height: 40px; width: 40%; }
.mq-skel--collection-desc  { height: 18px; width: 60%; margin-top: 8px; }
@keyframes mq-skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mq-skel { animation: none; background: #f0f0f0; }
}

/* ---- Legacy header selectors kept only so skeleton renders during
       first paint (JS builds the shell shortly after). --------------- */
.mq-collection__header       { display: none; }

/* ---- Error / not-found (grid-scoped now) -------------------------- */
.mq-collection-error {
  text-align: center;
  padding: 80px 20px;
  max-width: 640px;
  margin: 0 auto;
  border: 1px dashed rgba(19, 25, 23, 0.2);
  border-radius: 8px;
  color: rgba(19, 25, 23, 0.75);
}
.mq-collection-error p    { margin: 0 0 16px 0; font-size: 15px; }
.mq-collection-error code {
  background: rgba(19, 25, 23, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}
.mq-collection-error__retry {
  padding: 8px 20px;
  border: 1px solid #131917;
  background: transparent;
  color: #131917;
  border-radius: 4px;
  font-family: var(--font-body--family);
  font-size: 13px;
  cursor: pointer;
  margin-right: 8px;
}
.mq-collection-error__retry:hover { background: #131917; color: #ffffff; }
.mq-collection-error__back {
  color: #131917;
  font-size: 13px;
  text-decoration: underline;
}
