/* ---------------------------------------------------------------------------
   shop.css — the pages the design preview did not have: product page, basket,
   checkout, sign-in, account and forms.

   Built only from the tokens in medly.css, which come from the app. Nothing
   here introduces a colour, radius or type size of its own.
 --------------------------------------------------------------------------- */

[hidden] { display: none !important; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s-lg); top: -60px; z-index: 50;
  background: var(--emerald); color: #fff; padding: 10px 16px;
  border-radius: var(--r-md); font-weight: 700;
}
.skip:focus { top: var(--s-sm); }

.pagetitle { font-size: var(--t-h1); font-weight: 800; line-height: var(--lh); margin-bottom: 4px; }
.section--first { margin-top: var(--s-xl); }
.rxcard h2 { font-size: var(--t-h2); font-weight: 700; margin-bottom: 6px; }
.rxcard .btn svg, .btn svg { flex: none; }

/* -------------------------------------------------------------- messages */
.alert {
  margin: var(--s-lg) 0; padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-md); font-size: var(--t-small); border: 1px solid transparent;
}
.alert--success { background: var(--success-soft); color: #14532d; border-color: #bbf7d0; }
.alert--error   { background: var(--error-soft); color: #7a1f1f; border-color: #fecaca; }
.alert--info    { background: var(--info-soft); color: #083f73; border-color: #b2ddff; }
.field-error { color: var(--error); font-size: var(--t-small); margin: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-caption); font-weight: 700; padding: 3px 9px;
  border-radius: var(--r-pill); background: var(--emerald-soft); color: var(--emerald-dark);
}
.pill--info { background: var(--info-soft); color: #08539b; }

/* ---------------------------------------------------------- page chrome */
.crumbs {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: var(--s-xl) 0 var(--s-md); font-size: var(--t-caption); color: var(--text-2);
}
.crumbs a:hover { color: var(--emerald); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

.listhead {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--s-lg); flex-wrap: wrap; margin: var(--s-lg) 0;
}
.sortform { display: flex; align-items: center; gap: var(--s-sm); font-size: var(--t-small); }

.pager {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px; margin: var(--s-3xl) 0;
}
.pager__num, .pager__step {
  min-width: 44px; height: 44px; padding: 0 12px; display: inline-grid; place-items: center;
  border-radius: var(--r-md); border: 1px solid var(--divider); background: var(--surface);
  font-size: var(--t-small); font-weight: 600;
}
.pager a:hover { border-color: var(--emerald); color: var(--emerald); }
.pager__num.is-current { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.pager__gap { color: var(--text-3); padding: 0 4px; }

.empty {
  text-align: center; padding: var(--s-3xl) var(--s-lg); margin: var(--s-xl) 0;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r-card);
}
.empty h2 { font-size: var(--t-h2); margin-bottom: 6px; }
.empty p { margin-top: var(--s-md); }
.empty--page { border-style: solid; margin: var(--s-3xl) auto; max-width: 560px; }
.empty__code { font-size: 48px; font-weight: 800; color: var(--emerald); line-height: 1; margin: 0 !important; }

.panel {
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--r-card); padding: var(--s-xl);
}
.panel__title { font-size: var(--t-h3); font-weight: 700; margin-bottom: var(--s-md); }
.panel__sub { font-size: var(--t-small); font-weight: 700; margin: var(--s-lg) 0 4px; }

.prose { max-width: 72ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s-md); }
.prose ul, .prose ol { padding-left: 1.3em; list-style: revert; }
.prose h2, .prose h3 { margin: var(--s-xl) 0 var(--s-sm); }
.prose a { color: var(--emerald); text-decoration: underline; }

/* --------------------------------------------------------------- cards */
.card__view {
  display: inline-grid; place-items: center; height: 40px; padding: 0 12px;
  border-radius: var(--r-md); background: var(--info-soft); color: #08539b;
  font-size: var(--t-caption); font-weight: 700;
}
.card__stock { font-size: var(--t-caption); font-weight: 600; color: var(--text-3); }

.banners {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%;
  gap: var(--s-lg); overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; border-radius: var(--r-card-lg);
}
.banners::-webkit-scrollbar { display: none; }
.banners > * { scroll-snap-align: start; }
.hero img { aspect-ratio: 1440 / 600; object-fit: cover; }

.tiles--page { margin-bottom: var(--s-3xl); }

.brandtiles {
  display: grid; gap: var(--s-md);
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.brandtile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; padding: var(--s-md); text-align: center;
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-card);
  font-size: var(--t-small); font-weight: 700;
}
.brandtile:hover { border-color: var(--emerald); color: var(--emerald); }
.brandtile img { max-height: 40px; width: auto; object-fit: contain; }
.brandtile small { font-size: var(--t-overline); font-weight: 500; color: var(--text-3); }
.brandtiles--page { margin-bottom: var(--s-3xl); }

