/* Runners Garage Sale — seller pages (garage.html) and admin (garage-admin.html).
   Mobile first: the seller flow is built for a phone and simply centres in a
   narrow column on a desktop. Same type, colours and rules as checkout. */

.garage {
  --g-line: rgba(0, 0, 0, 0.2);
  --g-muted: #6b6b6b;
  --g-soft: #3d3d3d;
  --g-tint: #f1effa;
  --g-gray: #ededed;
  --g-yellow: #f3e7a6;
  --g-red: #8a1c00;
  --g-red-bg: #fbe3dd;
  --g-green-bg: #e3f1e6;
  --g-green: #14532d;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 1.5rem var(--side-pad, 1.25rem) 9rem;
  font-size: 1rem;
  line-height: 1.45;
}

.garage *,
.garage *::before,
.garage *::after {
  box-sizing: border-box;
}

.garage p { margin: 0; }
.garage h1, .garage h2 { margin: 0; }

.garage__loading { color: var(--g-muted); }

.g-stack { display: flex; flex-direction: column; gap: 1.75rem; }
.g-stack--tight { gap: 0.75rem; }
.g-stack--s { gap: 0.4rem; }

.g-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.05;
}

.g-lead { font-size: 0.9rem; color: var(--g-soft); }
.g-small { font-size: 0.78rem; color: var(--g-muted); }
.g-center { text-align: center; }

.g-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-muted);
}

/* Event block on the welcome screen — same as the top of the event page. */
.g-event { text-align: center; }
.g-event__title { font-size: 1.35rem; font-weight: 700; font-style: italic; line-height: 1.05; margin-bottom: 0.6rem; }
.g-event__meta { font-size: 1rem; line-height: 1.3; }
.g-event__poster { display: block; width: 100%; height: auto; margin-top: 1.5rem; }

/* Buttons */
.g-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1.25rem;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}

.g-btn:disabled { opacity: 0.5; cursor: default; }
.g-btn--ghost { background: var(--white); color: var(--black); border-color: var(--black); }
.g-btn--danger { background: var(--g-red); border-color: var(--g-red); }
.g-btn--danger-ghost { background: var(--white); color: var(--g-red); border-color: var(--g-red); }
.g-btn--small { min-height: 2.5rem; width: auto; font-size: 0.85rem; padding: 0 0.9rem; }
.g-btn--strava { background: #fc5200; border-color: #fc5200; font-size: 1.2rem; text-transform: none; letter-spacing: 0; min-height: 3.5rem; }
.g-btn--google { background: var(--white); color: var(--black); border-color: var(--black); font-size: 1.05rem; text-transform: none; letter-spacing: 0; min-height: 3.5rem; }

.g-link { color: var(--navy); }

/* Sticky action bar at the bottom of a screen */
.g-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--white);
  border-top: 1px solid var(--g-line);
  padding: 0.75rem var(--side-pad, 1.25rem) calc(1rem + env(safe-area-inset-bottom, 0px));
}

.g-bar__inner {
  max-width: 34rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Back link */
.g-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.75rem;
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Forms */
.g-field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; border: 0; padding: 0; margin: 0; }
.g-field > label, .g-field > legend, .g-field__label { font-size: 0.82rem; font-weight: 500; padding: 0; }

.g-input,
.g-select {
  width: 100%;
  height: 3rem;
  padding: 0 0.9rem;
  border: 1px solid var(--g-line);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 1rem; /* ≥16px so iOS doesn't zoom in */
}

.g-input:focus, .g-select:focus, .g-textarea:focus { outline: 2px solid var(--navy); outline-offset: -1px; }

/* Phone fields: intl-tel-input wraps the .g-input in .iti and puts the flag and
   "+34" over its left side. Restyled to match the form; the country list is
   mounted on <body> on phones, hence .page--garage rather than .garage. */
.page--garage {
  --iti-border-color: var(--g-line);
  --iti-hover-color: var(--g-tint);
  --iti-icon-color: var(--black);
  --iti-country-selector-bg: var(--white);
}
.page--garage .iti { display: block; width: 100%; }
.page--garage .iti input.g-input { font-size: 1rem; }
.page--garage .iti__country-selector,
.page--garage .iti__search-input { border-radius: 0; font-family: inherit; }
.page--garage .iti__search-input { font-size: 1rem; }
.page--garage .iti__selected-dial-code { color: var(--black); }
.g-money:focus-within { outline: 2px solid var(--navy); outline-offset: -1px; }
.g-money input:focus { outline: none; }

.g-textarea {
  width: 100%;
  min-height: 5.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--g-line);
  border-radius: 0;
  font: inherit;
  font-size: 1rem;
  resize: vertical;
}

