/**
 * Spirit Store: the product grid. Forked from the activities tile grid so a
 * store card and a fundraising card read as the same family; theme-token
 * fallbacks keep the module presentable on any theme.
 */

.rt-store-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 24px;
  max-width: var(--rt-maxw, 1120px);
  margin: 0 auto;
}
@media (min-width: 760px) {
  .rt-store-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .rt-store-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rt-store-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 10px);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--rt-shadow, 0 6px 24px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rt-store-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rt-shadow-lift, 0 10px 24px rgba(0, 0, 0, 0.12));
}

/* Artwork band: the product's own photo, or a branded fallback. */
.rt-store-art {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 150px;
  background-color: var(--rt-black, #141414);
  /* Product art over the brand mark: if the remote image is absent or fails,
     the mark shows through instead of an empty black band. */
  background-image: var(--rt-store-art, none), var(--rt-banner-logo, none);
  background-size: cover, 45%;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
/* No artwork: a slim branded strip instead of a tall empty rectangle. */
.rt-store-art--slim {
  aspect-ratio: auto;
  min-height: 0;
  height: 72px;
  background-image: var(--rt-banner-logo, none);
  background-size: auto 54px;
  background-position: right 16px center;
  background-color: var(--rt-black, #141414);
  box-shadow: inset 0 -3px 0 var(--rt-primary, #f4b41c);
}

.rt-store-body {
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rt-store-name {
  margin: 0 0 4px;
  font-family: var(--rt-font-display, "RT Display", "Arial Narrow", sans-serif);
  font-weight: var(--rt-font-display-weight, 400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.25rem;
}
.rt-store-name a {
  color: inherit;
  text-decoration: none;
}
.rt-store-name a:hover {
  text-decoration: underline;
}

/* The art band's link wrapper must not add anchor styling around a div. */
.rt-store-artlink {
  display: block;
  line-height: 0;
}

/* Secondary rather than primary for the numerals: primary is a light brand
   accent on Henry-family palettes, and a price has to be readable text. */
.rt-store-price {
  margin: 0 0 8px;
  color: var(--rt-secondary, #d99a00);
  font-weight: 700;
  font-size: 1.02rem;
}

.rt-store-ctas {
  margin-top: auto;
  padding-top: 12px;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Same visual language as the activities lens buttons (.rt-act-btn),
   including the !important that outguns page-builder link colors. The button
   element needs the extra resets an anchor never did. */
.rt-store-btn {
  display: inline-block;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--rt-primary, #f4b41c);
  color: var(--rt-on-primary, #141414) !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
}
.rt-store-btn:hover {
  background: var(--rt-secondary, #d99a00);
}

/* Size / option picker next to the Add to Cart button. */
.rt-store-variations {
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 8px);
  background: #fff;
  font-size: 0.9rem;
}

/* Sold out: same quiet chip as a closed activity. */
.rt-store-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rt-line, #e7e2d6);
  color: var(--rt-gray, #6b6b6b);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Category filter chips ------------------------------------------------ */

.rt-store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--rt-maxw, 1120px);
  margin: 0 auto 20px;
}

.rt-store-chipbtn {
  padding: 6px 16px;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: 999px;
  background: #fff;
  color: var(--rt-ink, #1f1f1f);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}
.rt-store-chipbtn:hover {
  border-color: var(--rt-secondary, #d99a00);
}
.rt-store-chipbtn.is-active {
  background: var(--rt-primary, #f4b41c);
  border-color: var(--rt-primary, #f4b41c);
  color: var(--rt-on-primary, #141414);
  font-weight: 700;
}

/* A chip filtered this card out. */
.rt-store-card.is-filtered {
  display: none;
}

/* ---- Quantity stepper (grid cards and detail page) ------------------------ */

.rt-store-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rt-store-stepbtn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: 999px;
  background: #fff;
  color: var(--rt-ink, #1f1f1f);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.rt-store-stepbtn:hover {
  background: var(--rt-primary, #f4b41c);
  color: var(--rt-on-primary, #141414);
}

.rt-store-qty {
  width: 52px;
  padding: 6px 8px;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 8px);
  background: #fff;
  font: inherit;
  text-align: center;
}

/* ---- Modifier groups (detail page) ---------------------------------------- */

.rt-store-mods {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 6px;
}

.rt-store-mod-group {
  margin: 0;
  padding: 10px 14px 12px;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 10px);
}
.rt-store-mod-group legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 0.9rem;
}
/* A MULTIPLE group whose min/max is not met yet, flagged on Add. */
.rt-store-mod-group.is-short {
  border-color: #b32d2e;
}

.rt-store-mod {
  display: block;
  margin: 4px 0;
}
.rt-store-mod input {
  margin-right: 6px;
}

/* ---- Store policies -------------------------------------------------------- */

.rt-store-policies {
  max-width: var(--rt-maxw, 1120px);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--rt-line, #e7e2d6);
}

.rt-store-policies-heading {
  margin: 0 0 6px;
  font-family: var(--rt-font-display, "RT Display", "Arial Narrow", sans-serif);
  font-weight: var(--rt-font-display-weight, 400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.3rem;
}

.rt-store-policy h3 {
  margin: 14px 0 4px;
  font-size: 1rem;
}
.rt-store-policy p {
  margin: 0 0 10px;
}

/* ---- Product detail page --------------------------------------------------- */

.rt-store-detail-page {
  padding: 24px 16px 48px;
}

.rt-store-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  width: 100%;
  max-width: var(--rt-maxw, min(1440px, 94vw));
  margin: 0 auto;
}
@media (min-width: 900px) {
  .rt-store-detail {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    align-items: start;
    gap: 40px;
  }
}

.rt-store-gallery-main {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--rt-line, #e7e2d6);
  border-radius: var(--rt-radius, 10px);
  background: #fff;
}

.rt-store-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.rt-store-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  line-height: 0;
  cursor: pointer;
}
.rt-store-thumb img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.rt-store-thumb.is-active {
  border-color: var(--rt-primary, #f4b41c);
}

.rt-store-detail-name {
  margin: 0 0 8px;
  font-family: var(--rt-font-display, "RT Display", "Arial Narrow", sans-serif);
  font-weight: var(--rt-font-display-weight, 400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--rt-black, #141414);
}

.rt-store-detail .rt-store-price {
  font-size: 1.3rem;
}

.rt-store-detail-desc {
  margin: 0 0 20px;
}

.rt-store-detail-ctas {
  padding-top: 4px;
}

.rt-store-back {
  margin: 28px 0 0;
}
.rt-store-back a {
  color: var(--rt-ink, #1f1f1f);
  font-weight: 600;
  text-decoration: none;
}
.rt-store-back a:hover {
  text-decoration: underline;
}

/* Foreign themes may not define WordPress's screen-reader-text helper. */
.rt-store-detail .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Standalone scope (foreign theme): match the site's heading face, as the
   other modules' standalone scopes do, and supply the type scaffold the
   fallback detail template gets from no theme. */
.rt-store-standalone .rt-store-name {
  font-family: Oswald, Helvetica, Arial, sans-serif;
}
.rt-store-standalone.rt-store-detail-page {
  font-family: var(--rt-font, "Helvetica Neue", Arial, "Segoe UI", system-ui, sans-serif);
  color: var(--rt-ink, #1f1f1f);
  line-height: 1.6;
}
.rt-store-standalone .rt-store-detail-name,
.rt-store-standalone .rt-store-policies-heading {
  font-family: Oswald, Helvetica, Arial, sans-serif;
}