/* -------------------------------------------------------- product page */
.pdp {
  display: grid; gap: var(--s-3xl); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: start; margin-bottom: var(--s-3xl);
}
.pdp__media {
  position: relative; background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--r-card-lg); overflow: hidden; aspect-ratio: 4 / 5;
}
.pdp__media img { width: 100%; height: 100%; object-fit: contain; }
.pdp__brand { font-size: var(--t-small); font-weight: 700; color: var(--emerald); }
.pdp__title { font-size: var(--t-display); font-weight: 800; line-height: 1.2; margin: 4px 0 var(--s-md); }
.pdp__buy { display: grid; gap: var(--s-lg); margin-top: var(--s-lg); }
.pdp__facts { display: grid; gap: var(--s-sm); margin-top: var(--s-xl); color: var(--text-2); font-size: var(--t-small); }
.pdp__facts li { display: flex; align-items: center; gap: var(--s-sm); }
.pdp__facts svg { color: var(--emerald); }

.packs { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-sm); }
.packs legend { font-size: var(--t-small); font-weight: 700; margin-bottom: var(--s-sm); }
.pack {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-md);
  min-height: 56px; padding: var(--s-md) var(--s-lg); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--divider); border-radius: var(--r-input);
}
.pack:has(input:checked) { border-color: var(--emerald); background: var(--emerald-soft); }
.pack input { accent-color: var(--emerald); width: 18px; height: 18px; }
.pack__title { font-weight: 600; }
.pack__price { font-weight: 800; text-align: right; }
.pack__was { display: block; font-weight: 500; font-size: var(--t-caption); color: var(--text-3); }
.pack__stock { grid-column: 2 / -1; font-size: var(--t-caption); color: var(--error); }
.pack.is-out { opacity: .6; cursor: not-allowed; }

.buyrow { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-md); }
.qty input { width: 100%; height: 52px; text-align: center; font-weight: 700; }

/* ------------------------------------------------------ forms, generally */
input[type="text"], input[type="tel"], input[type="number"], input[type="email"],
input[type="search"]:not(.search input), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-input);
  font-size: var(--t-body);
}
textarea { min-height: 88px; resize: vertical; }
select { width: auto; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-soft); }
input[type="file"] { font-size: var(--t-small); }

.stack { display: grid; gap: var(--s-md); }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; }
.field__label { font-size: var(--t-small); font-weight: 700; }
.check { display: flex; align-items: center; gap: var(--s-sm); font-size: var(--t-small); min-height: 44px; }
.check input { accent-color: var(--emerald); width: 18px; height: 18px; }

.segmented { display: flex; gap: var(--s-sm); flex-wrap: wrap; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: inline-grid; place-items: center; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--divider); border-radius: var(--r-pill);
  font-size: var(--t-small); font-weight: 600; cursor: pointer; background: var(--surface);
}
.segmented input:checked + span { border-color: var(--emerald); background: var(--emerald-soft); color: var(--emerald-dark); }
.segmented input:focus-visible + span { outline: 2px solid var(--emerald); outline-offset: 2px; }

.formpage { max-width: 560px; margin: var(--s-xl) auto var(--s-3xl); }
.geo .is-done { border-color: var(--emerald); background: var(--emerald-soft); }

.linkbtn {
  background: none; border: 0; padding: 0 4px; min-height: 40px;
  color: var(--text-2); font-size: var(--t-small); font-weight: 600;
  text-decoration: underline; cursor: pointer;
}
.linkbtn:hover { color: var(--error); }

.choices { display: grid; gap: var(--s-sm); margin-bottom: var(--s-md); }
.choice {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-md); align-items: start;
  padding: var(--s-md) var(--s-lg); cursor: pointer; font-size: var(--t-small);
  background: var(--surface); border: 1.5px solid var(--divider); border-radius: var(--r-input);
}
.choice:has(input:checked) { border-color: var(--emerald); background: var(--emerald-soft); }
.choice input { accent-color: var(--emerald); margin-top: 3px; width: 18px; height: 18px; }
.choice.is-static { cursor: default; border-color: var(--emerald); background: var(--emerald-soft); }
.choice.is-static svg { color: var(--emerald); margin-top: 1px; }

/* -------------------------------------------------------- basket, summary */
.cartlayout {
  display: grid; gap: var(--s-2xl); grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start; margin: var(--s-lg) 0 var(--s-3xl);
}
.cartlines { display: grid; gap: var(--s-md); }
.line {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: var(--s-lg);
  align-items: center; padding: var(--s-md) var(--s-lg);
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-card);
}
.line--warn { border-color: #fecaca; background: #fffafa; }
.line__img { width: 72px; aspect-ratio: 4 / 5; border-radius: var(--r-md); overflow: hidden; background: var(--surface-muted); }
.line__img img { width: 100%; height: 100%; object-fit: contain; }
.line__name { font-weight: 700; font-size: var(--t-small); }
.line__note { margin-top: 4px; font-size: var(--t-caption); color: var(--error); }
.line__note a { text-decoration: underline; }
.line__qty { display: grid; justify-items: center; gap: 2px; }
.line__total { font-weight: 800; min-width: 80px; text-align: right; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-pill); overflow: hidden; }
.stepper button {
  width: 40px; min-height: 40px; height: 40px; border: 0; background: var(--surface);
  font-size: 18px; font-weight: 700; cursor: pointer; color: var(--emerald);
}
.stepper button:hover { background: var(--emerald-soft); }
.stepper button:disabled { color: var(--text-3); cursor: not-allowed; background: var(--surface); }
.stepper__n { min-width: 32px; text-align: center; font-weight: 700; }

