:root {
  --accent: #ff0054;
  --accent-rgb: 255, 0, 84;
  --bg: #0b131d;
  --surface: #111c29;
  --surface-2: #182536;
  --surface-3: #223146;
  --text: #f7f9fc;
  --muted: #94a2b5;
  --line: rgba(255, 255, 255, 0.09);
  --danger: #ff4967;
  --danger: light-dark(#be123c, #ff4967);
  --success: #37d996;
  --success: light-dark(#0b7a48, #37d996);
  --radius: 24px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  /* Paper sets color-scheme: light in applyStoreDesign. The second value is
     the dark store's current shadow, so midnight stays put. */
  --shadow: 0 24px 60px light-dark(color-mix(in srgb, var(--text) 9%, transparent), rgba(0, 0, 0, 0.35));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% -10%, light-dark(rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.18)), transparent 33rem),
    linear-gradient(180deg, var(--surface) 0, var(--bg) 28rem);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 24px calc(124px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 80px;
  padding: 14px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 98%, transparent), color-mix(in srgb, var(--bg) 82%, transparent) 75%, transparent);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.28);
  box-shadow: 0 10px 28px light-dark(color-mix(in srgb, var(--accent) 18%, transparent), rgba(var(--accent-rgb), 0.28));
  font-size: 22px;
  font-weight: 900;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.brand-mark.has-logo {
  background: transparent;
  box-shadow: none;
}

.brand-mark.has-logo img {
  object-fit: contain;
  border-radius: 0;
}

.brand-wordmark {
  display: block;
  height: 30px;
  width: auto;
  max-width: min(220px, 46vw);
}

@media (max-width: 480px) {
  .brand-wordmark {
    height: 24px;
  }
}

/* The lettered name already says whose shop this is; the generic label above it is clutter. */
.topbar.has-wordmark .brand-copy .eyebrow {
  display: none;
}

.topbar.has-wordmark #store-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#shop-view {
  display: flex;
  flex-direction: column;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1,
.section-heading h2,
.hero h2,
.drawer h2,
.dialog-copy h2,
.status-panel h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.brand-copy h1 {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(17px, 3vw, 24px);
  line-height: 1.12;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.icon-button {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  cursor: pointer;
}

.icon-button svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.language-control {
  position: relative;
}

.language-button {
  display: flex;
  min-width: 72px;
  height: 46px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 850;
}

.language-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 10px);
  right: 0;
  width: 170px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.language-menu button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button.active {
  background: var(--surface-3);
  color: var(--accent);
}

.app-view {
  animation: reveal 0.3s ease-out;
}

.page-view {
  min-height: 70vh;
  padding-top: 36px;
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 26px;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

/* A long one-word title ("Buyurtmalaringiz") must not push the page wider than the phone. */
.page-heading > div {
  min-width: 0;
}

.page-heading h2 {
  margin: 0;
  font-size: clamp(30px, 6vw, 48px);
  letter-spacing: -0.035em;
}

.secondary-button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 800;
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.secondary-button.danger {
  border-color: rgba(255, 73, 103, 0.35);
  color: var(--danger);
}

.hero {
  display: flex;
  min-height: 260px;
  margin: 28px 0 52px;
  padding: clamp(28px, 7vw, 64px);
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 34px;
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.18), transparent 48%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
  background:
    linear-gradient(120deg, light-dark(rgba(var(--accent-rgb), 0.10), rgba(var(--accent-rgb), 0.18)), transparent 48%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
  box-shadow: var(--shadow);
}

.hero h2 {
  max-width: 700px;
  font-size: clamp(36px, 8vw, 72px);
  line-height: 0.98;
  /* JS shrinks the title until its longest word fits (fitHeading); this is
     the safety net if even the minimum size is too wide. */
  overflow-wrap: anywhere;
}

.hero > div {
  min-width: 0;
  max-width: 100%;
}

.hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.primary-button {
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 12px 28px light-dark(color-mix(in srgb, var(--accent) 16%, transparent), rgba(var(--accent-rgb), 0.22));
  color: white;
  cursor: pointer;
  font-weight: 850;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.5);
  opacity: 0.65;
  transform: none;
}

.primary-button.wide {
  width: 100%;
}

.catalog-section {
  animation: reveal 0.45s ease-out;
}

.catalog-section:not([hidden]) {
  display: contents;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  font-size: clamp(28px, 5vw, 42px);
}

.search-box {
  display: flex;
  width: min(280px, 45vw);
  height: 48px;
  padding: 0 16px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.search-box svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  overflow: visible;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.category-tabs {
  display: flex;
  margin: 26px -4px 30px;
  padding: 4px;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.category-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
  box-shadow: 0 10px 24px light-dark(color-mix(in srgb, var(--accent) 16%, transparent), rgba(var(--accent-rgb), 0.2));
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(var(--product-columns, 3), minmax(0, 1fr));
  grid-auto-rows: 300px;
  grid-auto-flow: dense;
  gap: 18px;
}

.product-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  box-shadow: 0 14px 34px light-dark(color-mix(in srgb, var(--text) 8%, transparent), rgba(0, 0, 0, 0.16));
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  transform: translateY(-3px);
}

.product-card[data-span-columns="2"][data-span-rows="1"],
.product-card[data-span-columns="3"][data-span-rows="1"],
.product-card[data-span-columns="4"][data-span-rows="1"] {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  column-gap: 18px;
}

.product-card[data-span-columns="2"][data-span-rows="1"] .product-image,
.product-card[data-span-columns="3"][data-span-rows="1"] .product-image,
.product-card[data-span-columns="4"][data-span-rows="1"] .product-image {
  height: 100%;
  grid-row: 1 / span 4;
}

.product-card.product-size-wide,
.product-card.product-size-large {
  grid-column: span 2;
}

.product-card.product-size-wide {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  column-gap: 18px;
}

.product-card.product-size-wide .product-image {
  grid-row: 1 / span 4;
  aspect-ratio: 1.3 / 1;
}

.product-card.product-size-small {
  padding: 10px;
}

.product-card.product-size-small .product-description {
  display: none;
}

.design-card-outlined .product-card {
  background: transparent;
  box-shadow: none;
}

.design-card-minimal .product-card {
  padding: 6px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.design-hero-compact .hero {
  min-height: 170px;
  padding: 30px;
}

.design-hero-compact .hero h2 {
  font-size: clamp(30px, 6vw, 52px);
}

.design-hero-editorial .hero {
  align-items: center;
  text-align: center;
}

.design-hero-editorial .hero > div {
  margin: auto;
}

.design-navigation-tabs .bottom-nav {
  border-radius: 18px 18px 0 0;
}

.design-navigation-minimal .bottom-nav {
  border-color: transparent;
  background: color-mix(in srgb, var(--bg), transparent 12%);
  box-shadow: none;
}

.product-image {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 116px;
  flex: 1 1 auto;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 25%, rgba(var(--accent-rgb), 0.25), transparent 55%),
    var(--surface-3);
}

