:root {
  --bg: #ffffff;
  --bg-2: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #16202e;
  --muted: #5f6b7d;
  --faint: #8b95a5;
  --brand: #1f4e78;
  --brand-2: #2e75b6;
  --brand-soft: #eaf1f8;
  --accent: #1f4e78;
  --accent-light: #2e75b6;
  --accent-press: #173d60;
  --grad-a: #8CE99A;
  --grad-b: #5B8DEF;
  --btn-grad: linear-gradient(180deg, #29618f 0%, #1f4e78 100%);
  --btn-grad-hover: linear-gradient(180deg, #2e6c9f 0%, #245a8a 100%);
  --gold: #d9822b;
  --red: #b3261e;
  --green: #1e7e46;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(23, 43, 77, .06), 0 2px 6px rgba(23, 43, 77, .04);
  --shadow: 0 2px 14px rgba(23, 43, 77, .08);
  --shadow-md: 0 4px 12px rgba(23, 43, 77, .08), 0 16px 32px rgba(23, 43, 77, .08);
  --shadow-lg: 0 6px 16px rgba(23, 43, 77, .10), 0 28px 70px rgba(23, 43, 77, .16);
  --ring: 0 0 0 3px rgba(46, 117, 182, .20);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

input {
  font-family: inherit;
}

/* ---------- login ---------- */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 15%, #f8fafc 0%, #ffffff 85%);
}

.login-card {
  width: 100%;
  max-width: 390px;
  text-align: center;
  background: #ffffff;
  padding: 40px 32px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: .35em;
  padding-left: .35em;
  color: var(--brand);
}

.brand-mark.small {
  font-size: 1.05rem;
  letter-spacing: .28em;
  color: var(--brand);
  white-space: nowrap;
  flex-shrink: 0;
}

.login-sub {
  color: var(--muted);
  margin: 8px 0 40px;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 500;
}

.code-label {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 14px;
  font-weight: 500;
}

#code-input {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: .5em;
  padding: 18px 8px 18px calc(8px + .5em);
  text-transform: uppercase;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#code-input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(46, 117, 182, .18);
}

#code-input.shake {
  animation: shake .35s;
  border-color: var(--red);
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.login-error {
  color: var(--red);
  font-size: .88rem;
  margin-top: 14px;
  min-height: 1.2em;
  font-weight: 500;
}

.enter-btn {
  margin-top: 6px;
}

.login-hint {
  color: var(--muted);
  font-size: .82rem;
  margin-top: 28px;
}

/* ---------- shop header (both top user row and toolbar stay sticky) ---------- */
.shop-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 20px 9px;
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(23, 43, 77, .04);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.shop-header.scrolled {
  border-bottom-color: var(--border-strong);
  box-shadow: 0 6px 22px -4px rgba(23, 43, 77, .12);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.header-row .brand-mark {
  cursor: pointer;
  user-select: none;
  transition: opacity .15s ease;
}

.header-row .brand-mark:hover {
  opacity: .85;
}

/* Modern Highlighted Buyer User Box */
.buyer-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 8px;
  box-shadow: 0 1px 4px rgba(23, 43, 77, .05);
  transition: border-color .15s ease, box-shadow .15s ease;
  min-width: 0;
  flex-shrink: 1;
}

.buyer-chip:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(23, 43, 77, .08);
}

.buyer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(31, 78, 120, .3);
}

.buyer-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  text-align: left;
}

.buyer-role {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--brand-2);
  line-height: 1;
  margin-bottom: 1px;
}

.buyer-name,
#buyer-name {
  font-weight: 700;
  color: var(--text);
  font-size: .88rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

#switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

#switch-btn:hover {
  color: var(--red);
  border-color: #fca5a5;
  background: #fef2f2;
}

#switch-btn svg {
  flex-shrink: 0;
}