.g-select-wrap { position: relative; }
.g-select { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; }
.g-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.g-money { display: flex; align-items: center; border: 1px solid var(--g-line); height: 3rem; }
.g-money span { padding-left: 0.9rem; font-weight: 700; }
.g-money input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; padding: 0 0.9rem 0 0.4rem; font: inherit; font-size: 1rem; background: transparent; }

.g-hint { font-size: 0.75rem; line-height: 1.45; color: var(--g-muted); }
.g-error { font-size: 0.8rem; color: var(--g-red); font-weight: 500; }
.g-error[hidden] { display: none; }
/* Classes like .g-stack and .g-check set display, and author rules beat the UA
   [hidden] rule, so without this `hidden` silently does nothing on them. */
.garage [hidden] { display: none !important; }

.g-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }

.g-legend {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-muted);
  margin-bottom: 0.9rem;
  padding: 0;
}

.g-section { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }

/* Option cards (radio / checkbox) */
.g-options { display: flex; flex-direction: column; gap: 0.5rem; }

.g-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--g-line);
  background: var(--white);
  cursor: pointer;
}

.g-option:has(input:checked) { border-color: var(--navy); background: var(--g-tint); }
.g-option input { width: 1.25rem; height: 1.25rem; margin: 0.05rem 0 0; accent-color: var(--navy); flex: 0 0 auto; }
.g-option__title { display: block; font-size: 0.95rem; font-weight: 700; }
.g-option__desc { display: block; margin-top: 0.15rem; font-size: 0.82rem; line-height: 1.45; color: var(--g-soft); }
.g-option--disabled { opacity: 0.45; cursor: default; }

/* Price block when the item is "Donate only": kept in place, switched off. */
.g-price--off .g-field > label,
.g-price--off .g-money { opacity: 0.45; }
.g-price--off .g-money { background: var(--g-gray); }

.g-check { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.9rem; line-height: 1.45; padding: 0.4rem 0; cursor: pointer; }
.g-check input { width: 1.25rem; height: 1.25rem; margin: 0.05rem 0 0; accent-color: var(--navy); flex: 0 0 auto; }

/* Chips (category, messenger) */
.g-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.g-chip { position: relative; }
.g-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.g-chip span {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--g-line);
  font-size: 0.88rem;
  font-weight: 500;
}
.g-chip input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.g-chip input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Photos */
.g-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }

.g-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--black);
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.g-photo--optional { border-color: #9a9a9a; background: #fafafa; }
.g-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.g-photo__title { font-size: 0.82rem; font-weight: 700; line-height: 1.25; }
.g-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-photo--filled { border-style: solid; }

.g-photo__remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* Notices */
.g-notice { padding: 0.8rem 0.9rem; font-size: 0.9rem; line-height: 1.45; }
.g-notice--frame { border: 2px solid var(--black); }
.g-notice--yellow { background: var(--g-yellow); }
.g-notice--gray { background: var(--g-gray); }
.g-notice--red { background: var(--g-red-bg); color: var(--g-red); }

/* Seller number card */
.g-seller {
  background: var(--navy);
  color: var(--white);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.g-seller__label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: #d6d2f0; }
.g-seller__number { font-size: 4rem; line-height: 1; font-weight: 700; font-style: italic; }

/* Item cards */
.g-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }

.g-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--g-line);
  color: inherit;
  text-decoration: none;
}

.g-item__thumb {
  width: 4.75rem;
  height: 4.75rem;
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--g-gray);
}

.g-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.g-item__top { display: flex; justify-content: space-between; gap: 0.5rem; }
.g-item__code { font-size: 0.75rem; font-weight: 700; color: var(--navy); }
.g-item__price { font-size: 0.95rem; font-weight: 700; }
.g-item__name { font-size: 0.95rem; font-weight: 700; line-height: 1.25; }
.g-item__meta { font-size: 0.75rem; color: var(--g-muted); }

