/* Gear — physical merch shop page that links out to Etsy.
   Reuses global.css tokens (--color-*, --radius-*, --shadow-*, --nav-height). */

/* ---- Hero (gradient banner + wordmark) ---- */
.gear-hero {
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-aqua) 100%); /* green -> teal */
  text-align: center;
  padding: 2.75rem 0 2.25rem;
}
.gear-hero h1 {
  margin: 0;
  line-height: 1;
}
.gear-hero h1 .hero-title-img {
  width: auto;
  max-width: min(360px, 85%);
  max-height: 120px;
}
.gear-hero p {
  max-width: 42rem;
  margin: 1rem auto 0;
  color: var(--color-text);
  font-size: 1.1rem;
  line-height: 1.5;
}

/* ---- Category filter pills (injected by gear.js) ---- */
.gear-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 1.75rem;
}
.gear-pill {
  background: var(--color-footer-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gear-pill:hover {
  border-color: var(--color-accent);
}
.gear-pill:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.gear-pill[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

/* Shown when a category has nothing in it, and as the no-JS fallback. */
.gear-empty {
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--color-text-light);
}
.gear-empty a {
  color: var(--color-accent);
}

/* ---- Product grid ---- */
.gear-grid-wrap {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  /* Bottom padding leaves the corner mascot a band of its own, so it never
     sits on top of the last row of cards on a short catalogue. */
  padding: 0 1.25rem 11rem;
}
.gear-grid {
  display: grid;
  /* auto-fill, not auto-fit: with the category filter a row can hold a single
     card, and auto-fit would collapse the empty tracks and blow that one card
     up to the full width of the grid. */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* ---- Product card ---- */
.gear-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.gear-card:hover,
.gear-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.gear-card:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Square thumbnail so mixed product shapes line up. */
.gear-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eaf7f5;
}
.gear-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gear-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.2rem;
  flex: 1 1 auto;
}

/* Category tag badge. */
.gear-card-tag {
  align-self: flex-start;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.gear-card-tag--apparel   { background: var(--color-aqua); }
.gear-card-tag--stickers  { background: var(--color-pink); }
.gear-card-tag--notebooks { background: var(--color-purple); }
.gear-card-tag--bags      { background: var(--color-blue); }

.gear-card-name {
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.25;
}
.gear-card-price {
  font-weight: 700;
  color: var(--color-text-light);
  font-size: 1rem;
}
.gear-card-cta {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: 800;
  font-size: 0.95rem;
  transition: filter 0.15s;
}
.gear-card:hover .gear-card-cta {
  filter: brightness(1.08);
}
.gear-card-cta::after {
  content: " \2197";
}

/* ---- Apparel: the card is a button that opens the size picker ---- */
button.gear-card {
  width: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gear-card-sizes {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-light);
}
.gear-card--variants .gear-card-cta::after {
  content: none;
}

/* ---- Size picker window ---- */
.gear-dialog {
  /* The site-wide reset zeroes margins, which would pin a modal dialog to the
     top-left corner instead of centring it. */
  margin: auto;
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  color: var(--color-text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.gear-dialog::backdrop {
  background: rgba(30, 30, 40, 0.55);
}
.gear-dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-white);
  color: var(--color-text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.gear-dialog-close:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.gear-dialog-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.gear-dialog-thumb {
  display: block;
  aspect-ratio: 1 / 1;
  background: #eaf7f5;
}
.gear-dialog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gear-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
}
.gear-dialog-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}
.gear-dialog-prompt {
  margin: 0.25rem 0 0.25rem;
  font-weight: 700;
  color: var(--color-text-light);
}
.gear-dialog-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.gear-dialog-option {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label price" "go go";
  gap: 0.35rem 0.5rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--color-footer-bg);
  border-radius: var(--radius-md, 14px);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.gear-dialog-option:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.gear-dialog-option:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.gear-dialog-option-label {
  grid-area: label;
  font-weight: 800;
  font-size: 1.1rem;
}
.gear-dialog-option-price {
  grid-area: price;
  font-weight: 700;
  color: var(--color-text-light);
}
.gear-dialog-option-go {
  grid-area: go;
  justify-self: start;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: 800;
  font-size: 0.9rem;
}
.gear-dialog-option-go::after {
  content: " \2197";
}

/* ---- Mae corner character ---- */
.mae-corner {
  position: absolute;
  bottom: 0;
  right: 0;
  /* This pose is a narrow 1:2.06 standing figure, where the other pages'
     corner characters are a wider 1:1.45. Sized by height rather than width
     so Mae reads the same size here as she does elsewhere on the site. */
  width: 115px;
  pointer-events: none;
}
@media (max-width: 600px) {
  .mae-corner {
    width: 86px;
  }
  /* Stack the size picker: photo on top, choices below. */
  .gear-dialog-inner {
    grid-template-columns: 1fr;
  }
  .gear-dialog-thumb {
    aspect-ratio: 16 / 10;
    background: var(--color-white);
  }
  .gear-dialog-thumb img {
    object-fit: contain;
  }
  .gear-grid-wrap {
    padding-bottom: 8rem;
  }
}