.summary {
  position: sticky; top: calc(var(--header-h) + 60px);
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--r-card); padding: var(--s-xl);
}
.summary h2 { font-size: var(--t-h3); font-weight: 700; margin-bottom: var(--s-md); }
.summary p { margin-top: var(--s-md); }
.sumlist { margin: 0 0 var(--s-lg); display: grid; gap: var(--s-sm); font-size: var(--t-small); }
.sumlist div { display: flex; justify-content: space-between; gap: var(--s-lg); }
.sumlist dt { color: var(--text-2); }
.sumlist dd { margin: 0; font-weight: 600; text-align: right; }
.sumlist .is-saving dd { color: var(--success); }
.sumlist .is-total { border-top: 1px solid var(--divider); padding-top: var(--s-sm); font-size: var(--t-body); }
.sumlist .is-total dt { color: var(--text); font-weight: 700; }
.sumlist .is-total dd { font-weight: 800; }
.sumlines { display: grid; gap: 6px; margin-bottom: var(--s-md); font-size: var(--t-caption); color: var(--text-2); }
.sumlines li { display: flex; justify-content: space-between; gap: var(--s-md); }
.sumlines--roomy { font-size: var(--t-small); color: var(--text); gap: var(--s-md); }
.sumlines--roomy li { padding-bottom: var(--s-md); border-bottom: 1px solid var(--divider); }

.checkout {
  display: grid; gap: var(--s-2xl); grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start; margin: var(--s-lg) 0 var(--s-3xl);
}
.checkout__main { display: grid; gap: var(--s-lg); }

.done { max-width: 560px; margin: var(--s-3xl) auto; text-align: center; }
.done__icon {
  width: 72px; height: 72px; margin: 0 auto var(--s-lg); border-radius: 50%;
  display: grid; place-items: center; background: var(--success-soft); color: var(--success);
}
.done__facts { text-align: left; margin: var(--s-xl) 0; padding: var(--s-lg); background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-card); }
.done__actions { display: flex; gap: var(--s-md); justify-content: center; flex-wrap: wrap; }

/* -------------------------------------------------------- sign in, account */
.auth {
  max-width: 420px; margin: var(--s-3xl) auto; padding: var(--s-2xl);
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--r-card-lg);
}
.auth > p { margin-bottom: var(--s-xl); }
.phone { display: flex; align-items: stretch; }
.phone__cc {
  display: grid; place-items: center; padding: 0 14px; font-weight: 700;
  background: var(--surface-muted); border: 1px solid var(--border); border-right: 0;
  border-radius: var(--r-input) 0 0 var(--r-input);
}
.phone input { border-radius: 0 var(--r-input) var(--r-input) 0; }

.acct { margin: var(--s-xl) 0 var(--s-3xl); }
.acct__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-lg); flex-wrap: wrap; margin-bottom: var(--s-xl); }
.acct__grid { display: grid; gap: var(--s-lg); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.rows { display: grid; }
.rows > li + li { border-top: 1px solid var(--divider); }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-md);
  min-height: 52px; padding: var(--s-sm) 0; font-size: var(--t-small);
}
.row span { display: inline-flex; align-items: center; gap: var(--s-sm); }
a.row:hover strong { color: var(--emerald); }
ul.panel.rows { padding: var(--s-sm) var(--s-xl); margin-bottom: var(--s-3xl); }

.status {
  display: inline-block; font-size: var(--t-overline); font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill);
}
.status.is-pending    { background: var(--warning-soft); color: #8a5a00; }
.status.is-processing { background: var(--info-soft); color: #08539b; }
.status.is-route      { background: #ede9fe; color: #5b21b6; }
.status.is-done       { background: var(--success-soft); color: #166534; }
.status.is-cancelled  { background: var(--surface-muted); color: var(--text-2); }

.addrlist { display: grid; gap: var(--s-md); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: var(--s-3xl); }
.addr p + p { margin-top: 4px; }
.contact { margin-top: var(--s-xl); }
.contact p + p { margin-top: var(--s-sm); }
.contact a { color: var(--emerald); }

/* -------------------------------------------------------------- small screens */
@media (max-width: 960px) {
  .pdp, .cartlayout, .checkout { grid-template-columns: 1fr; gap: var(--s-xl); }
  .summary { position: static; }
}
@media (max-width: 560px) {
  .line { grid-template-columns: 60px minmax(0, 1fr); }
  .line__img { width: 60px; }
  .line__qty { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center; gap: var(--s-md); }
  .line__total { grid-column: 2; text-align: left; }
  .auth { padding: var(--s-xl); margin: var(--s-xl) auto; }
  .buyrow { grid-template-columns: 80px 1fr; }
}
