/* GMD buyer mobile layer - Phase C.
   Loaded only for the GMD tenant, after main.css.
   Additive only: desktop rules live behind min-width, everything else is
   scoped to small screens so existing desktop layout is untouched. */

:root {
  --gmd-blue: #087ff5;
  --gmd-ink: #10233d;
  --gmd-muted: #55677d;
  --gmd-line: #dce5eb;
}

/* ---- Buyer quick access (all breakpoints; new markup) ---- */
.gmd-quick {
  max-width: 72rem;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}
.gmd-quick__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}
.gmd-quick__grid a {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .85rem .9rem;
  border: 1px solid var(--gmd-line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  min-height: 100%;
}
.gmd-quick__grid a:hover { border-color: var(--gmd-blue); }
.gmd-quick__label {
  font-size: .78rem;
  color: var(--gmd-muted);
  letter-spacing: .01em;
}
.gmd-quick__value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gmd-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.gmd-quick__value--text,
.gmd-quick__value--money { font-size: 1.05rem; }
.gmd-quick__value--money { color: var(--gmd-blue); }

.gmd-quick__signedout {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  align-items: flex-start;
}
.gmd-quick__cta {
  display: inline-block;
  background: var(--gmd-blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: .8rem 1.3rem;
  border-radius: 10px;
}
.gmd-quick__auth { display: flex; gap: 1.1rem; }
.gmd-quick__auth a { color: var(--gmd-blue); font-weight: 600; }

@media (max-width: 640px) {
  .gmd-quick__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gmd-quick__signedout { align-items: stretch; }
  .gmd-quick__cta { text-align: center; }
  .gmd-quick__auth { justify-content: space-between; }
}

/* ---- Mobile only. Desktop is untouched above this breakpoint. ---- */
@media (max-width: 768px) {

  /* Auction listing cards */
  .auction-listing-grid {
    grid-template-columns: 1fr !important;
    gap: .9rem;
  }
  .auction-listing-card__body { padding: .95rem 1rem; }
  .auction-listing-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    font-size: .85rem;
  }
  .auction-listing-card__description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .auction-listing-card__button {
    display: block;
    width: 100%;
    text-align: center;
    padding: .8rem 1rem;
  }
  .auction-listing-card__countdown { font-variant-numeric: tabular-nums; }

  /* Catalog: one lot per row, bigger photo, thumb-friendly controls */
  .marketplace-lot { margin-bottom: 1rem; }
  .marketplace-lot__main-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
  .marketplace-lot__thumbnails {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .2rem;
  }
  .marketplace-lot__thumbnails > * { flex: 0 0 auto; }

  /* Bid controls inside a catalog card - existing form, bigger targets */
  form[action*="/bids"] input[type="number"],
  form[action*="/bids"] input[type="text"] {
    font-size: 16px; /* stops iOS zoom-on-focus */
    padding: .7rem .75rem;
    width: 100%;
  }
  form[action*="/bids"] button[type="submit"] {
    width: 100%;
    padding: .85rem 1rem;
    font-size: 1rem;
    min-height: 46px;
  }

  /* Featured lots: swipeable rail rather than a cramped grid */
  .gmd-featured-lots__track {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .4rem;
  }
  .gmd-featured-lot {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  /* Lot detail: full-bleed gallery, readable facts */
  .permanent-lot-gallery__main-link img { width: 100%; height: auto; }
  .permanent-lot-facts { grid-template-columns: 1fr !important; }
  .permanent-lot-fees__row { font-size: .95rem; }
}

/* Offline notice injected next to a bid form when the device drops. */
.gmd-offline-note {
  display: block;
  margin: .5rem 0 0;
  padding: .6rem .75rem;
  border-radius: 8px;
  background: #fdecec;
  color: #8c1c1c;
  font-size: .85rem;
  font-weight: 600;
}

/* ---- Lot detail bid panel (Phase C.1) ---- */
.gmd-bid-panel {
  border: 1px solid var(--gmd-line);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  background: #fff;
}
.gmd-bid-panel__state {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: .9rem;
}
.gmd-bid-panel__label {
  display: block;
  font-size: .78rem;
  color: var(--gmd-muted);
}
.gmd-bid-panel__amount,
.gmd-bid-panel__next {
  display: block;
  font-size: 1.5rem;
  color: var(--gmd-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.gmd-bid-panel__next { color: var(--gmd-blue); }
.gmd-bid-panel__meta { font-size: .8rem; color: var(--gmd-muted); }
.gmd-bid-panel__high,
.gmd-bid-panel__outbid,
.gmd-bid-panel__notice {
  margin: 0 0 .8rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
}
.gmd-bid-panel__high { background: #e7f7ed; color: #17683a; }
.gmd-bid-panel__outbid { background: #fdf3e3; color: #8a5a10; }
.gmd-bid-panel__notice { background: #f1f4f7; color: var(--gmd-muted); }
.gmd-bid-panel__form label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--gmd-ink);
}
.gmd-bid-panel__entry {
  display: flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--gmd-line);
  border-radius: 9px;
  padding: 0 .7rem;
  margin-bottom: .7rem;
}
.gmd-bid-panel__entry span { color: var(--gmd-muted); font-weight: 600; }
.gmd-bid-panel__entry input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
  padding: .75rem .2rem;
  min-width: 0;
}
.gmd-bid-panel__form button[type="submit"] {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}
.gmd-bid-panel__guest { display: flex; flex-direction: column; gap: .6rem; }
.gmd-bid-panel__guest .button { text-align: center; min-height: 48px; }

/* ---- Buyer state pages: My Bids / Closing Soon (Phase D) ---- */
.buyer-page { max-width: 60rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.buyer-page__head { margin-bottom: 1rem; }
.buyer-page__head h1 { margin: 0 0 .35rem; color: var(--gmd-ink); }
.buyer-page__lede { margin: 0; color: var(--gmd-muted); font-size: .92rem; }
.buyer-page__summary { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0 0; }
.buyer-page__count {
  font-size: .78rem; font-weight: 700; padding: .25rem .6rem;
  border-radius: 999px; background: #f1f4f7; color: var(--gmd-muted);
}
.buyer-page__count--winning { background: #e7f7ed; color: #17683a; }
.buyer-page__count--outbid  { background: #fdf3e3; color: #8a5a10; }
.buyer-page__count--won     { background: #e6f0fe; color: #0b4ea2; }
.buyer-page__count--lost    { background: #f1f4f7; color: #6b7c8f; }
.buyer-page__empty {
  border: 1px dashed var(--gmd-line); border-radius: 12px;
  padding: 2rem 1rem; text-align: center; color: var(--gmd-muted);
}
.buyer-page__empty .button { margin-top: .8rem; }

.buyer-card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.buyer-card__link {
  display: flex; gap: .8rem; text-decoration: none;
  border: 1px solid var(--gmd-line); border-radius: 12px;
  padding: .7rem; background: #fff; align-items: stretch;
}
.buyer-card__link:hover { border-color: var(--gmd-blue); }
.buyer-card__media {
  flex: 0 0 84px; width: 84px; height: 84px; border-radius: 9px;
  overflow: hidden; background: #f1f4f7; display: block;
}
.buyer-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.buyer-card__body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; flex: 1; }
.buyer-card__lotno { font-size: .74rem; color: var(--gmd-muted); letter-spacing: .02em; }
.buyer-card__title {
  font-weight: 600; color: var(--gmd-ink); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.buyer-card__figures { display: flex; gap: 1.1rem; margin-top: .15rem; }
.buyer-card__label { display: block; font-size: .7rem; color: var(--gmd-muted); }
.buyer-card__figures strong { color: var(--gmd-ink); font-variant-numeric: tabular-nums; }
.buyer-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-top: auto; padding-top: .3rem;
}
.buyer-card__state {
  font-size: .72rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 999px; background: #f1f4f7; color: var(--gmd-muted);
}
.buyer-card__state--winning  { background: #e7f7ed; color: #17683a; }
.buyer-card__state--outbid   { background: #fdf3e3; color: #8a5a10; }
.buyer-card__state--won      { background: #e6f0fe; color: #0b4ea2; }
.buyer-card__state--lost     { background: #f1f4f7; color: #6b7c8f; }
.buyer-card__state--watching { background: #eef2f6; color: #4a5b6e; }
.buyer-card__closes { font-size: .76rem; color: var(--gmd-muted); }

@media (min-width: 700px) {
  .buyer-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Buyer account, invoices, payment, pickup (Phase E) ----
   Presentation only. Every figure shown here is rendered by the server
   from the existing invoice data; nothing is recalculated in the browser. */

/* Account summary tiles: Watchlist / Registrations / Active Bids /
   Won Lots / Closing Soon / Invoices. */
.bidder-account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .7rem;
}
.bidder-account-summary > a,
.bidder-account-summary > div {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .85rem .9rem;
  border: 1px solid var(--gmd-line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
}
.bidder-account-summary > a:hover { border-color: var(--gmd-blue); }
.bidder-account-summary span { font-size: .78rem; color: var(--gmd-muted); }
.bidder-account-summary strong {
  font-size: 1.4rem;
  color: var(--gmd-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.bidder-account-summary small { font-size: .72rem; color: var(--gmd-muted); }

/* Financial figures must never render as tiny text, and long values wrap
   instead of pushing the page sideways. */
.bidder-account-profile__details {
  font-size: .95rem;
  overflow-wrap: anywhere;
}
.bidder-account-profile__details strong { font-variant-numeric: tabular-nums; }

@media (max-width: 768px) {
  .bidder-account-page,
  .bidder-account-shell { max-width: 100%; }

  .bidder-account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .bidder-account-profile,
  .bidder-account-profile__details { display: block; }

  .bidder-account-profile__details p { margin: 0 0 .55rem; }

  /* Tap-friendly payment and invoice actions. */
  .bidder-account-section .button,
  .admin-actions .button,
  #stripe-pay-now-button {
    display: block;
    width: 100%;
    min-height: 48px;
    text-align: center;
    margin-bottom: .55rem;
  }
  .admin-actions { display: flex; flex-direction: column; }

  /* Nothing in the buyer account may scroll sideways. */
  .bidder-account-shell pre,
  .bidder-account-shell code { overflow-x: auto; max-width: 100%; }
}