/* ---------- toolbar (inside sticky header) ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip-toggle {
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.chip-toggle:hover {
  border-color: var(--border);
  background: #eef2f7;
}

.chip-toggle.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(46, 117, 182, .3);
}

#search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

#search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid #2e75b6;
  border-radius: 999px;
  color: var(--text);
  padding: 12px 20px;
  font-size: .95rem;
  outline: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#search-input:focus {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 117, 182, .18);
}

.product-count {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
}

.view-toggle {
  display: flex;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
}

.view-toggle button {
  background: none;
  color: var(--muted);
  font-size: 1.05rem;
  padding: 8px 13px;
  line-height: 1;
  border-radius: 999px;
  transition: all .15s ease;
}

.view-toggle button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 2px 6px rgba(31, 78, 120, .25);
}

/* ---------- grid (uniform tiles) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 26px;
  padding: 24px 28px 120px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 14px 12px 120px;
  }
}

.grid-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

/* first paint: cards rise in with soft stagger */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.card.enter {
  animation: card-in .5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s cubic-bezier(0.16, 1, 0.3, 1), transform .25s cubic-bezier(0.16, 1, 0.3, 1), border-color .2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card.in-cart {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 2px var(--brand-2), 0 12px 28px rgba(31, 78, 120, .18);
}

.card-img {
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 3 / 4;
}

.card-img::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: rgba(23, 43, 77, .06);
  z-index: 2;
  pointer-events: none;
}

.card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
  transition: transform .35s ease;
}

.card:hover .card-img img:not(.bg) {
  transform: scale(1.035);
}

.card-img img.bg {
  object-fit: cover;
  filter: blur(14px) brightness(.92);
  transform: scale(1.15);
  opacity: .5;
  z-index: 0;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(23, 43, 77, .12);
}

.badge.low {
  background: #fff8eb;
  color: var(--gold);
  border: 1px solid rgba(217, 130, 43, .3);
}

.card.sold-out .card-img {
  filter: grayscale(.65) contrast(.9);
  opacity: .85;
}

.card.sold-out .card-img::before {
  content: 'SOLD OUT';
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .12em;
  background: rgba(22, 32, 46, .85);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.card-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.card-eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.card-name {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.3;
  color: var(--text);
}

.card-typesize {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 500;
}

.size-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow: hidden;
}

.size-chips span {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1;
  color: var(--muted);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.size-chips span.lot {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: .08em;
}

.card.sold-out .size-chips span {
  color: #a6a8b0;
  background: #ededef;
}

.set-hint {
  text-align: center;
  font-size: .7rem;
  color: var(--muted);
  transition: color .15s ease;
}

.set-hint:not(:empty) {
  margin-top: 5px;
}

.set-hint.snapped {
  color: var(--gold);
  font-weight: 700;
}

.grid.list .set-hint {
  display: none;
}

.card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.card-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -.015em;
  color: var(--text);
}

.card-stock {
  color: var(--muted);
  font-size: .74rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-stock::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.card-stock.low {
  color: var(--gold);
  font-weight: 600;
}

.card-stock.low::before {
  background: var(--gold);
}

.card-stock:empty::before {
  display: none;
}

.thread {
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.thread i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 2px;
}

.thread i.low {
  background: var(--gold);
}

/* stepper pill */
.stepper {
  display: flex;
  align-items: stretch;
  height: 42px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.stepper button {
  flex: 0 0 46px;
  background: none;
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 600;
  transition: background .1s ease, color .1s ease, transform .1s ease;
  user-select: none;
}

.stepper button:hover {
  color: var(--brand-2);
}

.stepper button:active {
  background: var(--brand-soft);
  transform: scale(.9);
}

.stepper button:disabled {
  opacity: .25;
  cursor: default;
}

@keyframes qty-bump {
  40% {
    transform: scale(1.18);
  }
}

.stepper input.bump {
  animation: qty-bump .18s cubic-bezier(0.16, 1, 0.3, 1);
}

.stepper input {
  flex: 1;
  min-width: 0;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
}

.stepper:focus-within {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 117, 182, .18);
}

.qty-active .stepper {
  border-color: var(--brand-2);
  background: var(--brand-soft);
}

.qty-active .stepper input {
  font-weight: 700;
  color: var(--brand);
}

.sold-out-label {
  height: 42px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---------- list view ---------- */
.grid.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr));
  gap: 12px;
  align-items: start;
}

