/* The account and the cart on every page (web/shop.js), and the account's own page (web/me.html). Shared tokens:
   base.css. Nothing here is smaller than 12px. */

/* the cart in the bar on top */
.cart-link {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 13px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cart-link:hover { color: var(--ink); border-color: var(--brand-line); }
.cart-link svg { width: 21px; height: 21px; }
.cart-n {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font: 650 12px/20px var(--font);
  text-align: center;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--surface-solid, #fff);
}

/* what was just done, for a moment, at the bottom */
.shop-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  font-size: 15px;
  line-height: 1.4;
  color: #fff;
  background: rgba(10, 26, 46, 0.94);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.shop-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.shop-toast a { color: #7fe9ff; font-weight: 600; margin-left: 6px; }

/* add to the cart, save, watch the price */
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  font: 560 14.5px/1.2 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.act:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.act:active { transform: translateY(0.5px); }
.act:disabled { opacity: 0.6; cursor: progress; }
.act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.act[data-shop="cart"] { flex: 1 1 100%; }
.act.on { color: var(--brand-ink); border-color: var(--brand-line); background: var(--brand-soft); }
.act.heart.on svg { fill: #e5484d; stroke: #e5484d; }
.look-acts { margin-top: 12px; }
.look-acts .act[data-shop="cart"] { flex: 1 1 auto; }

/* the account's page */
.acct-page { max-width: 980px; }
.acct-gate { max-width: 520px; margin: 0 auto 28px; }
.acct-gate .lead { margin-bottom: 18px; }
.acct-switch { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.acct-switch button { min-height: 38px; padding: 0 16px; font: 580 15px/1 var(--font); color: var(--ink-2); background: transparent; border: 0; border-radius: 11px; cursor: pointer; }
.acct-switch button.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); }
.acct-form { display: grid; gap: 6px; margin: 0 0 8px; }
.acct-form label { margin-top: 6px; font-size: 14px; font-weight: 560; color: var(--ink-2); }
.acct-form .input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 14px;
  font: 450 16px/1.2 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 13px;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.acct-form .input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.alert-set .input { min-height: 38px; padding: 0 10px; font: 450 15px/1.2 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; }
.acct-form .go,
.acct-form .ghost { margin-top: 12px; justify-self: start; }
.hint { margin-left: 6px; font-weight: 450; color: var(--muted); }
.acct-alt { margin: 6px 0 0; }
/* Continue with Google: Google's own button (white, or its dark variant), the multicolour G, the site's font. */
.g-way { display: grid; gap: 14px; margin: 0 0 6px; }
.g-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  font: 560 16px/1.2 var(--font);
  color: #1f1f1f;
  background: #ffffff;
  border: 1px solid #747775;
  border-radius: 13px;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.g-btn:hover { background: #f1f1f1; color: #1f1f1f; }
.g-btn:active { background: #e8e8e8; }
.g-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.g-logo { flex: none; width: 20px; height: 20px; }
:root[data-theme="dark"] .g-btn { color: #e3e3e3; background: #131314; border-color: #8e918f; }
:root[data-theme="dark"] .g-btn:hover { background: #242426; color: #e3e3e3; }
:root[data-theme="dark"] .g-btn:active { background: #2c2c2e; }
.g-way .join-said { margin: 0; }
.g-or { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 13px; color: var(--muted); }
.g-or::before,
.g-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.acct-sell { margin: 4px 0 0; }
.acct-sell a { color: var(--brand-ink); }
.linkish { padding: 0; font: inherit; font-size: 14px; color: var(--brand-ink); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.acct-local { margin: 4px 0 10px; color: var(--muted); font-weight: 560; }

.acct-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 16px; }
.acct-head .h2 { margin: 0 0 4px; }
.acct-tabs { display: flex; gap: 6px; margin: 0 0 18px; padding: 0 0 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.acct-tabs::-webkit-scrollbar { display: none; }
.acct-tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 11px 14px; font-size: 15px; font-weight: 580; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -3px; }
.acct-tabs a:hover { color: var(--ink); }
.acct-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.acct-tabs .n:not(:empty) { min-width: 22px; padding: 1px 7px; font-size: 12.5px; font-weight: 650; text-align: center; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; }
.acct-tabs a[hidden] { display: none; }

.acct-empty { padding: clamp(22px, 4vw, 36px); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.acct-empty .h3 { margin: 0 0 8px; }
.acct-empty p { color: var(--ink-2); }

/* the cart: a summary, then a block a store */
.cart-sum { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 12px; padding: 14px 18px; font-size: 16px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 16px; }
/* money is set in the brand face with figures of one width, as the prices on the answer cards */
.cart-sum span { font-size: 17px; font-weight: 660; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; color: var(--ink); }
.cart-store { margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-1); overflow: hidden; }
.cart-store-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cart-store-name { font-size: 17px; font-weight: 640; color: var(--ink); text-decoration: none; }
.cart-store-name:hover { color: var(--brand-ink); text-decoration: underline; }
.cart-store-sum { font-size: 16px; font-weight: 660; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.cart-line:first-child { border-top: 0; }
.cart-line.hit { background: color-mix(in srgb, var(--good) 9%, transparent); }
.acct-pic { display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.acct-pic img { width: 100%; height: 100%; object-fit: contain; }
.cart-what { min-width: 0; }
.cart-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 560; line-height: 1.35; color: var(--ink); text-decoration: none; }
.cart-title:hover { color: var(--brand-ink); text-decoration: underline; }
.cart-price { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.cart-price s { color: var(--muted); }
.cart-drop { color: var(--good); font-weight: 560; }
.cart-rise,
.cart-out { color: var(--warn); }
.alert-hit { margin: 4px 0 0; font-size: 14px; font-weight: 640; color: var(--good); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.qty-b { width: 36px; height: 36px; font-size: 18px; color: var(--ink); background: var(--surface); border: 0; cursor: pointer; }
.qty-b:hover { background: var(--surface-2); }
.qty-n { min-width: 30px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.cart-end { display: grid; justify-items: end; gap: 6px; }
.cart-buy { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--btn-ink, #fff); background: var(--btn, var(--brand)); border-radius: 10px; text-decoration: none; white-space: nowrap; }
.cart-buy:hover { background: var(--btn-hover, var(--brand)); }
.cart-store-foot { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.cart-store-foot .pay { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 14px; text-decoration: none; }
/* show.css lets a .ghost button take a whole row on a phone; on the account's page they stay their own size. */
.acct-page .acct-head .ghost,
.acct-page .alert-set .ghost { flex: none; width: auto; }
.alert-set .ghost { min-height: 38px; padding: 0 14px; }
.alert-set .input { width: 104px; }
.cart-store-foot .note { margin: 8px 0 0; }
.alert-set { display: flex; gap: 6px; align-items: center; }
.alert-set .input { width: 110px; margin: 0; }

/* Check out on 0cean (me.js, src/checkout.ts): the delivery once, then each store's own total and its filled checkout */
.co-box { margin: 18px 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.co-box .h3 { margin: 0 0 6px; }
.co-lead { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
/* Two short groups, not one long column: six tracks, and each field takes the width its answer needs. */
.co-form { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px 12px; }
.co-form .co-field { grid-column: span 3; display: grid; align-content: start; gap: 5px; min-width: 0; }
.co-form .co-f-street_address { grid-column: span 4; }
.co-form .co-f-extended_address,
.co-form .co-f-address_locality,
.co-form .co-f-address_region,
.co-form .co-f-postal_code { grid-column: span 2; }
.co-form .wide { grid-column: 1 / -1; }
.co-form label { margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.co-form .input { min-height: 44px; }
.co-group { margin: 10px 0 0; font-size: 13px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.co-group:first-child { margin-top: 0; }
.co-form .co-keep { overflow: visible; white-space: normal; }
.co-form select.input { appearance: auto; padding-right: 10px; }
.co-keep { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 14px; font-weight: 450; color: var(--ink-2); }
.co-keep input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.co-form .pay { margin-top: 14px; justify-self: start; min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.co-form .pay:disabled { opacity: 0.6; cursor: default; transform: none; }
.co-results { display: grid; gap: 12px; margin-top: 18px; }
.co-store { padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.co-store-name { margin: 0 0 10px; font-size: 17px; font-weight: 650; }
.co-lines { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0 0 10px; font-size: 15px; }
.co-lines dt { color: var(--ink-2); }
.co-lines dd { margin: 0; text-align: right; font-weight: 560; font-variant-numeric: tabular-nums; }
.co-lines .co-total { padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.co-store .note { margin: 6px 0 0; }
.co-store .pay { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 12px; padding: 0 22px; border-radius: 14px; text-decoration: none; }
.co-ask { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--warn); }
.co-opened { margin: 0 0 18px; }
.co-opened .h3 { margin: 0 0 10px; }
.co-opened-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.co-opened-list li { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 12px 16px; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.co-opened-list .note { color: var(--muted); }
.co-paid { color: var(--good); font-weight: 650; }
.co-again { color: var(--brand-ink); font-weight: 600; }

/* saved products */
.acct-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.acct-tile { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.acct-tile-link { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.acct-tile-link .acct-pic { width: 100%; height: auto; aspect-ratio: 1; }
.acct-tile .tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.35; font-weight: 520; }
.acct-tile .tile-price { font-size: 15.5px; font-weight: 660; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.acct-tile .tile-price s { margin-left: 4px; font-size: 12px; color: var(--muted); }
.acct-tile .tile-store { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.acct-tile-acts { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acct-tile-acts .act { min-height: 38px; padding: 0 12px; font-size: 14px; }

@media (max-width: 640px) {
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "pic what" "qty end"; row-gap: 10px; }
  .cart-line .acct-pic { grid-area: pic; width: 64px; height: 64px; }
  .cart-line .cart-what { grid-area: what; }
  .cart-line .qty,
  .cart-line .alert-set { grid-area: qty; justify-self: start; }
  .cart-line .cart-end { grid-area: end; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
  .acct-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .acct-head { flex-wrap: wrap; }
  .cart-link { width: 40px; height: 40px; }
  .cart-store-foot .pay { width: 100%; }
  .co-box { padding: 16px; }
  /* a phone: the names and the region with the code stand two in a row, the rest one under another */
  .co-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-form .co-field { grid-column: 1 / -1; }
  .co-form .co-f-first_name, .co-form .co-f-last_name, .co-form .co-f-address_region, .co-form .co-f-postal_code { grid-column: span 1; }
  .co-form .pay,
  .co-store .pay { width: 100%; }
  /* a price alert: the price to wait for on a row of its own */
  .alerts .cart-line { grid-template-areas: "pic what" "set set" "end end"; }
  .alerts .cart-line .alert-set { grid-area: set; }
  .alerts .cart-line .cart-end { grid-area: end; justify-content: flex-start; }
}
/* On a phone the moment's word stands above the tabs at the bottom of the screen (base.css). */
@media (max-width: 760px) {
  .shop-toast { bottom: calc(var(--tabs-h, 0px) + 12px); }
}

/* a gift basket in the conversation: all of it into the cart at once */
.bk-cart { margin: 10px 0 0; }