.g-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.15rem; }
.g-tag {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.2rem 0.4rem;
  background: var(--g-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.g-tag--line { background: none; border: 1px solid var(--g-line); text-transform: none; letter-spacing: 0; }
.g-tag--green { background: var(--g-green-bg); color: var(--g-green); }

.g-status { font-size: 0.75rem; font-weight: 700; margin-top: 0.2rem; }
.g-status--approved { color: var(--navy); }
.g-status--review { color: #6b4e00; }
.g-status--rejected { color: var(--g-red); }
.g-status--received { color: var(--g-green); }

/* Plain lists with rules between rows */
.g-rows { list-style: none; margin: 0; padding: 0; }
.g-rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--g-line);
}

.g-steps { list-style: none; margin: 0; padding: 0; }
.g-steps li { display: flex; gap: 0.9rem; padding: 0.9rem 0; border-top: 1px solid var(--g-line); }
.g-steps__n { font-size: 0.88rem; font-weight: 700; color: var(--navy); flex: 0 0 1.6rem; }
.g-steps__t { display: block; font-weight: 700; }
.g-steps__d { display: block; margin-top: 0.2rem; font-size: 0.88rem; color: var(--g-soft); }

.g-box { background: var(--g-gray); padding: 1rem; }
.g-rules { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; line-height: 1.55; display: flex; flex-direction: column; gap: 0.25rem; }

.g-me {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--g-gray);
}
.g-me img, .g-me__initials {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  background: #c9c9c9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

/* Bag illustration on the drop-off screen */
.g-bag { align-self: center; display: flex; flex-direction: column; align-items: center; }
.g-bag__handle { width: 5.25rem; height: 1.9rem; border: 2px solid var(--black); border-bottom: 0; border-radius: 2.6rem 2.6rem 0 0; }
.g-bag__body {
  width: 12.5rem;
  height: 10.5rem;
  border: 2px solid var(--black);
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.g-bag__number { font-size: 3.25rem; line-height: 1; font-weight: 700; font-style: italic; }
.g-bag__tape { display: flex; gap: 0.35rem; margin-top: 0.6rem; }
.g-bag__tape span { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.4rem; background: var(--g-yellow); }
.g-bag__tape span:nth-child(1) { transform: rotate(-4deg); }
.g-bag__tape span:nth-child(2) { transform: rotate(3deg); }
.g-bag__tape span:nth-child(3) { transform: rotate(-2deg); }

.g-dev { border: 1px dashed var(--g-muted); padding: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }

/* ---------------------------------------------------------------------------
   Admin (garage-admin.html) — wide, table-led, still usable on a phone. */

.page--garage-admin { margin: 0; font-family: var(--font-mono); color: var(--black); background: var(--white); }

.ga-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem var(--side-pad, 1.25rem);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.ga-header img { width: 7rem; height: auto; display: block; }
.ga-header__title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.ga-nav { display: flex; gap: 1.1rem; font-size: 0.9rem; font-weight: 500; }
.ga-nav button { border: 0; background: none; font: inherit; padding: 0.5rem 0; cursor: pointer; color: var(--black); }
.ga-nav button[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.ga-spacer { flex: 1 1 1rem; }

.garage--admin { max-width: 90rem; padding-bottom: 4rem; }

.ga-table-wrap { overflow-x: auto; border: 1px solid var(--g-line); }
.ga-table { width: 100%; border-collapse: collapse; min-width: 46rem; }
.ga-table th {
  text-align: left;
  padding: 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-muted);
  border-bottom: 1px solid var(--black);
  white-space: nowrap;
}
.ga-table td { padding: 0.6rem; border-bottom: 1px solid var(--g-line); vertical-align: middle; font-size: 0.82rem; }
.ga-table tr { cursor: pointer; }
.ga-table tr[aria-selected="true"] { background: var(--g-tint); }
.ga-table img { width: 2.5rem; min-width: 2.5rem; height: 2.5rem; object-fit: cover; display: block; background: var(--g-gray); }
.ga-table .ga-actions { flex-wrap: nowrap; }

.ga-layout { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.ga-layout__main { flex: 999 1 40rem; min-width: 0; }
.ga-panel { flex: 1 1 19rem; min-width: 0; border: 1px solid var(--black); padding: 1.1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.ga-panel img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--g-gray); }
.ga-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; font-size: 0.82rem; }
.ga-dl dt { color: var(--g-muted); }
.ga-dl dd { margin: 0; }

.ga-badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ga-badge--review { background: var(--g-yellow); }
.ga-badge--approved { background: var(--g-tint); color: var(--navy); }
.ga-badge--on_sale { background: var(--navy); color: var(--white); }
.ga-badge--rejected { background: var(--g-red-bg); color: var(--g-red); }
.ga-badge--donation_received { background: var(--g-green-bg); color: var(--g-green); }

.ga-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ga-tab {
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid var(--g-line);
  background: var(--white);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.ga-tab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.ga-tab span { opacity: 0.7; }

.ga-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.ga-msg { background: var(--g-gray); padding: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.85rem; }
.ga-msg p { white-space: pre-line; }

.ga-dialog { border: 0; padding: 0; width: min(28rem, 100vw); max-height: 92vh; overflow-y: auto; }
.ga-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.ga-dialog .garage { padding: 1.25rem; }