.grid.list .card {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  box-shadow: none;
  border: 1px solid var(--border);
  transition: background .12s ease, border-color .12s ease;
}

.grid.list .card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  background: #fbfcfe;
  border-color: var(--border-strong);
}

.grid.list .card.in-cart {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px var(--brand-2);
  background: #f8fbfe;
}

.grid.list .card-img {
  height: 124px;
  width: auto;
  aspect-ratio: var(--ar, 3 / 4);
  max-width: 170px;
  min-width: 70px;
  flex: none;
  border-radius: 10px;
}

.grid.list .card-body {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
  flex: 1;
}

.grid.list .card-topline {
  justify-content: flex-start;
  gap: 12px;
}

.grid.list .card-topline .card-typesize {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid.list .card-eyebrow {
  font-size: .68rem;
}

.grid.list .card-name {
  font-size: 1rem;
}

.grid.list .card-typesize {
  font-size: .82rem;
}

.grid.list .card-meta {
  margin-top: 5px;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.grid.list .card-price {
  font-size: 1.12rem;
}

.grid.list .card-stock {
  font-size: .78rem;
}

.grid.list .stepper,
.grid.list .sold-out-label {
  grid-column: 2;
  grid-row: 1 / span 4;
  margin-top: 0;
  height: 44px;
}

.grid.list .sold-out-label {
  font-size: .72rem;
}



.empty-msg {
  text-align: center;
  color: var(--muted);
  padding: 80px 20px;
  font-size: 1.05rem;
}

/* ---------- cart bar — floating dark glass pill ---------- */
.cart-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 560px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 9px 9px 24px;
  background: rgba(22, 32, 46, .96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  box-shadow: 0 18px 48px -12px rgba(22, 32, 46, .5);
  animation: bar-in .35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bar-in {
  from {
    transform: translate(-50%, 130%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.sheet {
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-duration: .3s;
}

.cart-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#cart-qty {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
}

#cart-amount {
  color: rgba(255, 255, 255, .65);
  font-size: .82rem;
  white-space: nowrap;
}

/* ---------- DEEP ONE Gradient Buttons ---------- */
.btn-primary {
  background: var(--btn-grad);
  border: 1px solid #1a4166;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 2px 8px rgba(31, 78, 120, .28);
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--btn-grad-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 18px rgba(31, 78, 120, .35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(.97);
}

.btn-primary:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn-primary.big {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  border-radius: 14px;
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 32, 46, .5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 600px) {
  .overlay {
    align-items: center;
  }
}

.sheet {
  width: 100%;
  max-width: 490px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: rise .25s ease;
}

@media (min-width: 600px) {
  .sheet {
    border-radius: 16px;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: .9rem;
  transition: all .15s ease;
}

.icon-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* ---------- order review ---------- */
.sheet.review-sheet {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 86vh;
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.review-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

.review-sub {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 3px;
}

.review-lines {
  flex: 1;
  overflow-y: auto;
  padding: 0 22px;
  overscroll-behavior: contain;
}

.review-line {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.review-line:last-child {
  border-bottom: none;
}

.rl-thumb {
  width: 54px;
  height: 68px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-2);
}

.review-line .mini-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d5d9;
  font-weight: 700;
}

.rl-info {
  min-width: 0;
}

.rl-name {
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.rl-sub {
  color: var(--muted);
  font-size: .76rem;
  margin-top: 2px;
}

.rl-stepper {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.rl-stepper button {
  width: 32px;
  height: 30px;
  background: none;
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 600;
  transition: background .1s ease, color .1s ease;
}

.rl-stepper button:hover {
  color: var(--brand-2);
}

.rl-stepper button:active {
  background: var(--brand-soft);
}

.rl-stepper span {
  min-width: 62px;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
}

.rl-right {
  text-align: right;
}

.rl-amt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
}

.rl-sets {
  color: var(--muted);
  font-size: .72rem;
  margin-top: 3px;
}

.review-footer {
  border-top: 1px solid var(--border);
  padding: 14px 22px calc(18px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 0 0 16px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
}

.review-total {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rt-label {
  display: none;
}

.rt-qty {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  font-weight: 500;
}

.rt-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--text);
}

#review-error {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 6px 0 0;
}

#review-error:empty {
  display: none;
}

.review-footer .btn-primary.big {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  padding: 14px 26px;
  font-size: .98rem;
  white-space: nowrap;
}

/* ---------- success ---------- */
.success-sheet {
  text-align: center;
  padding: 40px 24px;
}

.tick {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(30, 126, 70, .1);
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes pop {
  from {
    transform: scale(.4);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-sheet h2 {
  font-family: var(--font-display);
  color: var(--text);
}

.order-no {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-2);
  margin: 10px 0 4px;
  letter-spacing: .05em;
}

.success-detail {
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
}

.success-note {
  color: var(--muted);
  font-size: .82rem;
  margin: 14px 0 26px;
}

/* ---------- photo viewer ---------- */
.photo-overlay {
  flex-direction: column;
  align-items: center !important;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: rgba(15, 23, 34, .86);
  backdrop-filter: blur(22px) saturate(1.2);
  animation: viewer-in .25s ease-out;
}

@keyframes viewer-in {
  from {
    opacity: 0;
  }
}

.photo-overlay.closing {
  animation: viewer-out .17s ease-in forwards;
}

@keyframes viewer-out {
  to {
    opacity: 0;
  }
}

#photo-img {
  max-width: min(100%, 1040px);
  max-height: 80vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .6);
  animation: photo-in .32s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 560px) {
  #photo-img {
    max-height: 76vh;
  }
}

@keyframes photo-in {
  from {
    opacity: 0;
    transform: scale(.94);
  }
}

#photo-img.swap {
  animation: photo-swap .22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes photo-swap {
  from {
    opacity: 0;
    transform: scale(.985);
  }
}

/* frosted-glass controls */
.photo-glass {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
  color: #fff;
  border-radius: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, transform .12s ease;
  user-select: none;
}

.photo-glass:hover {
  background: rgba(255, 255, 255, .24);
}

.photo-glass:active {
  transform: scale(.9);
}

.photo-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 1.7rem;
  line-height: 1;
  padding-bottom: 4px;
}

.photo-nav:active {
  transform: translateY(-50%) scale(.9);
}

.photo-nav.prev {
  left: 18px;
}

.photo-nav.next {
  right: 18px;
}

@media (max-width: 560px) {
  .photo-nav {
    width: 40px;
    height: 40px;
    top: auto;
    bottom: 108px;
    transform: none;
  }

  .photo-nav:active {
    transform: scale(.9);
  }

  .photo-nav.prev {
    left: 14px;
  }

  .photo-nav.next {
    right: 14px;
  }
}

.photo-count {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, .85);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 5px 14px;
}

.photo-caption {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, .97);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .55);
  animation: caption-in .35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes caption-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.photo-caption-text {
  min-width: 0;
}

.photo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.photo-detail {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 3px;
}

.photo-stepper {
  width: 168px;
  flex: none;
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   RESPONSIVE PASS — Smooth desktop & mobile ergonomics
   ===================================================================== */

img,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
select {
  touch-action: manipulation;
}

button {
  min-height: 44px;
}

.stepper button,
.rl-stepper button,
.view-toggle button,
#switch-btn,
.icon-btn {
  min-height: 0;
}

:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
}

#search-input:focus-visible,
#code-input:focus-visible,
.stepper input:focus-visible {
  outline: none;
}

/* hover lift on pointing devices */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--btn-grad-hover);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 18px rgba(31, 78, 120, .35);
  }
}