.product-card[data-span-rows="2"] .product-image,
.product-card[data-span-rows="3"] .product-image,
.product-card[data-span-rows="4"] .product-image {
  height: auto;
  min-height: 150px;
}

.product-quantity-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 8px 20px light-dark(color-mix(in srgb, var(--accent) 20%, transparent), rgba(var(--accent-rgb), 0.35));
  font-size: 14px;
  font-weight: 900;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: color-mix(in srgb, var(--text) 18%, transparent);
  font-size: 56px;
  font-weight: 950;
}

/* Names may take up to three lines ("Готовое питание (Meal Prep)" was cut to "Готовое пита…"), and the
   title never shrinks below its own line box — a squeezed box sliced the descenders off. */
.product-card h3 {
  display: -webkit-box;
  flex-shrink: 0;
  margin: 17px 2px 7px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: break-word;
  padding-bottom: 1px;
}

.product-description {
  display: -webkit-box;
  min-height: 42px;
  margin: 0 2px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.product-card[data-span-rows="1"] .product-description {
  min-height: 20px;
  -webkit-line-clamp: 1;
}

.product-footer {
  display: flex;
  margin-top: auto;
  padding: 20px 2px 2px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-price {
  font-size: 17px;
  font-weight: 900;
}

.add-button {
  display: flex;
  min-width: 62px;
  height: 42px;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 24px;
  font-weight: 400;
}

.add-button span:first-child {
  font-size: 16px;
}

.product-quantity-control {
  display: flex;
  height: 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.08);
}

.product-quantity-control button {
  width: 38px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 22px;
}

.product-quantity-control strong {
  min-width: 26px;
  text-align: center;
  font-size: 15px;
}

.status-panel,
.empty-state {
  display: grid;
  min-height: 340px;
  padding: 40px 24px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.status-panel p,
.empty-state p,
.empty-cart p {
  max-width: 480px;
  margin: 9px 0;
  color: var(--muted);
  line-height: 1.6;
}

.loader {
  width: 42px;
  height: 42px;
  margin-bottom: 24px;
  border: 3px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 22px;
  background: var(--surface-2);
  font-size: 28px;
}

.scrim {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(2, 7, 12, 0.68);
  backdrop-filter: blur(5px);
}

.drawer {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  display: flex;
  width: min(520px, 100%);
  height: 100dvh;
  padding: calc(24px + env(safe-area-inset-top)) 26px calc(24px + env(safe-area-inset-bottom));
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.45);
  box-shadow: -30px 0 70px light-dark(color-mix(in srgb, var(--text) 12%, transparent), rgba(0, 0, 0, 0.45));
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.close-button {
  font-size: 30px;
  font-weight: 300;
}

.text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.text-button.danger {
  color: var(--danger);
}

.cart-lines {
  display: flex;
  padding: 22px 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.cart-page .cart-lines {
  min-height: 0;
  padding-top: 0;
  overflow: visible;
}

.cart-page .cart-line {
  grid-template-columns: 100px minmax(0, 1fr) auto;
  min-height: 126px;
  padding: 16px;
}

.cart-page .cart-thumb {
  width: 100px;
  height: 100px;
}

.cart-page .cart-line h3 {
  font-size: 18px;
}

.cart-page .cart-line-price {
  font-size: 16px;
}

.cart-line {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.cart-thumb {
  width: 78px;
  height: 78px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--surface-3);
}

.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.cart-line-price {
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-control button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: var(--surface-3);
  cursor: pointer;
  font-size: 20px;
}

.quantity-control button:last-child {
  background: var(--accent);
}

.empty-cart {
  display: grid;
  flex: 1;
  place-items: center;
  align-content: center;
  text-align: center;
}

.cart-summary {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.cart-page-summary {
  position: sticky;
  z-index: 10;
  bottom: calc(78px + env(safe-area-inset-bottom));
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.25);
  box-shadow: 0 -12px 36px light-dark(color-mix(in srgb, var(--text) 8%, transparent), rgba(0, 0, 0, 0.25));
  backdrop-filter: blur(18px);
}

.summary-line {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 17px;
}

.summary-line strong {
  color: var(--accent);
  font-size: 22px;
}

.checkout-page {
  width: min(760px, 100%);
  margin: 0 auto;
}

.checkout-page form {
  display: flex;
  padding-bottom: 28px;
  flex-direction: column;
  gap: 14px;
}

.checkout-heading {
  justify-content: flex-start;
}

.checkout-heading h2 {
  font-size: clamp(30px, 6vw, 48px);
}

/* Two equal halves whatever the label length: plain 1fr is minmax(auto, 1fr),
   so a long label ("Самовывоз") widened its own column and pushed past the card. */
.fulfilment-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fulfilment-switch button {
  display: flex;
  min-width: 0;
  min-height: 58px;
  padding: 8px 12px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.fulfilment-switch button.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.fulfilment-switch button span {
  min-width: 0;
  overflow-wrap: break-word;
  line-height: 1.15;
  text-align: center;
}

.fulfilment-icon {
  flex: 0 0 auto;
  width: 31px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (max-width: 440px) {
  .fulfilment-switch button {
    min-height: 70px;
    padding: 8px 6px;
    flex-direction: column;
    gap: 4px;
  }
}

.address-picker-button {
  display: grid;
  width: 100%;
  min-height: 78px;
  padding: 14px 15px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px dashed rgba(var(--accent-rgb), 0.55);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.address-picker-button.selected {
  border-style: solid;
  border-color: var(--accent);
}

.add-address-button {
  margin-top: 11px;
}

.saved-addresses {
  display: grid;
  gap: 9px;
}

.saved-addresses-empty {
  margin: 0;
  padding: 13px 15px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
}

.saved-address-card {
  display: grid;
  /* One column: the address row (choose | Edit | ×), then the courier note
     under it. Two columns put the note beside the row, where its text
     squeezed the address to a sliver on a phone. */
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.saved-address-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.saved-address-main {
  display: grid;
  min-width: 0;
  min-height: 76px;
  padding: 13px 10px 13px 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.saved-address-marker {
  color: var(--accent);
  font-size: 25px;
}

.saved-address-check {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.saved-address-card:not(.selected) .saved-address-check {
  border: 1px solid var(--line);
  background: transparent;
}

.saved-address-remove {
  width: 42px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 23px;
}

.saved-address-remove:hover {
  background: rgba(255, 73, 103, 0.08);
  color: var(--danger);
}

.saved-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
}

.saved-address-edit {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.courier-note {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.courier-note.muted {
  color: var(--muted);
}

.courier-note button {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.settings-address-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.settings-address-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.settings-address-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-address-actions,
.address-confirm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-address-actions button,
.address-confirm-row button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.settings-address-actions button.danger,
.address-confirm-row button.danger {
  color: var(--danger);
}

.dialog-ingredients {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}

.ingredient-line {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.allergen-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 73, 103, 0.16);
  color: var(--danger, #ff4967);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.remove-ingredients-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.ingredient-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
}

.ingredient-check input {
  width: 20px;
  height: 20px;
}

.cart-without,
.review-without,
.order-without {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.preorder-hint {
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.cutoff-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 16px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cutoff-note-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--accent);
}

.cutoff-note-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cutoff-note-text {
  min-width: 0;
  flex: 1 1 auto;
}

.preorder-cutoff {
  margin: 0 0 12px;
}

.preorder-dates {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.preorder-date {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.preorder-date.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.preorder-time {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.preorder-time-option,
.preorder-clock-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

/* The time choice sits inside a .form-card, whose generic label (grid) and
   input (full width, 48px) rules outrank the class selectors above: each
   radio rendered as a 48px circle stacked over its text. Rows like the
   payment options instead. */
.form-card .preorder-time-option {
  display: flex;
  min-height: 48px;
  margin-top: 0;
  padding: 0 14px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.form-card .preorder-time-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.form-card .preorder-time-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
}

.form-card .preorder-time-option small,
.preorder-clock-field select,
.slot-fields select,
.form-card select {
  min-width: 0;
  max-width: 100%;
}

.preorder-clock-field {
  flex-wrap: wrap;
}

.preorder-clock-field select,
.slot-fields select,
.form-card select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.slot-fields {
  display: grid;
  gap: 10px;
}

.slot-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.delivery-hours {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  list-style: none;
}

.delivery-hours li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.email-field {
  min-width: 0;
}

.email-verify {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
}

.email-verify-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.email-verify-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.form-card .email-verify-row input {
  flex: 1 1 8rem;
  width: auto;
  min-width: 0;
  max-width: 100%;
  height: 44px;
}

.email-verify .secondary-button {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
}

.email-confirmed {
  margin: 0;
  color: var(--success);
  font-weight: 750;
}

.email-verify .form-error {
  margin: 0;
}

#asap-closed {
  color: #ff98aa;
  color: light-dark(#be123c, #ff98aa);
}

.add-email-card {
  display: grid;
  gap: 8px;
}

.add-email-card h3,
.add-email-card p {
  margin: 0;
}

.add-email-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.add-email-card .primary-button {
  width: 100%;
}

[data-language][hidden] {
  display: none !important;
}

.order-comment,
.order-fulfil-date {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

#saved-addresses-settings .secondary-button {
  margin-top: 8px;
}

.address-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 24px;
}

.selection-button {
  display: grid;
  width: 100%;
  min-height: 68px;
  padding: 12px 15px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.selection-button > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.selection-button small {
  color: var(--muted);
}

.selection-icon {
  color: var(--accent);
  font-size: 27px;
}

.address-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.address-copy strong {
  color: var(--text);
  font-size: 15px;
}

.address-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-privacy {
  margin: 9px 2px 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
}

.form-card h3 {
  margin: 0 0 18px;
}

.form-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-card label + label,
.form-row {
  margin-top: 14px;
}

.form-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}

.form-card textarea {
  width: 100%;
  min-height: 92px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.form-card input:focus {
  border-color: var(--accent);
}

.form-card textarea:focus {
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.payment-options {
  display: grid;
  gap: 10px;
}

.payment-option {
  display: flex !important;
  min-height: 52px;
  padding: 0 14px;
  align-items: center;
  grid-template-columns: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.payment-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.payment-option input {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  accent-color: var(--accent);
}

.payment-option > span {
  display: grid;
  gap: 3px;
}

.payment-option strong {
  color: var(--text);
  font-size: 14px;
}

.payment-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.total-line {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.form-error {
  margin: 0;
  padding: 13px 16px;
  border: 1px solid rgba(255, 73, 103, 0.28);
  border-radius: 14px;
  background: rgba(255, 73, 103, 0.08);
  color: #ff98aa;
  color: light-dark(#be123c, #ff98aa);
  font-size: 14px;
}

.place-order {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  margin-top: 4px;
}

.address-dialog {
  width: min(900px, calc(100% - 24px));
  height: min(820px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  outline: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}

.address-dialog::backdrop {
  background: rgba(2, 7, 12, 0.78);
  backdrop-filter: blur(7px);
}

.address-dialog-header {
  position: absolute;
  z-index: 1000;
  top: 14px;
  right: 14px;
  left: 14px;
  display: flex;
  min-height: 68px;
  padding: 10px 12px 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.address-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.address-map {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
}

.map-center-pin {
  position: absolute;
  z-index: 700;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  pointer-events: none;
  transform: translate(-50%, -100%) rotate(45deg);
  border: 3px solid white;
  border-radius: 50% 50% 0 50%;
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 10px 28px light-dark(color-mix(in srgb, var(--accent) 22%, transparent), rgba(var(--accent-rgb), 0.42));
}

.map-center-pin span {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
}

.map-location-button {
  position: absolute;
  z-index: 750;
  right: 18px;
  bottom: 190px;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--accent);
  cursor: pointer;
  font-size: 29px;
}

.map-location-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.map-delivery-area-button {
  position: absolute;
  z-index: 750;
  left: 18px;
  bottom: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 110px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.map-delivery-area-button[hidden] { display: none; }
.map-delivery-area-button > span:first-child {
  width: 22px;
  border-top: 5px solid #1677ff;
  border-radius: 3px;
  flex: 0 0 auto;
}

.map-loading {
  position: absolute;
  z-index: 650;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: var(--surface-3);
  color: var(--muted);
  text-align: center;
}

.address-confirm-card {
  position: absolute;
  z-index: 800;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  padding: 18px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.address-confirm-card small {
  margin-bottom: 8px;
  color: var(--muted);
}

.address-confirm-card button:disabled {
  opacity: 0.55;
}

.sheet-dialog {
  position: fixed;
  inset: 0;
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  outline: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}

.sheet-dialog::backdrop {
  background: rgba(2, 7, 12, 0.78);
  backdrop-filter: blur(7px);
}

.sheet-dialog-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  padding: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px);
}

.sheet-dialog-header h2 {
  margin: 0;
}

.sheet-dialog form {
  display: grid;
  padding: 20px;
  gap: 15px;
}

.sheet-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.sheet-dialog input:not([type="radio"]),
.sheet-dialog textarea {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.sheet-dialog textarea {
  min-height: 88px;
  padding-top: 13px;
  resize: vertical;
}

.sheet-dialog input:focus,
.sheet-dialog textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.address-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.resolved-address-preview {
  display: grid;
  padding: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 15px;
  background: rgba(var(--accent-rgb), 0.08);
}

.resolved-address-preview[hidden] {
  display: none;
}

.resolved-address-preview > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.resolved-address-preview strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
}

.resolved-address-preview small {
  color: var(--muted);
  font-size: 12px;
}

.resolved-address-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-size: 22px;
  font-weight: 900;
}

.address-coordinates {
  margin: 0;
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
}

.time-option {
  display: grid !important;
  min-height: 74px;
  padding: 12px 14px;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 13px !important;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
  cursor: pointer;
}

.time-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.time-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.time-option > span:last-child {
  display: grid;
  gap: 4px;
}

.time-option strong {
  color: var(--text);
  font-size: 15px;
}

.time-option small {
  color: var(--muted);
  font-size: 11px;
}

.time-option-icon {
  font-size: 28px;
}

.time-option-icon.asap {
  color: var(--success);
}

.time-option-icon.scheduled {
  color: #4387ff;
  color: light-dark(#1d4f91, #4387ff);
}

.leaflet-control-zoom {
  margin-top: 100px !important;
}

.leaflet-control-attribution {
  margin-bottom: 158px !important;
}

/*
 * Leaflet's structural rules live here as a local fallback. They keep map
 * tiles aligned and gestures functional even if the CDN stylesheet is slow
 * or a Telegram webview delays applying it.
 */
.leaflet-container {
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  background: #d8e0e7;
  outline-offset: 1px;
}

.leaflet-container.leaflet-touch-drag,
.leaflet-container.leaflet-touch-zoom {
  touch-action: none;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  top: 0;
  left: 0;
}

.leaflet-map-pane canvas {
  z-index: 100;
}

.leaflet-map-pane svg {
  z-index: 200;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  max-width: none !important;
  max-height: none !important;
  user-select: none;
}

.leaflet-tile-container {
  pointer-events: none;
}

.leaflet-zoom-animated {
  transform-origin: 0 0;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
  transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1);
}

.leaflet-control-container {
  position: absolute;
  z-index: 800;
  inset: 0;
  pointer-events: none;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  float: left;
  clear: both;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 800;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-control-zoom a {
  display: block;
  width: 34px;
  height: 34px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font: 22px/34px Arial, sans-serif;
}

.leaflet-control-zoom a:first-child {
  border-radius: 10px 10px 0 0;
}

.leaflet-control-zoom a:last-child {
  border: 0;
  border-radius: 0 0 10px 10px;
}

.leaflet-control-attribution {
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.82);
  color: #333;
  font-size: 9px;
}

.leaflet-control-attribution a {
  color: #075e9b;
}

.product-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(90dvh, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  outline: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}

.product-dialog::backdrop {
  background: rgba(2, 7, 12, 0.72);
  backdrop-filter: blur(6px);
}

.dialog-close {
  position: absolute;
  z-index: 10;
  top: 16px;
  right: 16px;
  font-size: 30px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  color: light-dark(#fff, var(--text));
}

/* Image Gallery */
.dialog-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
  overflow: hidden;
}

/* A native scroll-snap strip: the swipe is driven by the browser and tracks
   the finger exactly; JS only mirrors the position into dots and counter. */
.gallery-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  outline: 0;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-3);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

/* Letterboxing uses the dark slide background. pan-y: a vertical drag that
   starts on the video still scrolls the product sheet (the browser does it),
   and a horizontal one is left to bindVideoStripSwipe, which moves the strip.
   The control bar still receives taps. */
.gallery-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  background: transparent;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-video-fallback {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 16px;
  text-align: center;
}

.gallery-video-fallback .video-unavailable {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.gallery-zoom {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
}

.gallery-zoom svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Full-screen picture viewer */
.lightbox {
  --lightbox-fade: 1;
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: rgba(0, 0, 0, var(--lightbox-fade));
  color: #fff;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox-track {
  display: flex;
  width: 100%;
  height: 100%;
  touch-action: none;
  will-change: transform;
}

.lightbox-slide {
  display: grid;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
}

.lightbox-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  will-change: transform;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

.lightbox.zoomed .lightbox-slide img {
  cursor: grab;
}

.lightbox-top {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.lightbox-counter {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  font-weight: 750;
}

.lightbox-close,
.lightbox-arrow {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  pointer-events: auto;
}

.lightbox-close {
  margin-left: auto;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 34px;
}

.lightbox-arrow.prev {
  left: 14px;
}

.lightbox-arrow.next {
  right: 14px;
}

.lightbox-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

@media (pointer: coarse) {
  .lightbox-arrow {
    display: none;
  }
}

.gallery-slide .image-placeholder {
  font-size: 72px;
}

.gallery-nav {
  position: absolute;
  z-index: 4;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}

/* Keep the strip controls above the video's own bar so a tap still hits them. */
.dialog-gallery.showing-video .gallery-nav {
  bottom: 72px;
}

.gallery-nav[hidden] {
  display: none;
}

.gallery-prev,
.gallery-next {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gallery-prev:hover,
.gallery-next:hover {
  background: rgba(255,255,255,0.25);
}

.gallery-prev:disabled,
.gallery-next:disabled {
  opacity: 0.3;
  cursor: default;
}

.gallery-dots {
  display: flex;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-dots::-webkit-scrollbar {
  display: none;
}

.gallery-dot {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.gallery-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transform: translate(-50%, -50%);
  transition: background 0.2s, transform 0.2s;
}

.gallery-dot.active::after {
  background: white;
  transform: translate(-50%, -50%) scale(1.2);
}

.gallery-counter {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.gallery-counter[hidden] {
  display: none;
}

/* Dialog Content */
.dialog-copy {
  padding: 24px;
}

.dialog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.breadcrumb-separator {
  color: var(--muted);
  font-size: 12px;
}

.dialog-copy h2 {
  font-size: clamp(24px, 5vw, 36px);
  margin: 0 0 12px;
  line-height: 1.2;
}

/* Stock & Meta badges */
.dialog-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.stock-badge.in-stock {
  background: rgba(55, 217, 150, 0.15);
  color: var(--success);
}

.stock-badge.low-stock {
  background: rgba(255, 189, 46, 0.15);
  color: #ffd369;
  color: light-dark(#8a4b08, #ffd369);
}

.stock-badge.out-of-stock {
  background: rgba(255, 73, 103, 0.15);
  color: var(--danger);
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

.stock-badge.out-of-stock .stock-dot {
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.unit-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.dialog-copy > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-line;
  margin: 0 0 20px;
}

/* Pricing */
.dialog-pricing {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.dialog-pricing strong {
  color: var(--accent);
  font-size: 28px;
}

.dialog-pricing small {
  color: var(--muted);
  font-size: 14px;
}

/* Quantity Selector */
.dialog-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.dialog-quantity > span {
  font-weight: 700;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.quantity-selector button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.quantity-selector button:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.quantity-selector button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.quantity-selector input {
  width: 56px;
  height: 44px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Dialog Footer */
.dialog-footer {
  margin-bottom: 16px;
}

.dialog-add-btn {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
}

.dialog-add-btn:disabled {
  background: var(--surface-3);
  color: var(--muted);
  box-shadow: none;
}

.dialog-add-price {
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.3);
  font-weight: 900;
}

/* Action buttons */
.dialog-actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.action-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.action-button:hover {
  background: var(--surface-3);
}

.action-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-button.favorited {
  color: var(--danger);
}

.action-button.favorited svg {
  fill: currentColor;
}

/* Related Products */
.dialog-related {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.dialog-related h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--muted);
}

.related-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.related-scroll::-webkit-scrollbar {
  display: none;
}

.related-card {
  flex: 0 0 140px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.related-card:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-2px);
}

.related-card-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: 10px;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-image .image-placeholder {
  font-size: 28px;
}

.related-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card-price {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-3);
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease-out;
  font-size: 14px;
  font-weight: 700;
}

.toast.error {
  border-color: rgba(255, 73, 103, 0.35);
}

.bottom-nav {
  position: fixed;
  z-index: 100;
  right: 50%;
  bottom: 0;
  display: grid;
  width: min(1180px, 100%);
  min-height: 78px;
  padding: 8px max(14px, env(safe-area-inset-right))
    calc(8px + env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.28);
  box-shadow: 0 -18px 45px light-dark(color-mix(in srgb, var(--text) 7%, transparent), rgba(0, 0, 0, 0.28));
  backdrop-filter: blur(20px);
  transform: translateX(50%);
}

.bottom-nav-item {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 5px 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.bottom-nav-item.active {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.bottom-nav-item.active .nav-icon {
  transform: translateY(-1px) scale(1.08);
}

.checkout-active .bottom-nav {
  display: none;
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 10px);
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  line-height: 15px;
}

.orders-list {
  display: grid;
  gap: 14px;
}

.order-filter-tabs {
  display: flex;
  margin: -4px 0 20px;
  padding-bottom: 2px;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.order-filter-tabs::-webkit-scrollbar {
  display: none;
}

.order-filter-tab {
  display: inline-flex;
  min-height: 43px;
  padding: 0 12px 0 15px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.order-filter-tab.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.13);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.order-filter-count {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  font-size: 11px;
}

.order-filter-tab.active .order-filter-count {
  background: var(--accent);
  color: white;
}

.order-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}

.order-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.order-card h3 {
  margin: 0 0 5px;
}

.order-card time {
  color: var(--muted);
  font-size: 12px;
}

.status-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 11px;
  font-weight: 850;
}

.status-processing {
  background: rgba(255, 189, 46, 0.13);
  color: #ffd369;
  color: light-dark(#8a4b08, #ffd369);
}

.status-completed,
.status-delivered {
  background: rgba(55, 217, 150, 0.13);
  color: var(--success);
}

.status-cancelled {
  background: rgba(255, 73, 103, 0.13);
  color: var(--danger);
}

.order-items {
  display: grid;
  margin: 17px 0;
  padding: 14px 0;
  gap: 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.order-items > div,
.order-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.order-items span,
.order-card-footer span {
  color: var(--muted);
}

.order-card-footer {
  margin-bottom: 13px;
}

.order-fulfilment {
  margin: -3px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* The -3px pull-up is for a card without notes; after a date or comment line it overlapped them. */
.order-comment + .order-fulfilment,
.order-fulfil-date + .order-fulfilment {
  margin-top: 8px;
}

.cancel-reason {
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 73, 103, 0.08);
  color: #ff98aa;
  color: light-dark(#be123c, #ff98aa);
}

.settings-card {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-2);
}

.settings-card h3 {
  margin: 0 0 7px;
}

.settings-card p {
  margin: 7px 0;
  color: var(--muted);
  line-height: 1.55;
}

.settings-languages {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.settings-languages button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 750;
}

.settings-languages button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.profile-settings-card {
  background: var(--surface-2);
}

.settings-profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}

.profile-settings-card.editing .settings-profile-heading {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-profile-copy {
  min-width: 0;
}

.settings-profile-copy h3,
.settings-profile-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-edit-button {
  display: grid;
  width: 48px;
  height: 48px;
  margin-inline-start: auto;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.profile-edit-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.profile-edit-button[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.profile-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.profile-form {
  display: grid;
  gap: 13px;
}

.profile-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.profile-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

.profile-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.profile-form input:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.profile-form small,
.profile-phone-note {
  color: var(--muted);
  font-size: 12px;
}

.danger-outline-button {
  min-height: 50px;
  border: 1px solid var(--danger);
  border-radius: 14px;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.support-contact-card {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.support-contact-card small { color: var(--muted); }

html[dir="rtl"] .language-menu {
  right: auto;
  left: 0;
}

html[dir="rtl"] .language-menu button,
html[dir="rtl"] input,
html[dir="rtl"] textarea {
  text-align: right;
}

html[dir="rtl"] .product-price-row,
html[dir="rtl"] .cart-line-total,
html[dir="rtl"] .summary-line strong {
  direction: ltr;
  unicode-bidi: isolate;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
}

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

@media (max-width: 820px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card[data-span-columns="3"],
  .product-card[data-span-columns="4"] {
    grid-column: span 2 !important;
  }

  .hero {
    min-height: 240px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar {
    min-height: 70px;
  }

  .brand-mark,
  .icon-button {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .language-button {
    min-width: 64px;
    height: 42px;
    padding: 0 11px;
  }

  .brand-copy .eyebrow {
    display: none;
  }

  .hero {
    min-height: 210px;
    margin: 16px 0 38px;
    padding: 26px 22px;
    border-radius: 25px;
  }

  .hero h2 {
    font-size: 38px;
  }

  .hero-cart {
    display: none;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .search-box {
    width: 45px;
    padding: 0 12px;
  }

  .search-box:focus-within {
    position: absolute;
    z-index: 5;
    right: 14px;
    width: calc(100% - 28px);
  }

  .search-box input {
    min-width: 0;
  }

  .product-grid {
    gap: 10px;
    grid-auto-rows: 270px;
  }

  .product-card {
    padding: 9px;
    border-radius: 18px;
  }

  .product-card[data-span-columns="2"][data-span-rows="1"],
  .product-card[data-span-columns="3"][data-span-rows="1"],
  .product-card[data-span-columns="4"][data-span-rows="1"] {
    display: flex;
  }

  .product-image {
    border-radius: 13px;
  }

  .product-card h3 {
    min-height: 2.5em;
    margin-top: 12px;
    font-size: 15px;
  }

  .product-description {
    min-height: 36px;
    font-size: 12px;
  }

  .product-footer {
    padding-top: 13px;
    flex-wrap: wrap;
  }

  .product-price {
    font-size: 14px;
  }

  .add-button {
    min-width: 56px;
    height: 37px;
    border-radius: 12px;
  }

  .product-quantity-control {
    height: 37px;
  }

  .product-quantity-control button {
    width: 31px;
  }

  .product-quantity-control strong {
    min-width: 22px;
  }

  .cart-page .cart-line {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 108px;
    padding: 12px;
  }

  .cart-page .cart-thumb {
    width: 78px;
    height: 78px;
  }

  .cart-page .cart-line .quantity-control {
    grid-column: 2;
    justify-self: end;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .settings-languages {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    min-height: 74px;
  }

  .address-dialog {
    width: calc(100% - 8px);
    height: calc(100dvh - 8px);
    border-radius: 22px;
  }

  .sheet-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto;
    border-radius: 24px;
  }

  .sheet-dialog-header,
  .sheet-dialog form {
    padding-right: 16px;
    padding-left: 16px;
  }

  .address-dialog-header {
    top: 8px;
    right: 8px;
    left: 8px;
  }

  .address-confirm-card {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .map-location-button {
    right: 12px;
    bottom: 184px;
  }

  .product-dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 24px;
  }

  .dialog-gallery {
    aspect-ratio: 1;
  }

  .gallery-nav {
    padding: 6px 10px;
    gap: 8px;
  }

  .gallery-prev,
  .gallery-next {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .gallery-dot {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
  }

  .dialog-copy {
    padding: 18px;
  }

  .dialog-copy h2 {
    font-size: 22px;
  }

  .dialog-pricing strong {
    font-size: 24px;
  }

  .dialog-quantity {
    padding: 12px;
    margin-bottom: 16px;
  }

  .quantity-selector button {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .quantity-selector input {
    width: 48px;
    height: 40px;
    font-size: 15px;
  }

  .dialog-add-btn {
    min-height: 52px;
    font-size: 15px;
  }

  .dialog-actions {
    gap: 8px;
  }

  .action-button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .action-button svg {
    width: 18px;
    height: 18px;
  }

  .related-card {
    flex: 0 0 120px;
    padding: 8px;
  }

  .related-card h4 {
    font-size: 12px;
  }

  .related-card-price {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------------------------------------------------------------------------
   Support chat
   ---------------------------------------------------------------------------
   A floating button and a chat panel. The merchant sets the colour, the corner
   and the distance from the edge in Dashboard -> Webapp design; everything else
   here is fixed so the button cannot be configured on top of the bottom nav,
   which is 78px tall and always present. */

.support-fab {
  position: fixed;
  z-index: 95;
  bottom: calc(78px + env(safe-area-inset-bottom) + var(--support-offset, 20px));
  display: inline-flex;
  min-width: 52px;
  height: 52px;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 26px;
  background: var(--support-color, #ff6846);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  box-shadow: 0 10px 28px light-dark(color-mix(in srgb, var(--text) 14%, transparent), rgba(0, 0, 0, 0.35));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.support-fab[data-corner="bottom-right"] {
  right: max(var(--support-offset, 20px), env(safe-area-inset-right));
}

.support-fab[data-corner="bottom-left"] {
  left: max(var(--support-offset, 20px), env(safe-area-inset-left));
}

.support-fab.has-label {
  padding: 0 20px;
}

.support-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  box-shadow: 0 14px 34px light-dark(color-mix(in srgb, var(--text) 16%, transparent), rgba(0, 0, 0, 0.42));
}

.support-fab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-fab span {
  overflow: hidden;
  max-width: 150px;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-fab-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg, #0b131d);
  border-radius: 50%;
  background: #35c759;
}

.support-panel {
  position: fixed;
  /* Above .bottom-nav (z-index 100), which is fixed at bottom:0 and otherwise
     covers this panel's composer -- the field and the send button were there
     but unreachable. A chat sheet covering the nav while open is the point. */
  z-index: 101;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  max-height: min(70vh, 560px);
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  background: var(--surface, #111c29);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
  box-shadow: 0 -18px 50px light-dark(color-mix(in srgb, var(--text) 10%, transparent), rgba(0, 0, 0, 0.5));
}

@media (min-width: 620px) {
  .support-panel {
    right: 20px;
    bottom: 20px;
    left: auto;
    width: 380px;
    border-radius: 20px;
  }
}

.support-panel-head {
  display: flex;
  padding: 14px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.support-panel-head strong {
  display: block;
  font-size: 15px;
}

.support-panel-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.support-panel-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3, rgba(255, 255, 255, 0.07));
  color: var(--text, #f7f9fc);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.support-panel-log {
  display: flex;
  padding: 14px 12px;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  overflow-y: auto;
}

/* One unbroken markup string builds these, and pre-wrap is scoped to the <p>.
   On the bubble itself it would preserve the whitespace between child
   elements and every bubble would carry phantom blank lines. */
.support-msg {
  width: fit-content;
  max-width: 82%;
  padding: 7px 11px 5px;
  border-radius: 15px;
  background: var(--surface-3, rgba(255, 255, 255, 0.08));
  color: var(--text, #f7f9fc);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.support-msg p {
  margin: 0;
  white-space: pre-wrap;
}

.support-msg.user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: var(--support-color, #ff6846);
  color: #fff;
}

.support-msg.owner,
.support-msg.system {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.support-msg.follow {
  margin-top: 1px;
}

.support-msg time {
  display: block;
  margin-top: 2px;
  opacity: 0.72;
  font-size: 10px;
  text-align: right;
}

.support-msg img {
  display: block;
  max-width: 200px;
  max-height: 220px;
  margin-bottom: 4px;
  border-radius: 10px;
}

.support-msg a.file {
  display: inline-block;
  margin-bottom: 4px;
  color: inherit;
  font-weight: 700;
}

.support-panel-empty {
  margin: auto;
  padding: 24px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.support-panel-file {
  display: flex;
  padding: 6px 8px 6px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.support-panel-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-panel-file button {
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.support-panel-form {
  display: flex;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  align-items: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.support-panel-form textarea {
  min-width: 0;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 13px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-3, rgba(255, 255, 255, 0.07));
  color: var(--text, #f7f9fc);
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  resize: none;
}

.support-panel-clip,
.support-panel-form button {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.support-panel-clip {
  background: var(--surface-3, rgba(255, 255, 255, 0.07));
  font-size: 18px;
}

.support-panel-clip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.support-panel-form button {
  background: var(--support-color, #ff6846);
  color: #fff;
  font-size: 16px;
}

.support-panel.busy .support-panel-form button,
.support-panel.busy .support-panel-clip {
  opacity: 0.5;
  pointer-events: none;
}


/* ------------------------------------------------------------------------
   Typed address search (2026-09-22)
   ------------------------------------------------------------------------ */
.address-search {
  position: relative;
  margin-bottom: 14px;
}

.address-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
}

.address-search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.address-search-field svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.form-card .address-search-field input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.address-search-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.address-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  max-height: min(360px, 55dvh);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.address-suggestion {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: start;
  cursor: pointer;
}

.address-suggestion:hover,
.address-suggestion.active {
  background: var(--surface-3);
}

.address-suggestion strong,
.address-suggestion small {
  display: block;
}

.address-suggestion strong {
  font-size: 14px;
  font-weight: 750;
}

.address-suggestion small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.address-suggestion-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-weight: 800;
}

.address-suggestion.manual {
  justify-content: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.address-alt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.address-alt-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.address-alt-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------------
   Manual payment, review and payment sheets
   ------------------------------------------------------------------------ */
.manual-preview,
.rail-preview,
.rail-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed rgba(var(--accent-rgb), 0.35);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.05);
}

.rail-preview:not([hidden]),
.rail-card {
  display: grid;
  gap: 10px;
}

.manual-preview-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.payment-instructions {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.payment-instructions a {
  color: var(--accent);
}

.payment-instructions code,
.reference-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.payment-ref {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.payment-ref.pending {
  color: var(--muted);
  cursor: default;
}

.payment-instructions .spoiler {
  border-radius: 4px;
  background: var(--surface-3);
  color: transparent;
  cursor: pointer;
}

.payment-instructions .spoiler:hover {
  color: inherit;
}

.reference-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.08);
  min-width: 0;
}

.reference-block small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-block code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 800;
}

.copy-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.rail-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
}

.rail-copy-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.rail-copy-row code {
  direction: ltr;
  unicode-bidi: isolate;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 800;
}

.upi-qr {
  width: 220px;
  max-width: 100%;
  margin: 4px auto;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
}

.upi-qr img {
  display: block;
  width: 100%;
  height: auto;
}

.upi-open {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.rail-pay-line,
.rail-steps,
.rail-unavailable,
.rail-sent {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.rail-unavailable {
  color: var(--danger);
  font-weight: 750;
}

.rail-sent {
  font-weight: 750;
}

.rail-txn {
  display: grid;
  gap: 8px;
}

.rail-txn input {
  width: 100%;
  min-height: 48px;
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir="rtl"] .rail-copy-row code,
html[dir="rtl"] .upi-qr,
html[dir="rtl"] .rail-txn input {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.payment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 800;
}

.payment-chip.status-awaiting_proof {
  background: rgba(255, 184, 0, 0.16);
  color: #ffc53d;
  color: light-dark(#8a4b08, #ffc53d);
}

.payment-chip.status-proof_submitted {
  background: rgba(56, 142, 255, 0.16);
  color: #7ab6ff;
  color: light-dark(#1d4f91, #7ab6ff);
}

.payment-chip.status-confirmed {
  background: rgba(55, 217, 150, 0.16);
  color: var(--success);
}

.payment-chip.status-rejected {
  background: rgba(255, 73, 103, 0.16);
  color: var(--danger);
}

.proof-uploader {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.proof-uploader small {
  color: var(--muted);
}

.proof-uploader .proof-required {
  color: #ffc53d;
  color: light-dark(#8a4b08, #ffc53d);
  font-weight: 700;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.proof-thumb,
.proof-add {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.proof-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proof-add {
  border: 1.5px dashed rgba(var(--accent-rgb), 0.5);
  background: transparent;
  color: var(--accent);
  text-align: center;
  cursor: pointer;
}

.proof-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
}

.review-body,
.payment-dialog-body,
.sign-in-dialog-body,
.tip-sheet-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.tip-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 12px;
}

.tip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.tip-chip {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.tip-chip.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
}

.tip-message,
.tip-closed {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tip-custom {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.tip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tip-actions button,
#tip-paid,
#tip-continue {
  min-height: 44px;
}

.tip-actions button:disabled {
  opacity: 0.45;
}

.tip-headline {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

#tip-sheet {
  color: var(--text);
  background: var(--surface);
}

#tip-sheet .sheet-dialog-header {
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  color: var(--text);
}

#tip-sheet .sheet-dialog-header h2,
#tip-sheet .eyebrow {
  color: var(--text);
}

#tip-sheet .proof-remove {
  inset-inline-end: 4px;
  inset-inline-start: auto;
  right: auto;
  left: auto;
}

.order-tip-line {
  margin: 8px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.order-tip-button {
  margin-top: 8px;
  min-height: 44px;
}

#checkout-button {
  scroll-margin-bottom: 110px;
}

/* A phone-height cart cannot pin the totals over the tip chips. */
@media (max-height: 780px) {
  .cart-page-summary {
    position: static;
  }

  .tip-chip {
    padding: 8px 12px;
  }

  .summary-line {
    margin-bottom: 10px;
  }
}

.review-items {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.review-item,
.review-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.review-row span {
  color: var(--muted);
}

.review-row strong {
  text-align: end;
  overflow-wrap: anywhere;
}

.review-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.review-actions,
.payment-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  padding: 0 20px 20px;
}

.payment-actions {
  grid-template-columns: 1fr;
  padding: 6px 0 0;
}

.payment-actions a {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.review-error {
  margin: 0 20px 20px;
}

.payment-summary {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

/* ------------------------------------------------------------------------
   Orders
   ------------------------------------------------------------------------ */
.order-address {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.order-payment-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.reference-chip {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.order-origin {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.telegram-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

/* ------------------------------------------------------------------------
   Account and sign-in
   ------------------------------------------------------------------------ */
.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.account-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(55, 217, 150, 0.12);
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sign-in-box {
  display: grid;
  gap: 10px;
}

.sign-in-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.sign-in-form input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
}

.sign-in-form input:focus {
  border-color: var(--accent);
}

.sign-in-form .code-input {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
}

.sign-in-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sign-in-divider {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}

.telegram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: #2aabee;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.telegram-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.support-sign-in {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.support-sign-in p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .review-actions {
    grid-template-columns: 1fr;
  }

  .sign-in-form {
    grid-template-columns: 1fr;
  }

  .reference-block {
    grid-template-columns: minmax(0, 1fr);
  }

  .reference-block code {
    font-size: 19px;
  }

  .reference-block .copy-button {
    justify-self: stretch;
    min-height: 44px;
  }
}


/* Inline SVG icons (2026-09-22): replace glyphs that are missing on phones */
.ui-icon,
.empty-icon svg,
.selection-icon svg,
.time-option-icon svg,
.map-location-button svg,
.resolved-address-icon svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}

.empty-icon svg {
  width: 34px;
  height: 34px;
}

.map-location-button svg {
  width: 22px;
  height: 22px;
}

.saved-address-marker .ui-icon,
.address-suggestion-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.proof-add .ui-icon {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
}

.proof-add {
  align-content: center;
  gap: 4px;
}

.reference-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reference-chip .ui-icon {
  width: 14px;
  height: 14px;
}

/* .form-card label is a grid; the search field is a row. */
.form-card .address-search-field {
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  color: var(--text);
}

/* Shop identity. In the document flow, after the view, so it never covers the
   dock, the sticky cart summary, or the support bubble. Hidden when the store
   has no site block — [hidden] already collapses it. */
.topbar:has(.site-home:not([hidden])) {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.site-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-home svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  margin: 36px 0 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.site-footer p {
  margin: 0;
}

.site-footer-name {
  color: var(--text);
  font-weight: 800;
}

.site-footer-contact,
.site-footer-links,
.site-footer-copy {
  margin-top: 6px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0;
  row-gap: 4px;
}

/* Flex items drop the spaces around the " · " text, so space it here. */
.site-footer-links > span[aria-hidden="true"] {
  padding-inline: 7px;
  opacity: 0.6;
}

.site-footer a {
  color: var(--text);
  font-weight: 700;
  text-underline-offset: 2px;
}

.site-footer-copy {
  font-size: 12px;
}

html[dir="rtl"] .site-footer a[href^="mailto:"],
html[dir="rtl"] .site-footer a[href^="tel:"] {
  direction: ltr;
  unicode-bidi: isolate;
}

.review-consent {
  display: grid;
  gap: 4px;
  margin: 0 20px 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.review-consent p {
  margin: 0;
}

.review-consent a {
  color: var(--accent);
  font-weight: 750;
}

/* Keep Confirm in view while the summary scrolls. The [open] guard matters:
   a class selector would beat the browser's dialog:not([open]) { display: none }
   and the closed sheet would cover the shop. */
.review-dialog.has-consent[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.review-dialog.has-consent[open] .sheet-dialog-header,
.review-dialog.has-consent[open] .review-consent,
.review-dialog.has-consent[open] .review-actions {
  flex-shrink: 0;
}

.review-dialog.has-consent[open] .review-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 560px) {
  .site-home {
    min-height: 42px;
    padding: 0 10px;
  }
}

.tip-label {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.tip-order {
  margin: 0 0 12px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.tip-due {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
}

.tip-due strong {
  font-size: 1.35rem;
  unicode-bidi: isolate;
}

/* Same light values as light-dark() above. Job C sets
   document.documentElement.dataset.scheme in applyStoreDesign — see HANDOFF. */
:root[data-scheme="light"] {
  --danger: #be123c;
  --success: #0b7a48;
  --shadow: 0 24px 60px color-mix(in srgb, var(--text) 9%, transparent);
}

:root[data-scheme="light"] body {
  background:
    radial-gradient(circle at 18% -10%, rgba(var(--accent-rgb), 0.08), transparent 33rem),
    linear-gradient(180deg, var(--surface) 0, var(--bg) 28rem);
}

:root[data-scheme="light"] .hero {
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.10), transparent 48%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
}

:root[data-scheme="light"] .brand-mark:not(.has-logo) {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 18%, transparent);
}

:root[data-scheme="light"] .category-tab.active {
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 16%, transparent);
}

:root[data-scheme="light"] .product-card {
  box-shadow: 0 14px 34px color-mix(in srgb, var(--text) 8%, transparent);
}

:root[data-scheme="light"] .design-card-outlined .product-card,
:root[data-scheme="light"] .design-card-minimal .product-card {
  box-shadow: none;
}

:root[data-scheme="light"] .product-quantity-badge {
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

:root[data-scheme="light"] .primary-button {
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 16%, transparent);
}

:root[data-scheme="light"] .dialog-add-btn:disabled {
  box-shadow: none;
}

:root[data-scheme="light"] .drawer {
  box-shadow: -30px 0 70px color-mix(in srgb, var(--text) 12%, transparent);
}

:root[data-scheme="light"] .cart-page-summary {
  box-shadow: 0 -12px 36px color-mix(in srgb, var(--text) 8%, transparent);
}

:root[data-scheme="light"] .map-center-pin {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 22%, transparent);
}

:root[data-scheme="light"] .bottom-nav {
  box-shadow: 0 -18px 45px color-mix(in srgb, var(--text) 7%, transparent);
}

:root[data-scheme="light"] .support-fab {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--text) 14%, transparent);
}

:root[data-scheme="light"] .support-fab:hover {
  box-shadow: 0 14px 34px color-mix(in srgb, var(--text) 16%, transparent);
}

:root[data-scheme="light"] .support-panel {
  box-shadow: 0 -18px 50px color-mix(in srgb, var(--text) 10%, transparent);
}

:root[data-scheme="light"] .form-error,
:root[data-scheme="light"] .cancel-reason,
:root[data-scheme="light"] #asap-closed {
  color: #be123c;
}

:root[data-scheme="light"] .status-processing,
:root[data-scheme="light"] .stock-badge.low-stock,
:root[data-scheme="light"] .payment-chip.status-awaiting_proof,
:root[data-scheme="light"] .proof-uploader .proof-required {
  color: #8a4b08;
}

:root[data-scheme="light"] .payment-chip.status-proof_submitted,
:root[data-scheme="light"] .time-option-icon.scheduled {
  color: #1d4f91;
}

:root[data-scheme="light"] .dialog-close {
  color: #fff;
}

/* The lettered name must fit its column next to Home + language on any phone:
   it scales down instead of running under the buttons (Uzbek "Bosh sahifa" at 360 px). */
.topbar.has-wordmark .brand-copy {
  min-width: 0;
}

.topbar.has-wordmark .brand-wordmark {
  height: auto;
  max-height: 30px;
  max-width: 100%;
}

@media (max-width: 480px) {
  .topbar.has-wordmark .brand-wordmark {
    max-height: 26px;
  }

  /* Icon-only Home on phones when the header carries a wordmark; the label stays for screen readers. */
  .topbar.has-wordmark .site-home {
    width: 42px;
    padding: 0;
  }

  .topbar.has-wordmark .site-home span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (max-width: 340px) {
  .topbar.has-wordmark .brand-mark.has-logo {
    width: 38px;
    height: 38px;
  }
}

/* Visitor theme switch. Same family as the language button: 46px desktop, 42px phones. */
.theme-toggle {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-toggle .theme-icon-sun {
  display: none;
}

html[data-scheme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}

html[data-scheme="dark"] .theme-toggle .theme-icon-sun {
  display: block;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .theme-toggle {
    width: 42px;
    height: 42px;
  }
}

/* Four controls beside the wordmark: keep the gap at 8px so the name still has a column. */
@media (max-width: 480px) {
  .topbar.has-wordmark {
    gap: 8px;
  }
}

/* Wordmark art is drawn for the store's own scheme. Recolor only the lettering. */
html[data-color-shifted="dark"] .brand-wordmark {
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

html[data-color-shifted="light"] .brand-wordmark {
  filter: brightness(0);
  opacity: 0.88;
}

/* Active dock sits on an accent tint, so the accent itself drops under 4.5.
   Body text stays clear. Danger red is lightened the same way: the derived
   surface plus the chip's red wash leaves #ff4967 short of 4.5. */
html[data-color-shifted] .bottom-nav-item.active {
  color: var(--text);
}

html[data-color-shifted="dark"] {
  --danger: #ff5b76;
}

html[data-color-shifted] .primary-button,
html[data-color-shifted] .category-tab.active,
html[data-color-shifted] .add-button,
html[data-color-shifted] .product-quantity-badge,
html[data-color-shifted] .preorder-date.selected,
html[data-color-shifted] .saved-address-card.selected .saved-address-check,
html[data-color-shifted] .resolved-address-icon,
html[data-color-shifted] .nav-badge,
html[data-color-shifted] .order-filter-tab.active .order-filter-count,
html[data-color-shifted] .profile-avatar,
html[data-color-shifted] .copy-button,
html[data-color-shifted] .dialog-add-btn,
html[data-color-shifted] .quantity-control button:last-child,
html[data-color-shifted] .brand-mark:not(.has-logo) {
  color: var(--accent-ink);
}

