/* ============================================================================
   Generic apparel generator — shared styles for /generator/text-apparel and
   /generator/graphic-apparel. Extracted from text-apparel.astro's original
   inline block (Text pass) when the Graphic pass needed the same surface.
   Classes are .rs-ga-* (generic apparel). Tokens (--rs-*) come from
   Layout.astro's global :root.
   ============================================================================ */

/* --- Header band ------------------------------------------------------- */
.rs-ga-hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: center;
  padding: 32px 32px 24px;
  background: var(--rs-black);
  color: var(--rs-white);
}
.rs-ga-breadcrumb { font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: #b8b8b8; margin: 0 0 12px; }
.rs-ga-breadcrumb a { color: #b8b8b8; }
.rs-ga-breadcrumb a:hover { color: var(--rs-white); }
.rs-ga-breadcrumb span[aria-current] { color: var(--rs-white); }
.rs-ga-title { font-family: var(--rs-font-display); font-size: 52px; line-height: 0.95; text-transform: uppercase; margin: 0 0 12px; }
.rs-ga-tagline { font-size: 15px; color: #d6d6d6; margin: 0; max-width: 46ch; }
.rs-ga-tagline a { color: var(--rs-white); text-decoration: underline; margin-left: 6px; }
.rs-ga-hero__photo { height: 190px; overflow: hidden; border-radius: 10px; }
.rs-ga-hero__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 900px) {
  .rs-ga-hero { grid-template-columns: 1fr; }
  .rs-ga-hero__photo { display: none; }
  .rs-ga-title { font-size: 40px; }
}

/* --- Three-column layout --------------------------------------------------- */
.rs-ga-layout {
  display: grid;
  grid-template-columns: 250px 1fr 340px;
  gap: 32px;
  align-items: start;
  padding: 32px;
}
.rs-ga-side { min-width: 0; }
.rs-ga-main { min-width: 0; }
.rs-ga-panel { position: sticky; top: 20px; }
@media (max-width: 1100px) {
  .rs-ga-layout { grid-template-columns: 1fr 320px; }
  .rs-ga-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
}
@media (max-width: 760px) {
  .rs-ga-layout { grid-template-columns: 1fr; }
  .rs-ga-panel { position: static; }
  .rs-ga-side { grid-template-columns: 1fr; }
}

/* --- Shared panel / tile / toggle language ------------------------------- */
.rs-gen-panel {
  background: var(--rs-white);
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
}
.rs-gen-panel__heading { font-size: 15px; font-weight: bold; margin: 0 0 4px; }
.rs-gen-panel__hint { font-size: 12px; color: var(--rs-gray); margin: 0 0 14px; }
.rs-ga-muted { color: var(--rs-gray); font-weight: normal; }

.rs-thumb-grid { display: grid; gap: 8px; }
.rs-thumb-grid--3 { grid-template-columns: repeat(3, 1fr); }
.rs-thumb-card {
  position: relative;
  display: block;
  padding: 4px;
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  border-radius: 8px;
  background: var(--rs-white);
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rs-thumb-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; background: var(--rs-white); border-radius: 4px; }
.rs-thumb-card:hover { border-color: var(--rs-red); }
.rs-thumb-card--active { border-color: var(--rs-red); border-width: 2px; padding: 3px; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(200, 16, 46, 0.18); }
.rs-thumb-card--active::after {
  content: "\2713";
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--rs-red); color: var(--rs-white);
  font-size: 12px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.rs-toggle { display: flex; border: 1px solid var(--rs-line); box-shadow: var(--rs-card-shadow); width: fit-content; border-radius: 8px; overflow: hidden; }
.rs-toggle__btn { border: none; background: var(--rs-white); padding: 10px 20px; font-size: 13px; cursor: pointer; color: var(--rs-black); }
.rs-toggle__btn + .rs-toggle__btn { border-left: 1px solid var(--rs-line); }
.rs-toggle__btn--active { background: var(--rs-black); color: var(--rs-white); }

/* --- Left sidebar: category list (Text: message cats; Graphic: back-link view) --- */
.rs-ga-catlist { display: flex; flex-direction: column; gap: 6px; }
.rs-ga-cat {
  text-align: left;
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  background: var(--rs-white);
  color: var(--rs-black);
  padding: 11px 14px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.rs-ga-cat:hover { border-color: var(--rs-red); }
.rs-ga-cat--active { background: var(--rs-red); border-color: var(--rs-red); color: var(--rs-white); }

.rs-ga-catcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  border-radius: 10px;
  background: var(--rs-white);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.rs-ga-catcard:hover, .rs-ga-catcard:focus-visible { border-color: var(--rs-red); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
.rs-ga-catcard img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--rs-offwhite); }
.rs-ga-catcard span { padding: 8px 10px; font-size: 12px; font-weight: bold; letter-spacing: 0.3px; }
.rs-ga-catgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.rs-ga-backlink {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 0; margin-bottom: 8px;
  background: none; border: none;
  color: var(--rs-red); font-weight: bold; font-size: 13px; letter-spacing: 0.3px;
  cursor: pointer;
}
.rs-ga-backlink:hover, .rs-ga-backlink:focus-visible { text-decoration: underline; }

/* --- Info box ------------------------------------------------------------ */
.rs-ga-infobox {
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 12.5px;
  color: var(--rs-gray);
  line-height: 1.5;
}
.rs-ga-infobox p { margin: 0 0 8px; }
.rs-ga-infobox p:last-child { margin: 0; }
.rs-ga-infobox__link { color: var(--rs-red); font-weight: bold; }

/* --- Card grid --------------------------------------------------------- */
.rs-ga-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .rs-ga-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .rs-ga-cards { grid-template-columns: 1fr; } }

.rs-ga-card {
  position: relative;
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  border-radius: 10px;
  background: var(--rs-white);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rs-ga-card:hover { border-color: var(--rs-red); }
.rs-ga-card--active { border-color: var(--rs-red); border-width: 2px; padding: 9px; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(200, 16, 46, 0.18); }
.rs-ga-card--active::after {
  content: "\2713";
  position: absolute; top: -9px; right: -9px;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--rs-red); color: var(--rs-white);
  font-size: 13px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.rs-ga-card__media {
  background: var(--rs-offwhite);
  border-radius: 6px;
  min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.rs-ga-card__media canvas { max-width: 100%; height: auto; }
.rs-ga-card__title {
  font-family: var(--rs-font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 10px 2px 8px;
}

/* --- Colour/size selector (the ONE control, under the Preview) ----------
   2026-09-04: used to be rendered per-card into the grid; now lives once in
   #ag-preview-options (generic-apparel-ui.js's renderPreviewOptions()) and
   always drives the active design. .rs-ga-optrow / .rs-ga-swatches /
   .rs-ga-sizes are unscoped (never nested under .rs-ga-card), so they carry
   over unchanged into their new home. */
.rs-ga-preview-options { margin: 12px 18px 0; }
.rs-ga-optrow { margin: 8px 2px 0; }
.rs-ga-optrow__label { display: block; font-size: 10.5px; font-weight: bold; letter-spacing: 0.6px; text-transform: uppercase; color: var(--rs-gray); margin-bottom: 5px; }
.rs-ga-swatches, .rs-ga-sizes { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-ga-swatch {
  width: 22px; height: 22px; border-radius: 999px;
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px var(--rs-line);
  padding: 0;
  cursor: pointer;
  transition: box-shadow 0.12s, transform 0.12s;
}
.rs-ga-swatch--bordered { box-shadow: 0 0 0 1px var(--rs-line) inset, 0 0 0 1px var(--rs-line); }
.rs-ga-swatch:hover { transform: scale(1.08); }
.rs-ga-swatch--active { box-shadow: 0 0 0 2px var(--rs-white), 0 0 0 4px var(--rs-red); }
.rs-ga-size {
  min-width: 30px;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid var(--rs-line);
  background: var(--rs-white);
  color: var(--rs-black);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.rs-ga-size:hover { border-color: var(--rs-red); }
.rs-ga-size--active { background: var(--rs-black); border-color: var(--rs-black); color: var(--rs-white); }
.rs-ga-size--soon { cursor: not-allowed; opacity: 0.4; }
.rs-ga-size--soon:hover { border-color: var(--rs-line); }

/* --- Right panel ------------------------------------------------------- */
.rs-gen-panel--preview { padding: 0; overflow: hidden; }
.rs-gen-preview-bar {
  background: var(--rs-black);
  color: var(--rs-white);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 18px;
}
.rs-ga-garment { margin: 16px 18px 0; }
.rs-gen-panel--preview .stage { border: none; border-radius: 0; }
.stage {
  width: 100%;
  min-height: 360px;
  background: var(--rs-offwhite);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.stage canvas { max-width: 100%; height: auto; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); }
.rs-gen-status { min-height: 16px; font-size: 12px; color: var(--rs-gray); margin: 8px 18px 0; text-align: center; }

/* 2026-09-04 layout move: name ABOVE the stage (first child of a padding:0
   panel, hence its own top margin), price BELOW the colour/size selector.
   Previously one combined ".rs-ga-variant" line -- now two elements, same
   visual weight split between them (name identifies the item, price is
   what people actually scan for). */
.rs-ga-name { font-size: 15px; font-weight: bold; text-align: center; margin: 18px 18px 10px; }
.rs-ga-price { font-size: 17px; font-weight: bold; text-align: center; margin: 12px 18px 2px; }
.rs-ga-variant-note { font-size: 11px; color: var(--rs-gray); text-align: center; margin: 0 18px 14px; }

.rs-ga-cta {
  display: block;
  width: calc(100% - 36px);
  margin: 0 18px 12px;
  text-align: center;
  padding: 15px;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.rs-ga-cta:disabled { opacity: 0.45; cursor: not-allowed; }
.rs-ga-cart-note { display: block; font-size: 12px; color: var(--rs-gray); text-align: center; text-decoration: underline; margin: 0 18px 14px; }
.rs-ga-cart-note:hover { color: var(--rs-red); }

/* --- AYO box -------------------------------------------------------------
   2026-09-04: moved to sit directly above the Add to Cart button (was
   below it). Shown for Text/RDT always, and for Graphic/RHN per-design --
   see apparel-generator.js's hasApparelAyo(). */
.rs-ga-ayo {
  border: 1px dashed var(--rs-line);
  border-radius: 10px;
  margin: 8px 18px 16px;
  padding: 14px;
  background: var(--rs-offwhite);
}
.rs-ga-ayo__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rs-ga-ayo__plus {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--rs-gray); color: var(--rs-white);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: bold; flex-shrink: 0;
}
.rs-ga-ayo__title { font-size: 13px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.4px; }
.rs-ga-ayo__price { margin-left: auto; font-size: 14px; font-weight: bold; color: var(--rs-red); }
.rs-gen-textarea {
  width: 100%;
  border: 1px solid var(--rs-line);
  box-shadow: var(--rs-card-shadow);
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
  box-sizing: border-box;
}
.rs-gen-textarea:focus { outline: none; border-color: var(--rs-red); }
.rs-ga-ayo__cta { display: block; width: 100%; margin-top: 10px; text-align: center; padding: 11px; font-size: 12px; }

.rs-btn-primary {
  background: var(--rs-red);
  color: var(--rs-white);
  font-weight: bold;
  border: none;
  cursor: pointer;
}
.rs-btn-primary:hover { background: var(--rs-red-dark); }
.rs-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.rs-btn-secondary {
  background: var(--rs-white);
  color: var(--rs-black);
  font-weight: bold;
  border: 1px solid var(--rs-black);
  cursor: pointer;
}
.rs-btn-secondary:hover { border-color: var(--rs-red); color: var(--rs-red); }
.rs-btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