/* touch devices */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .card.in-cart:hover {
    box-shadow: 0 0 0 2px var(--brand-2), 0 12px 28px rgba(31, 78, 120, .18);
  }

  .card:hover .card-img img:not(.bg) {
    transform: none;
  }

  .btn-primary:hover {
    filter: none;
  }

  .grid.list .card:hover {
    background: var(--surface);
    border-color: var(--border);
  }

  .grid.list .card.in-cart:hover {
    border-color: var(--brand-2);
    background: #f8fbfe;
  }

  .card:active {
    transform: scale(.99);
  }
}

/* ---- login responsive ---- */
#login-view {
  min-height: 100dvh;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
}

@media (max-width: 380px) {
  #code-input {
    font-size: 1.9rem;
    letter-spacing: .4em;
    padding: 16px 6px 16px calc(6px + .4em);
  }

  .brand-mark {
    font-size: 1.45rem;
  }
}

@media (max-height: 560px) {
  #login-view {
    align-items: flex-start;
  }

  .login-sub {
    margin-bottom: 24px;
  }

  .login-hint {
    margin-top: 18px;
  }
}

/* ---- sticky header responsive ---- */
.shop-header {
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

@media (max-width: 760px) {
  #search-input {
    font-size: 16px;
    padding: 11px 16px;
  }

  .stepper input {
    font-size: 16px;
  }
}

@media (max-width: 560px) {

  /* ---- header row ---- */
  .shop-header {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header-row {
    margin-bottom: 8px;
    gap: 6px;
  }

  /* brand text smaller on mobile */
  .brand-mark.small {
    font-size: .82rem;
    letter-spacing: .12em;
    flex-shrink: 0;
  }

  /* buyer chip: show avatar + buyer name + logout icon */
  .buyer-chip {
    gap: 6px;
    padding: 3px 5px 3px 5px;
    max-width: 62%;
    min-width: 0;
  }

  .buyer-avatar {
    width: 24px;
    height: 24px;
  }

  .buyer-avatar svg {
    width: 12px;
    height: 12px;
  }

  /* Show the buyer name cleanly */
  .buyer-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
  }

  /* Hide the "Buyer" small role label to keep compact */
  .buyer-role {
    display: none;
  }

  .buyer-name,
  #buyer-name {
    font-size: .78rem;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide the "Logout" text — keep only the icon */
  #switch-btn>span {
    display: none;
  }

  #switch-btn {
    padding: 5px 8px;
    gap: 0;
    font-size: .72rem;
  }

  /* ---- toolbar ---- */
  .toolbar {
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
  }

  #search-input {
    padding: 8px 10px;
    font-size: 13px;
    min-width: 0;
    flex: 1 1 70px;
  }

  .chip-toggle {
    padding: 7px 8px;
    font-size: .72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .view-toggle {
    padding: 2px;
    flex-shrink: 0;
  }

  .view-toggle button {
    padding: 5px 7px;
    font-size: .88rem;
  }

  /* Show total design count on mobile */
  .product-count {
    display: inline-block;
    font-size: .72rem;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 600;
  }
}

@media (max-width: 360px) {
  .brand-mark.small {
    font-size: .74rem;
    letter-spacing: .08em;
  }

  .buyer-name,
  #buyer-name {
    max-width: 65px;
    font-size: .72rem;
  }

  .chip-toggle {
    padding: 6px 7px;
    font-size: .68rem;
  }

  #search-input {
    padding: 7px 8px;
    font-size: 12px;
  }

  .view-toggle button {
    padding: 4px 5px;
    font-size: .82rem;
  }

  .product-count {
    font-size: .68rem;
  }
}

/* ---- grid responsive ---- */
.grid {
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

@media (min-width: 561px) and (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 18px 18px calc(120px + env(area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .grid {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .card {
    border-radius: 12px;
  }

  .card-body {
    padding: 10px 11px 11px;
    gap: 5px;
  }

  .card-name {
    font-size: .84rem;
  }

  .card-price {
    font-size: 1rem;
  }

  .card-stock {
    font-size: .7rem;
  }

  .card-eyebrow {
    font-size: .6rem;
    letter-spacing: .12em;
  }

  .card-typesize {
    font-size: .7rem;
  }

  .size-chips span {
    padding: 4px 8px;
    font-size: .58rem;
  }

  .stepper {
    height: 44px;
  }

  .stepper button {
    flex: 0 0 44px;
  }

  .sold-out-label {
    height: 44px;
    font-size: .68rem;
  }

  .badge {
    top: 8px;
    left: 8px;
    font-size: .58rem;
    padding: 4px 8px;
  }

  .card.sold-out .card-img::before {
    top: 8px;
    left: 8px;
    font-size: .62rem;
    padding: 6px 12px;
  }
}

@media (max-width: 340px) {
  .grid {
    gap: 10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .card-body {
    padding: 8px 9px 9px;
  }

  .stepper button {
    flex: 0 0 38px;
    font-size: 1.15rem;
  }

  .card-topline .card-typesize {
    display: none;
  }
}

/* ---- list view mobile layout ---- */
@media (max-width: 560px) {
  .grid.list {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .grid.list .card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 10px 12px 10px 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
  }

  .grid.list .card-img {
    width: 86px;
    height: 110px;
    min-width: 86px;
    max-width: 86px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    aspect-ratio: auto;
  }

  .grid.list .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .grid.list .card-img .placeholder {
    width: 100%;
    height: 100%;
    font-size: 1.15rem;
    border-radius: 10px;
  }

  .grid.list .card.sold-out .card-img::before {
    top: 5px;
    left: 5px;
    font-size: .52rem;
    padding: 3px 6px;
    letter-spacing: .06em;
  }

  .grid.list .card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    row-gap: 3px;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding: 0;
  }

  .grid.list .card-topline {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
  }

  .grid.list .card-eyebrow {
    font-size: .68rem;
    font-weight: 700;
    color: var(--brand-2);
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .grid.list .card-topline .card-typesize {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .grid.list .card-name {
    grid-column: 1 / -1;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    margin: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .grid.list .size-chips {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 1px 0;
  }

  .grid.list .size-chips span {
    padding: 3px 7px;
    font-size: .62rem;
    border-radius: 999px;
  }

  .grid.list .thread {
    grid-column: 1 / -1;
    margin: 1px 0;
    height: 2px;
  }

  .grid.list .card-meta {
    grid-column: 1;
    grid-row: auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
    padding: 0;
    min-width: 0;
  }

  .grid.list .card-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
  }

  .grid.list .card-stock {
    font-size: .72rem;
    color: var(--muted);
    white-space: nowrap;
  }

  .grid.list .stepper,
  .grid.list .sold-out-label {
    grid-column: 2;
    grid-row: auto;
    margin-top: 4px;
    justify-self: end;
  }

  .grid.list .stepper {
    height: 34px;
    width: 104px;
    min-width: 104px;
    border-radius: 999px;
  }

  .grid.list .stepper button {
    flex: 0 0 32px;
    font-size: 1.15rem;
    font-weight: 600;
  }

  .grid.list .stepper input {
    font-size: .84rem;
    font-weight: 600;
    padding: 0;
  }

  .grid.list .sold-out-label {
    height: 32px;
    padding: 0 12px;
    font-size: .7rem;
    letter-spacing: .08em;
    font-weight: 700;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--muted);
    min-width: 86px;
  }
}

@media (max-width: 360px) {
  .grid.list .card {
    gap: 8px;
    padding: 8px 8px 8px 8px;
  }

  .grid.list .card-img {
    width: 74px;
    height: 98px;
    min-width: 74px;
    max-width: 74px;
  }

  .grid.list .card-name {
    font-size: .84rem;
  }

  .grid.list .card-price {
    font-size: .96rem;
  }

  .grid.list .stepper {
    height: 32px;
    width: 94px;
    min-width: 94px;
  }

  .grid.list .stepper button {
    flex: 0 0 28px;
    font-size: 1rem;
  }

  .grid.list .stepper input {
    font-size: .78rem;
  }

  .grid.list .sold-out-label {
    height: 30px;
    padding: 0 8px;
    font-size: .65rem;
    min-width: 76px;
  }
}

/* ---- cart bar responsive ---- */
.cart-bar {
  width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
}

@media (max-width: 560px) {
  .cart-bar {
    padding: 8px 8px 8px 18px;
    gap: 10px;
  }

  #cart-qty {
    font-size: .95rem;
  }

  #cart-amount {
    font-size: .78rem;
  }

  .cart-bar .btn-primary {
    padding: 12px 18px;
    font-size: .9rem;
  }
}

@media (max-width: 340px) {
  .cart-bar .btn-primary {
    padding: 12px 14px;
    font-size: .84rem;
  }
}

/* ---- sheets & overlays responsive ---- */
.overlay {
  padding-top: env(safe-area-inset-top);
}

.sheet {
  max-height: 90dvh;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sheet.review-sheet {
  max-height: 86dvh;
}

@media (max-width: 599px) {
  .sheet {
    max-width: 100%;
  }

  .sheet.review-sheet {
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }

  .sheet.review-sheet::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 10px auto 0;
    flex: none;
  }

  .review-head {
    padding: 12px 18px 12px;
  }

  .review-lines {
    padding: 0 18px;
  }

  .review-footer {
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  }

  .review-line {
    grid-template-columns: 48px 1fr auto;
    gap: 10px;
    padding: 11px 0;
  }

  .rl-thumb {
    width: 48px;
    height: 60px;
  }

  .rl-stepper button {
    width: 36px;
    height: 34px;
  }

  .rl-stepper span {
    min-width: 54px;
    font-size: .74rem;
  }

  .rt-amount {
    font-size: 1.2rem;
  }

  .review-footer .btn-primary.big {
    padding: 14px 20px;
    font-size: .92rem;
  }

  .success-sheet {
    padding: 32px 20px calc(28px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  .review-footer {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .review-footer .btn-primary.big {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  #review-error {
    grid-row: 3;
  }

  .review-line {
    grid-template-columns: 44px 1fr;
  }

  .rl-right {
    grid-column: 2;
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: baseline;
  }

  .rl-sets {
    margin-top: 0;
  }
}

@media (max-height: 500px) {
  .overlay {
    align-items: center;
  }

  .sheet,
  .sheet.review-sheet {
    max-height: 96dvh;
    border-radius: 12px;
  }

  .sheet.review-sheet::before {
    display: none;
  }

  .review-head {
    padding: 10px 18px 8px;
  }

  .review-footer {
    padding: 8px 18px 10px;
  }

  .success-sheet {
    padding: 18px 20px;
  }

  .tick {
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
    font-size: 1.5rem;
  }
}

/* ---- photo viewer responsive ---- */
.photo-overlay {
  padding: calc(12px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  touch-action: pan-y pinch-zoom;
}

#photo-img {
  max-height: 80dvh;
  -webkit-user-drag: none;
  user-select: none;
}

.photo-close {
  top: calc(18px + env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
}

.photo-count {
  top: calc(24px + env(safe-area-inset-top));
}

@media (max-width: 560px) {
  #photo-img {
    max-height: calc(100dvh - 190px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .photo-close {
    width: 44px;
    height: 44px;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
  }

  .photo-count {
    top: calc(20px + env(safe-area-inset-top));
  }

  .photo-nav {
    width: 44px;
    height: 44px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .photo-caption {
    gap: 10px;
    padding: 8px 10px 8px 14px;
    border-radius: 12px;
  }

  .photo-title {
    font-size: .92rem;
  }

  .photo-detail {
    font-size: .74rem;
  }

  .photo-stepper {
    width: 140px;
    height: 42px;
  }

  .photo-stepper button {
    flex: 0 0 42px;
  }
}

@media (max-width: 360px) {
  .photo-stepper {
    width: 122px;
  }

  .photo-stepper button {
    flex: 0 0 38px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .photo-overlay {
    flex-direction: row;
    gap: 14px;
    padding-left: max(70px, env(safe-area-inset-left));
    padding-right: max(70px, env(safe-area-inset-right));
  }

  #photo-img {
    max-height: calc(100dvh - 24px);
    max-width: 60vw;
  }

  .photo-caption {
    width: auto;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    max-width: 260px;
  }

  .photo-stepper {
    width: 100%;
  }

  .photo-nav {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .photo-nav:active {
    transform: translateY(-50%) scale(.9);
  }
}

/* ---- tablets ---- */
@media (min-width: 761px) and (max-width: 1024px) {
  .shop-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .grid {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ---- short viewports ---- */
@media (max-height: 500px) {
  .shop-header {
    padding-top: calc(6px + env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .header-row {
    margin-bottom: 6px;
  }
}