/* ============================================================================
   Visual Apple do cardápio público
   ----------------------------------------------------------------------------
   Espelho do visual "apple" do app React Native (mobile/src/features/marketplace/
   site/apple.tsx, dock.tsx, siteTheme.ts): fundo agrupado do iOS, cartões
   brancos de raio 20, escala tipográfica do iOS e vidro só na moldura fixa
   (topo, barra de abas, rodapé de ação, folhas).

   Carregado pelo ds-head.php só quando public_ui_visual() === 'apple'
   (padrão). Para voltar ao visual anterior: PUBLIC_UI_VISUAL=site, ou ?ui=site
   numa página.

   Regras:
   - Todo seletor começa por `:root`: soma uma classe de especificidade e vence
     o CSS da página (carregado depois) sem !important.
   - Não renomeia classe nem id: o JS (home.js, ui.js, sticky-topbar.js,
     customization.js…) e os testes de paridade continuam achando tudo.
   - Cores da loja só pelas variáveis --ds-brand / --ds-header-bg (brand.php).
   - Vidro com fallback sólido: sem backdrop-filter, com "Reduzir
     transparência" ou com "Aumentar contraste".
   - Tamanhos de fonte em rem (base 16 px), para acompanhar o tamanho de texto
     do sistema como o resto do cardápio já faz.
   ========================================================================== */

:root {
  --ui-apple: 1;

  /* Cores semânticas do iOS (claro) — APPLE em apple.tsx */
  --ios-bg: #F2F2F7;
  --ios-surface: #FFFFFF;
  --ios-label: #000000;
  --ios-secondary: #6C6C70;
  --ios-tertiary: #8E8E93;
  --ios-fill: rgba(118, 118, 128, 0.12);
  --ios-fill-pressed: rgba(118, 118, 128, 0.2);
  --ios-separator: rgba(60, 60, 67, 0.18);
  --ios-green: #248A3D;
  --ios-green-fill: rgba(52, 199, 89, 0.16);
  --ios-red: #D70015;
  --ios-red-fill: rgba(255, 59, 48, 0.14);
  --ios-red-500: #FF3B30;
  --ios-orange-ink: #9A5B00;
  --ios-orange-fill: rgba(255, 149, 0, 0.18);
  --ios-yellow-fill: rgba(255, 204, 0, 0.28);
  --ios-yellow-ink: #7A5C00;
  --ios-blue-fill: rgba(0, 122, 255, 0.14);
  --ios-blue-ink: #0A4FB3;

  /* Marca da loja */
  --ios-brand: var(--ds-brand, #F59E0B);
  --ios-brand-ink: var(--ds-brand-ink, #FFFFFF);
  --ios-brand-text: var(--ds-brand, #B45309);
  --ios-brand-lens: rgba(245, 158, 11, 0.16);
  --ios-brand-glass: var(--ds-brand, #F59E0B);

  /* Vidro */
  --ios-glass: rgba(255, 255, 255, 0.62);
  --ios-glass-strong: rgba(255, 255, 255, 0.78);
  --ios-glass-edge: rgba(255, 255, 255, 0.7);
  --ios-glass-filter: saturate(180%) blur(22px);
  --ios-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --ios-float-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  --ios-circle-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  --ios-card-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);

  /* Forma e movimento */
  --ios-radius-card: 20px;
  --ios-radius-field: 12px;
  --ios-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ios-dock-h: 62px;
  --ios-dock-gap: max(calc(env(safe-area-inset-bottom, 0px) - 14px), 10px);

  --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* A barra flutuante ocupa a cápsula + o respiro dela + uma folga para o último item. */
  --ds-tabbar-h: calc(var(--ios-dock-h) + 30px);
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
  :root {
    --ios-brand-text: color-mix(in srgb, var(--ds-brand, #F59E0B) 72%, #000000);
    --ios-brand-lens: color-mix(in srgb, var(--ds-brand, #F59E0B) 16%, transparent);
    --ios-brand-glass: color-mix(in srgb, var(--ds-brand, #F59E0B) 90%, transparent); /* laranja vivo, ainda translúcido */
    --ios-brand-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, 0.1) 100%);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
:root body {
  background: var(--ios-bg);
  color: var(--ios-label);
  font-family: var(--ios-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ── Vidro (utilitários) ──────────────────────────────────────────────────── */
:root .ios-glass,
:root .ios-glass-circle {
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  border: 0.5px solid var(--ios-glass-edge);
  box-shadow: var(--ios-glass-highlight);
}

:root .ios-glass-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border-radius: 50%;
  color: #000000;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--ios-glass-highlight), var(--ios-circle-shadow);
  transition: transform 0.18s var(--ios-ease);
}
:root .ios-glass-circle:active { transform: scale(0.92); }
:root .ios-glass-circle--sm {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  background: var(--ios-fill);
  border-color: transparent;
  box-shadow: none;
  color: var(--ios-secondary);
}
:root .ios-glass-circle--sm::after {
  content: "";
  position: absolute;
  inset: -6px;
}
:root .ios-glass-circle:focus-visible,
:root .ios-chip:focus-visible,
:root .ios-store__hours:focus-visible,
:root .ios-store__address:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ds-brand, #F59E0B) 55%, #000000);
  outline-offset: 2px;
}

:root .ios-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--ios-red-500);
  color: #FFFFFF;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Cabeçalho da loja (header-apple.php) ─────────────────────────────────── */
:root .ios-store { position: relative; }

:root .ios-store__cover {
  position: relative;
  /* Até a borda no celular: anula o p-4 do contêiner do layout. */
  margin: -16px -16px 0;
  height: calc(150px + env(safe-area-inset-top, 0px));
  background: var(--ds-header-bg, #6B21A8);
  overflow: hidden;
}
:root .ios-store__cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
:root .ios-store__cart {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 16px;
}

:root .ios-store__body {
  display: flex;
  flex-direction: column;
  padding: 0 4px;
  margin-top: -36px;
}

:root .ios-store__logo {
  position: relative;
  align-self: flex-end;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 3px solid var(--ios-bg);
  background: var(--menu-logo-border, var(--ds-header-bg, #6B21A8));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
:root .ios-store__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
:root .ios-store__dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--ios-bg);
  background: #8E8E93;
}
:root .ios-store__dot--open { background: #34C759; }
:root .ios-store__dot--paused { background: #FF9500; }
:root .ios-store__dot--closed { background: #8E8E93; }
:root .ios-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:root .ios-store__logo-fallback {
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

:root .ios-store__title {
  margin: -22px 0 0;
  padding-right: 84px;
  font-size: 1.75rem;           /* 28 — Title 1 */
  line-height: 1.2143;          /* 34 */
  font-weight: 700;
  letter-spacing: 0.0225rem;
  color: var(--ios-label);
  overflow-wrap: anywhere;
}

:root .ios-store__row,
:root .ios-store__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
:root .ios-store__row { margin-top: 6px; }
:root .ios-store__chips { margin-top: 12px; }

:root .ios-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 11px 0 8px;
  border-radius: 14px;
  font-size: 0.8125rem;         /* 13 — Footnote */
  line-height: 1.385;
  font-weight: 600;
}
:root .ios-status--open { background: var(--ios-green-fill); color: var(--ios-green); }
:root .ios-status--closed { background: var(--ios-red-fill); color: var(--ios-red); }
:root .ios-status--paused { background: var(--ios-orange-fill); color: var(--ios-orange-ink); }

:root .ios-store__hours {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ios-secondary);
  font: inherit;
  font-size: 0.9375rem;         /* 15 — Subheadline */
  line-height: 1.333;
  cursor: pointer;
  position: relative;
}
:root .ios-store__hours svg { color: var(--ios-tertiary); }
:root .ios-store__hours .ios-store__hours-clock { margin-right: 4px; }
:root .ios-store__hours::after { content: ""; position: absolute; inset: -8px; }
:root .ios-store__hours:active { opacity: 0.6; }

:root .ios-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 18px;
  background: var(--ios-fill);
  color: var(--ios-label);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
:root .ios-chip:active { background: var(--ios-fill-pressed); }
:root span.ios-chip { cursor: default; }
:root span.ios-chip:active { background: var(--ios-fill); }
:root .ios-chip--brand {
  background: var(--ios-brand-lens);
  color: var(--ios-brand-text);
  font-weight: 600;
}
:root .ios-chip--plain { background: transparent; color: var(--ios-red); padding: 0 8px; }
:root .ios-inline-form { display: inline-flex; margin: 0; }

:root .ios-store__address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ios-secondary);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.385;
  text-align: left;
  cursor: pointer;
}
:root .ios-store__address svg { flex: 0 0 16px; margin-top: 1px; }
:root .ios-store__address:active { opacity: 0.6; }

:root .ios-store__welcome {
  position: relative;
  margin: 16px 0 0;
  padding: 16px 16px 16px 32px;
  border-radius: var(--ios-radius-card);
  background: #F4F1FA;
  background: color-mix(in srgb, var(--ds-header-bg, #6B21A8) 8%, #FFFFFF);
  color: var(--ios-label);
  font-size: 1.0625rem;         /* 17 — Body */
  line-height: 1.41;
}
:root .ios-store__welcome::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 2px;
  background: var(--ds-header-bg, #6B21A8);
}

:root .ios-store .scheduled-pause-banner {
  margin-top: 16px;
  border: 0;
  border-radius: var(--ios-radius-card);
  background: var(--ios-orange-fill);
}
:root .ios-store .scheduled-pause-icon { border-radius: 12px; background: #FF9500; }
:root .ios-store .scheduled-pause-title { color: var(--ios-orange-ink); font-weight: 600; }
:root .ios-store .scheduled-pause-reason { color: var(--ios-orange-ink); }

@media (min-width: 768px) {
  :root .ios-store__cover {
    margin: 0;
    height: 220px;
    border-radius: 24px;
  }
  :root .ios-store__body { padding: 0 20px; }
}

/* ── Folha (dialog) "Abrir no mapa" — AddressSheet.tsx ────────────────────
   Presa ao rodapé, cantos de cima com raio 36, vidro; cabeçalho com o pino e o
   fechar em círculos de vidro de 56; ações numa lista agrupada (raio 28). */
:root .ios-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ios-label);
  overflow: visible;
}
:root .ios-sheet::backdrop {
  background: rgba(0, 0, 0, 0.4);
  animation: ios-fade-in 0.28s var(--ios-ease);
}
:root .ios-sheet[open] .ios-sheet__panel { animation: ios-sheet-up 0.38s var(--ios-ease); }
:root .ios-sheet.is-closing .ios-sheet__panel { animation: ios-sheet-down 0.22s ease-in forwards; }
:root .ios-sheet.is-closing::backdrop { animation: ios-fade-out 0.22s ease-in forwards; }

:root .ios-sheet__panel {
  padding: 22px 0 max(12px, env(safe-area-inset-bottom, 0px));
  border-radius: 36px 36px 0 0;
  background: var(--ios-glass-strong);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  border: 0.5px solid var(--ios-glass-edge);
  border-bottom: 0;
  box-shadow: var(--ios-glass-highlight), 0 -6px 30px rgba(0, 0, 0, 0.12);
  outline: none;
}
:root .ios-sheet__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px 16px;
}
:root .ios-sheet__circle {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--ios-glass-edge);
  background: rgba(60, 60, 67, 0.16);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), var(--ios-circle-shadow);
  color: #000000;
  cursor: pointer;
  transition: transform 0.18s var(--ios-ease);
}
:root button.ios-sheet__circle:active { transform: scale(0.92); }
:root .ios-sheet__title {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;           /* 20 */
  line-height: 1.3;             /* 26 */
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
:root .ios-sheet__list {
  margin: 0 16px 8px;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(120, 120, 128, 0.12);
}
:root .ios-sheet__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 64px;
  padding: 0 22px;
  border: 0;
  background: transparent;
  color: #000000;
  font: inherit;
  font-size: 1.1875rem;         /* 19 */
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
:root .ios-sheet__row svg { flex: 0 0 28px; }
:root .ios-sheet__row + .ios-sheet__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: rgba(60, 60, 67, 0.22);
}
:root .ios-sheet__row:active { background: rgba(120, 120, 128, 0.16); }
:root .ios-sheet__row:focus-visible,
:root .ios-sheet__circle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ds-brand, #F59E0B) 55%, #000000);
  outline-offset: -3px;
}

@keyframes ios-sheet-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes ios-sheet-down { from { transform: none; } to { transform: translateY(105%); } }
@keyframes ios-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ios-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Categorias, busca e títulos de seção (home) ──────────────────────────── */
:root .category-tabs-original,
:root .sticky-topbar__tabs {
  gap: 8px;
  margin-left: -16px;
  margin-right: -16px;
  padding: 4px 20px 8px;
  scrollbar-width: none;
  scroll-padding-inline: 20px;
}
:root .category-tabs-original::-webkit-scrollbar,
:root .sticky-topbar__tabs::-webkit-scrollbar { display: none; }
:root .sticky-topbar__tabs {
  /* Como era: as categorias vão até a borda da tela. O que passa da curva do canto é
     cortado pela própria barra (overflow: hidden abaixo) — rolam por dentro do branco. */
  margin: 0 -16px;
  padding: 2px 16px 2px;
  scroll-padding-inline: 16px;
}

:root .category-tab,
:root .category-tab-sticky {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0.5px solid var(--ios-glass-edge);
  border-radius: 22px;
  background: var(--ios-glass-strong);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  color: var(--ios-label);
  font-size: 1.0625rem;
  line-height: 1.294;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.18s var(--ios-ease);
}
:root .category-tab:active,
:root .category-tab-sticky:active { transform: scale(0.96); }
:root .category-tab.active,
:root .category-tab-sticky.active {
  background: var(--ios-brand-glass);
  border-color: color-mix(in srgb, var(--ds-brand, #F59E0B) 40%, #FFFFFF);
  color: var(--ios-brand-ink);
  font-weight: 600;
}

:root .search-bar-original { margin-top: 4px; }
:root .ds-search-trigger {
  min-height: 44px;
  padding: 0 12px;
  gap: 8px;
  border: 0;
  border-radius: var(--ios-radius-field);
  background: var(--ios-fill);
  box-shadow: none;
  color: var(--ios-secondary);
}
:root .ds-search-trigger:active { background: var(--ios-fill-pressed); }
:root .ds-search-trigger .ds-search__icon { color: var(--ios-secondary); }
:root .ds-search-trigger__text {
  color: var(--ios-secondary);
  font-size: 1.0625rem;
  font-weight: 400;
}

:root .menu-group-title {
  display: block;
  margin: 20px 0 10px;
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
  color: var(--ios-label);
  font-size: 1.375rem;          /* 22 — Title 2 */
  line-height: 1.273;
  font-weight: 700;
  letter-spacing: 0.022rem;
}

/* ── Cartão de produto (_card.php) — AppleProductRow ──────────────────────── */
:root .ui-card {
  gap: 14px;
  min-height: 112px;
  padding: 12px;
  border: 0;
  border-radius: var(--ios-radius-card);
  background: var(--ios-surface);
  box-shadow: var(--ios-card-shadow);
  transition: background-color 0.15s ease, transform 0.18s var(--ios-ease);
}
:root a:active > .ui-card { background: #E9E9EE; transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) {
  :root a:hover > .ui-card { background: #F7F7FA; }
}
:root .ui-card > div:first-child {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  border-radius: 14px;
  background: var(--ios-fill);
}
:root .ui-card > div:first-child > svg { color: var(--ios-tertiary); }
:root .ui-card h3 {
  color: var(--ios-label);
  font-size: 1.0625rem;         /* 17 — Headline */
  line-height: 1.294;
  font-weight: 600;
}
:root .ui-card p.text-sm {
  margin-top: 2px;
  color: var(--ios-secondary);
  font-size: 0.9375rem;         /* 15 — Subheadline */
  line-height: 1.333;
}
:root .ui-card p.text-sm .underline { display: none; }
:root .ui-card .ui-badge {
  min-height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
}
:root .ui-card .ui-badge--warning { background: var(--ios-yellow-fill); color: var(--ios-yellow-ink); }
:root .ui-card .ui-badge--new { background: var(--ios-blue-fill); color: var(--ios-blue-ink); }
:root .ui-card .ui-badge--product-tag { background: var(--ios-fill); border-color: transparent; color: var(--ios-label); }
:root .ui-card .ui-badge--product-tag-borderless { background: transparent; }
:root .ui-card .text-lg.font-bold {
  color: var(--ios-label);
  font-size: 1.0625rem;
  font-weight: 600;
}
:root .ui-card .line-through { color: var(--ios-secondary); font-size: 0.8125rem; }
:root .ui-card .bg-green-500 {
  padding: 0;
  background: transparent;
  color: var(--ios-green);
  font-size: 0.8125rem;
  font-weight: 600;
}
:root .ui-card .promo-countdown { color: var(--ios-red); font-size: 0.75rem; font-weight: 500; }

/* ── Busca + categorias fixas (sticky-topbar.js) — vidro com fundo arredondado ── */
:root .sticky-topbar {
  /* Mesmo vidro do menu do rodapé (.ds-tabbar): fundo, desfoque, borda e sombra idênticos. */
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  border: 0.5px solid var(--ios-glass-edge);
  border-top: 0;
  border-radius: 0 0 28px 28px;
  overflow: hidden; /* categorias nunca saem do fundo branco, nem nos cantos arredondados */
  box-shadow: var(--ios-glass-highlight), var(--ios-float-shadow);
}
:root .sticky-topbar__inner { padding: max(10px, env(safe-area-inset-top, 0px)) 16px 12px; gap: 10px; }
:root .sticky-topbar__search .ds-search-trigger { background: rgba(118, 118, 128, 0.14); }
/* Chips dentro da barra fixa: sem blur próprio (blur dentro de blur gerava a "quebra"). */
:root .sticky-topbar .category-tab-sticky {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: #FFFFFF;
}
:root .sticky-topbar .category-tab-sticky.active { background: var(--ios-brand-glass); }

/* ── Busca em tela cheia (search-overlay.js) ──────────────────────────────── */
:root .search-overlay { background: var(--ios-bg); }
:root .search-overlay__header {
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}
:root .search-overlay__back {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  border: 0.5px solid var(--ios-glass-edge);
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), var(--ios-circle-shadow);
  color: #000000;
}
:root .search-overlay__header .ds-search,
:root .ds-search {
  min-height: 44px;
  border: 0;
  border-radius: var(--ios-radius-field);
  background: var(--ios-fill);
  box-shadow: none;
}
:root .ds-search:focus-within {
  border: 0;
  background: var(--ios-fill);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-brand, #F59E0B) 28%, transparent);
}
:root .ds-search__input { color: var(--ios-label); font-size: 1.0625rem; }
:root .ds-search__input::placeholder { color: var(--ios-secondary); }
:root .search-suggest__title { color: var(--ios-label); font-size: 1.25rem; font-weight: 700; }
:root .search-suggest__chip {
  min-height: 36px;
  border: 0;
  border-radius: 18px;
  background: var(--ios-fill);
  color: var(--ios-label);
}

/* ── Barra de abas flutuante (tabbar.php) — AppleDock ─────────────────────── */
:root .ds-tabbar {
  left: 50%;
  right: auto;
  bottom: var(--ios-dock-gap);
  width: min(calc(100% - 32px), 520px);
  height: var(--ios-dock-h);
  padding: 4px;
  transform: translateX(-50%);
  border: 0.5px solid var(--ios-glass-edge);
  border-radius: 31px;
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), var(--ios-float-shadow);
}
:root .ds-tabbar__inner {
  max-width: none;
  height: 100%;
  margin: 0;
  justify-content: stretch;
}
:root .ds-tabbar__item {
  position: relative;
  isolation: isolate;
  gap: 2px;
  min-height: 0;
  padding: 0 4px;
  border-radius: 27px;
  color: var(--ios-secondary);
  font-size: 0.625rem;          /* 10 — rótulo da barra de abas */
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.2s ease;
}
:root .ds-tabbar__item svg { width: 24px; height: 24px; transition: transform 0.18s var(--ios-ease); }
:root .ds-tabbar__item:active { background: transparent; }
:root .ds-tabbar__item:active svg { transform: scale(0.9); }
:root .ds-tabbar__item.is-active {
  color: var(--ds-brand, #F59E0B);
  font-weight: 600;
}
:root .ds-tabbar__item.is-active::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ios-brand-lens);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--ds-brand, #F59E0B) 28%, transparent);
  animation: ios-lens-in 0.32s var(--ios-ease);
}
:root .ds-tabbar__item.is-active svg { stroke-width: 2; }
:root .ds-tabbar__badge { top: -5px; right: -10px; background: var(--ios-red-500); }
@keyframes ios-lens-in { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }


/* ── Fallbacks do vidro ───────────────────────────────────────────────────── */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root .ios-glass,
  :root .ios-glass-circle,
  :root .ds-tabbar,
  :root .sticky-topbar,
  :root .search-overlay__back,
  :root .category-tab,
  :root .category-tab-sticky,
  :root .ios-sheet__panel { background: rgba(255, 255, 255, 0.96); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root .ios-glass,
  :root .ios-glass-circle,
  :root .ds-tabbar,
  :root .sticky-topbar,
  :root .search-overlay__back,
  :root .category-tab,
  :root .category-tab-sticky,
  :root .ios-sheet__panel {
    background: #FFFFFF;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: var(--ios-separator);
  }
  :root .category-tab.active,
  :root .category-tab-sticky.active { background: var(--ds-brand, #F59E0B); }
}
@media (prefers-contrast: more) {
  :root .ios-chip,
  :root .ds-search-trigger,
  :root .ds-search { box-shadow: inset 0 0 0 1px var(--ios-tertiary); }
}

/* ============================================================================
   Produto (product/*.php) — ProductDetailScreen
   ========================================================================== */
:root .app:has(> .hero-wrap) { background: var(--ios-surface); }
:root .hero-wrap .hero { background: #E5E5EA; }
:root .hero-wrap .hero-product-placeholder { background: #E5E5EA; -webkit-backdrop-filter: none; backdrop-filter: none; }
:root .hero-wrap .hero-placeholder-icon { color: var(--ios-tertiary); opacity: 1; }

/* Voltar e sacola: círculos de vidro (GlassCircle) */
:root .hero-wrap .nav-btn,
:root .hero-wrap .cart-btn,
:root .ds-pageheader__back,
:root .mm-cust .top .back,
:root .back {
  border: 0.5px solid var(--ios-glass-edge);
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), var(--ios-circle-shadow);
  color: #000000;
  transition: transform 0.18s var(--ios-ease);
}
:root .hero-wrap .nav-btn,
:root .hero-wrap .cart-btn { top: calc(env(safe-area-inset-top, 0px) + 8px); }
:root .hero-wrap .nav-btn { left: 16px; }
:root .hero-wrap .cart-btn { right: 16px; }
:root .hero-wrap .nav-btn:active,
:root .hero-wrap .cart-btn:active,
:root .back:active,
:root .ds-pageheader__back:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) {
  :root .hero-wrap .cart-btn:hover { background: var(--ios-glass-strong); border-color: var(--ios-glass-edge); color: #000000; transform: none; }
}
:root .hero-wrap .cart-badge { border: 0; background: var(--ios-red-500); box-shadow: none; }

:root .hero-wrap ~ main.card {
  margin-top: -28px;
  padding: 24px 20px calc(120px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px 28px 0 0;
  box-shadow: none;
  gap: 12px;
}
:root .hero-wrap ~ main.card h1,
:root .hero-wrap ~ main.card .brand h1 {
  margin-top: 2px;
  color: var(--ios-label);
  font-size: 1.75rem;
  line-height: 1.2143;
  font-weight: 700;
  letter-spacing: 0.0225rem;
}
:root .hero-wrap ~ main.card .price-single,
:root .hero-wrap ~ main.card .price-current { font-size: 1.375rem; font-weight: 700; color: var(--ios-label); }
:root .hero-wrap ~ main.card .price-original { color: var(--ios-secondary); font-weight: 500; }
:root .hero-wrap ~ main.card .price-discount { color: var(--ios-green); font-weight: 600; }
:root .hero-wrap ~ main.card .section h3 {
  margin: 14px 0 6px;
  color: var(--ios-label);
  font-size: 1.375rem;
  line-height: 1.273;
  font-weight: 700;
  letter-spacing: 0.022rem;
  text-transform: none;
}
:root .hero-wrap ~ main.card .body { color: #3C3C43; font-size: 1.0625rem; line-height: 1.41; }
:root .combo h2 { font-size: 1.375rem; line-height: 1.273; font-weight: 700; letter-spacing: 0.022rem; }
:root .btn-outline {
  min-height: 52px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--ios-fill);
  color: var(--ios-label);
  font-size: 1.0625rem;
  font-weight: 500;
}

/* Botões de ação em laranja vivo, com cara de vidro: cor cheia + brilho de luz no topo
   (degradê) + borda e reflexo internos. Não pega botões desabilitados nem "fechada". */
:root .mm-cust .modal-btn,
:root .empty-btn,
:root .app > .checkout-footer .cta:not([disabled]),
:root .ds-login-sheet__submit,
:root body:has(.products-area) .footer .cta:not([disabled]):not(.cta--disabled) {
  background-image: var(--ios-brand-sheen, none);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.06), 0 8px 20px color-mix(in srgb, var(--ds-brand, #F59E0B) 38%, transparent);
}

/* Adicionar à Sacola (produto aberto): laranja fixo com texto branco, como no visual anterior —
   não segue a cor configurada da loja. Não pega o botão "fechada". */
:root #product-footer-form .cta:not(.closed) {
  background: #FF9F33;
  color: #FFFFFF;
}

/* Fechada / pausada: o bloco inteiro vira uma cápsula de vidro cinza, com o aviso de volta dentro. */
:root #product-footer-form.footer.has-closed-info {
  width: calc(100% - 32px);
  bottom: var(--ios-dock-gap);
  padding: 8px 12px 12px;
  border: 0.5px solid var(--ios-glass-edge);
  border-radius: 30px;
  background: rgba(142, 142, 147, 0.28);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), 0 8px 20px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
}
@media (min-width: 768px) {
  :root #product-footer-form.footer.has-closed-info { max-width: 388px; }
}
:root #product-footer-form .cta.closed {
  min-height: 40px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  color: #3C3C43;
  overflow: visible;
}
:root #product-footer-form .cta.closed::before { display: none; }
:root #product-footer-form .cta.closed .lock-icon { animation: none; font-size: 1.0625rem; }
:root #product-footer-form .closed-info {
  margin-top: 0;
  color: #3C3C43;
  font-size: 0.8125rem;
  font-weight: 500;
}
:root #product-footer-form .closed-info strong { color: #000000; font-size: 0.8125rem; font-weight: 700; }
:root #product-footer-form .closed-info.pause-mode {
  margin-top: 6px;
  border: 0;
  border-radius: 16px;
  background: var(--ios-orange-fill);
  color: var(--ios-orange-ink);
}

/* Rodapés brancos viram vidro (igual à tabbar): todo .footer (sacola, perfil, endereços, produto, personalização). A home (products-area) tem regra própria mais específica. */
:root .footer {
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  border-top: 0.5px solid var(--ios-glass-edge);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
}

/* Seletor de quantidade da página do produto: medidas do .stepper original (product.css), botões de 36px; toque de 44pt mantido pelo ::after de .st-btn */
:root main.card .stepper { gap: 10px; padding: 6px 10px; min-width: 104px; }
:root main.card .stepper .st-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
:root main.card .stepper .st-btn svg { width: 18px; height: 18px; }

/* ============================================================================
   Personalização (customization/*.php, body.mm-cust)
   ========================================================================== */
:root body.mm-cust { background: #FFFFFF; }
:root .mm-cust .top {
  min-height: 60px;
  padding: max(8px, env(safe-area-inset-top, 0px)) 16px 8px;
  border-bottom: 0;
  background: transparent;
}
:root .mm-cust .title { color: var(--ios-label); font-size: 1.0625rem; font-weight: 600; }
:root .mm-cust .group-title {
  color: var(--ios-label);
  font-size: 1.375rem;
  line-height: 1.273;
  font-weight: 700;
  letter-spacing: 0.022rem;
}
:root .mm-cust .row { border-top-color: var(--ios-separator); }
:root .mm-cust .thumb,
:root .mm-cust .ingredient-placeholder { background: var(--ios-fill); }
:root .mm-cust .name { color: var(--ios-label); font-size: 1.0625rem; font-weight: 600; }
/* "Como funciona a personalização?": placa de vidro flutuante (CustomizationInfoSheet) */
:root .modal-overlay { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root .modal-box,
:root .mm-cust .modal-box {
  /* Folha colada na base, sobe de baixo (como a folha do Pix do iOS):
     largura total, sem margem, vidro bem mais branco. */
  width: 100%;
  margin-bottom: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 36px 36px 0 0;
  background: rgba(255, 255, 255, 0.93);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  box-shadow: inset 0 1px 0 #fff, 0 -10px 40px rgba(0, 0, 0, 0.16);
  transform: translateY(100%);
  transition: transform 0.45s var(--ios-ease);
}
:root .modal-overlay.show .modal-box { transform: translateY(0); }
:root .modal-box::before { width: 36px; height: 5px; border-radius: 3px; background: rgba(60, 60, 67, 0.3); }
:root .modal-btn,
:root .mm-cust .modal-btn {
  min-height: 52px;
  border: 0.5px solid color-mix(in srgb, var(--ds-brand, #F59E0B) 40%, #FFFFFF);
  border-radius: 26px;
  background: var(--ios-brand-glass);
  color: var(--ds-brand-ink, #FFFFFF);
  font-size: 1.0625rem;
  font-weight: 600;
  box-shadow: var(--ios-glass-highlight);
}
@media (min-width: 640px) {
  :root .modal-box,
  :root .mm-cust .modal-box { width: 100%; margin-bottom: 0; border-radius: 28px; }
}

/* ============================================================================
   Cabeçalho de página (.ds-pageheader: Sacola, Perfil, Endereços, Pedido)
   e barra do checkout — SitePageHeader: voltar em vidro, título central 17/600
   ========================================================================== */
:root .ds-pageheader,
:root .app > .topbar {
  /* Mesmo vidro do menu do rodapé: o conteúdo rolando por baixo aparece desfocado. */
  border-bottom: 0.5px solid var(--ios-glass-edge);
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), 0 6px 18px rgba(0, 0, 0, 0.07);
}
:root .ds-pageheader { padding: max(8px, env(safe-area-inset-top, 0px)) 16px 8px; }
:root .ds-pageheader__back {
  width: 44px; height: 44px;
  /* O botão fica DENTRO de uma barra que já tem backdrop-filter (o navegador não borra um
     vidro dentro de outro), então o efeito vem de luz: degradê claro, brilho no topo,
     borda de vidro e sombra — o mesmo círculo em todas as telas. */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), inset 0 -1px 0 rgba(60, 60, 67, 0.06), 0 3px 10px rgba(0, 0, 0, 0.16);
}  /* vidro: grupo "Voltar e sacola" (mesmo do botão do produto) */
/* Seta do voltar idêntica em TODAS as telas (os helpers de SVG de cada módulo diferem em
   tamanho/cor: com e sem width/height, #111827 x currentColor). Padrão = a tela de Perfil. */
:root .ds-pageheader__back,
:root .hero-wrap .nav-btn { color: #000000; }
:root .ds-pageheader__back svg,
:root .hero-wrap .nav-btn svg { width: 24px; height: 24px; flex: 0 0 auto; }
:root .ds-pageheader__back svg path,
:root .hero-wrap .nav-btn svg path { stroke: currentColor; stroke-width: 1.5; }
:root .ds-pageheader__back:active { background: var(--ios-glass); transform: scale(0.92); }
:root .ds-pageheader__title,
:root .app > .topbar .title {
  flex: 1;
  min-width: 0;
  color: var(--ios-label);
  font-size: 1.0625rem;
  line-height: 1.294;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left; /* padrão único: voltar à esquerda + título ao lado (igual "Minha conta") */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:root .ds-pageheader__sub { color: var(--ios-secondary); text-align: left; }

/* ============================================================================
   Sacola (cart/*.php) — CartScreen / CartItemCard
   ========================================================================== */
:root body:has(.products-area) { background: var(--ios-bg); }
:root .products-area .item {
  margin: 12px 16px;
  padding: 14px;
  border: 0;
  border-radius: var(--ios-radius-card);
  background: var(--ios-surface);
  box-shadow: var(--ios-card-shadow);
}
:root .products-area .avatar { border: 0; border-radius: 12px; background: var(--ios-fill); }
:root .products-area .avatar svg { color: var(--ios-tertiary); }
:root .products-area .name { color: var(--ios-label); font-size: 1.0625rem; line-height: 1.294; font-weight: 600; }
:root .products-area .price { color: var(--ios-secondary); font-size: 0.9375rem; font-weight: 500; }
:root .products-area .qty { border: 0; background: var(--ios-fill); }
:root .products-area .toggle-row { border-top-color: var(--ios-separator); }
:root .products-area .toggle-left { font-weight: 600; }
:root .add-more-btn,
:root .coupon-btn {
  border: 0;
  border-radius: 14px;
  background: var(--ios-surface);
  box-shadow: var(--ios-card-shadow);
  color: var(--ios-label);
  font-weight: 600;
}
:root .add-more-btn svg { color: var(--ios-brand-text); }
:root .fixed-bottom { background: var(--ios-bg); padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
:root .empty-btn {
  min-height: 52px;
  border: 0.5px solid color-mix(in srgb, var(--ds-brand, #F59E0B) 40%, #FFFFFF);
  border-radius: 26px;
  background: var(--ios-brand-glass);
  box-shadow: var(--ios-glass-highlight), 0 8px 20px rgba(0, 0, 0, 0.12);
  color: var(--ds-brand-ink, #FFFFFF);
  font-size: 1.0625rem;
  font-weight: 600;
}

/* Rodapés de ação da sacola e do checkout: a mesma cápsula de vidro do produto */
:root body:has(.products-area) .footer,
:root .app > .checkout-footer {
  padding: 0 16px var(--ios-dock-gap);
  border-top: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
:root body:has(.products-area) .footer > *,
:root .app > .checkout-footer > * { pointer-events: auto; }
:root body:has(.products-area) .footer .cta,
:root .app > .checkout-footer .cta {
  min-height: 52px;
  border: 0.5px solid color-mix(in srgb, var(--ds-brand, #F59E0B) 40%, #FFFFFF);
  border-radius: 26px;
  background: var(--ios-brand-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), 0 8px 20px rgba(0, 0, 0, 0.14);
  color: var(--ds-brand-ink, #FFFFFF);
  font-size: 1.0625rem;
  font-weight: 600;
  transition: transform 0.18s var(--ios-ease);
}
:root body:has(.products-area) .footer .cta:active,
:root .app > .checkout-footer .cta:active { filter: none; transform: scale(0.97); }
:root body:has(.products-area) .footer .cta--disabled,
:root body:has(.products-area) .footer .cta[disabled],
:root .app > .checkout-footer .cta[disabled] {
  opacity: 1;
  border-color: var(--ios-glass-edge);
  background: rgba(142, 142, 147, 0.28);
  color: #3C3C43;
}
/* Sacola com a barra de abas: o botão fica logo acima da cápsula das abas. */
:root body:has(.products-area):has(.ds-tabbar) .footer {
  bottom: calc(var(--ios-dock-gap) + var(--ios-dock-h) + 10px);
  padding-bottom: 0;
}

/* ============================================================================
   Checkout (public/checkout.php) — CheckoutScreen
   ========================================================================== */
:root .app:has(> .checkout-footer) { background: var(--ios-bg); }
:root .app > .topbar .back { width: 44px; height: 44px; }
:root .app > .topbar .checkout-coin-balance,
:root .app > .ds-pageheader .checkout-coin-balance { border: 0; background: var(--ios-fill); }
:root .app:has(> .checkout-footer) .content { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
:root .app:has(> .checkout-footer) .card {
  border: 0;
  border-radius: var(--ios-radius-card);
  padding: 16px;
  box-shadow: var(--ios-card-shadow);
}
:root .app:has(> .checkout-footer) .card h2 {
  color: var(--ios-label);
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.02rem;
}
:root .app:has(> .checkout-footer) .field input,
:root .app:has(> .checkout-footer) .field select,
:root .app:has(> .checkout-footer) .field textarea {
  border: 0;
  border-radius: var(--ios-radius-field);
  background: var(--ios-fill);
}
:root .app:has(> .checkout-footer) .field input:focus,
:root .app:has(> .checkout-footer) .field select:focus,
:root .app:has(> .checkout-footer) .field textarea:focus {
  background: var(--ios-surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-brand, #F59E0B) 55%, transparent);
}
:root .fulfillment-option,
:root .payment-type-btn,
:root .address-option {
  border: 0;
  border-radius: 14px;
  background: var(--ios-fill);
  box-shadow: none;
}
:root .fulfillment-option.is-selected,
:root .payment-type-btn.active,
:root .address-option.selected {
  background: var(--ios-brand-lens);
  box-shadow: inset 0 0 0 1.5px var(--ds-brand, #F59E0B);
}
@media (hover: hover) and (pointer: fine) {
  :root .payment-type-btn:hover,
  :root .address-option:hover { background: var(--ios-fill-pressed); }
  :root .payment-type-btn.active:hover,
  :root .address-option.selected:hover { background: var(--ios-brand-lens); }
}
:root .new-address-btn { border-radius: 14px; }

/* ============================================================================
   Login do cliente (login_modal.php, .ds-login-sheet) e horários (#hours-modal)
   ========================================================================== */
:root .ds-login-sheet::before { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root .ds-login-sheet__panel {
  border: 0.5px solid var(--ios-glass-edge);
  border-radius: 32px;
  background: var(--ios-glass-strong);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), 0 20px 50px rgba(0, 0, 0, 0.22);
}
:root .ds-login-sheet__title { color: var(--ios-label); font-size: 1.375rem; font-weight: 700; letter-spacing: 0.02rem; }
:root .ds-login-sheet__subtitle { color: var(--ios-secondary); }
:root .ds-login-sheet__close {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  margin: 0 0 0 auto;
  background: var(--ios-fill);
  color: var(--ios-secondary);
  position: relative;
}
:root .ds-login-sheet__close::after { content: ""; position: absolute; inset: -6px; }
:root .ds-login-choice__option {
  border: 0;
  border-radius: 18px;
  background: var(--ios-surface);
  box-shadow: var(--ios-card-shadow);
}
:root .ds-login-choice__option--primary {
  background: var(--ios-brand-lens);
  box-shadow: inset 0 0 0 1.5px var(--ds-brand, #F59E0B);
}
:root .ds-login-sheet__input {
  border: 0;
  background: var(--ios-fill);
}
:root .ds-login-sheet__input:focus {
  background: var(--ios-surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-brand, #F59E0B) 55%, transparent);
}
:root .ds-login-sheet__submit {
  border-radius: 26px;
  border: 0.5px solid color-mix(in srgb, var(--ds-brand, #F59E0B) 40%, #FFFFFF);
  background: var(--ios-brand-glass);
  color: var(--ds-brand-ink, #FFFFFF);
  font-size: 1.0625rem;
  font-weight: 600;
  box-shadow: var(--ios-glass-highlight);
}

:root #hours-modal { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root #hours-modal .hm-card {
  border: 0.5px solid var(--ios-glass-edge);
  border-radius: 32px;
  background: var(--ios-glass-strong);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  box-shadow: var(--ios-glass-highlight), 0 20px 50px rgba(0, 0, 0, 0.22);
}

/* Fallback sólido das folhas e barras desta seção */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root .ds-pageheader,
  :root .app > .topbar,
  :root .ds-login-sheet__panel,
  :root #hours-modal .hm-card,
  :root .modal-box { background: rgba(255, 255, 255, 0.97); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root .ds-pageheader,
  :root .app > .topbar,
  :root .ds-login-sheet__panel,
  :root #hours-modal .hm-card,
  :root .modal-box,
  :root #product-footer-form.footer.has-closed-info,
  :root body:has(.products-area) .footer .cta,
  :root .app > .checkout-footer .cta {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  :root .ds-pageheader,
  :root .app > .topbar,
  :root .ds-login-sheet__panel,
  :root #hours-modal .hm-card,
  :root .modal-box,
  :root #product-footer-form.footer.has-closed-info { background: #FFFFFF; }
  :root body:has(.products-area) .footer .cta:not([disabled]):not(.cta--disabled),
  :root .app > .checkout-footer .cta:not([disabled]) { background: var(--ds-brand, #F59E0B); }
}

/* Sacola com itens: o rodapé "Ir para o checkout" fica igual ao de "Adicionar à Sacola" (barra de vidro + botão laranja chapado) */
:root body .has-actionbar.has-actionbar ~ .footer.footer {
  padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: none;
}
:root body .has-actionbar.has-actionbar ~ .footer.footer > * { pointer-events: auto; }
:root body .has-actionbar.has-actionbar ~ .footer.footer .cta {
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: #FF9F33;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 800;
}
:root body .has-actionbar.has-actionbar ~ .footer.footer .cta--disabled,
:root body .has-actionbar.has-actionbar ~ .footer.footer .cta[disabled] {
  background: rgba(142, 142, 147, 0.28);
  color: #3C3C43;
}

/* Rodapés fixos sem transform: `left:50% + translateX(-50%)` em elemento fixed (ainda mais com backdrop-filter)
   faz o iOS Safari "voar"/tremer quando a barra do navegador sobe e desce. Centraliza com left/right + margin auto. */
:root .footer,
:root .checkout-footer {
  left: 0;
  right: 0;
  margin-inline: auto;
  transform: none;
}
:root .ds-tabbar {
  left: 0;
  right: 0;
  margin-inline: auto;
  transform: none;
}

/* Produto: sem faixa branca atrás do botão laranja — só o botão flutua */
:root #product-footer-form.footer {
  padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: none;
}
:root #product-footer-form.footer > * { pointer-events: auto; }
:root #product-footer-form .cta:not(.closed),
:root body .has-actionbar.has-actionbar ~ .footer.footer .cta {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

/* Personalização: rodapé flutuante com dois botões arredondados — Cancelar em vidro (texto preto), Confirmar laranja (texto branco) */
:root .mm-cust .footer {
  height: auto;
  gap: 10px;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: none;
}
:root .mm-cust .footer > * { pointer-events: auto; }
:root .mm-cust .btn-cancel,
:root .mm-cust .btn-confirm {
  min-height: 56px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}
:root .mm-cust .btn-cancel {
  border: 0.5px solid var(--ios-glass-edge);
  background: var(--ios-glass);
  -webkit-backdrop-filter: var(--ios-glass-filter);
  backdrop-filter: var(--ios-glass-filter);
  color: #000000;
}
:root .mm-cust .btn-confirm {
  border: 0;
  background: #FF9F33;
  color: #FFFFFF;
}

/* Todos os botões de ação com o mesmo raio da barra de abas da home (31px) */
:root #product-footer-form .cta,
:root #product-footer-form .cta.closed,
:root .app > .checkout-footer .cta,
:root body:has(.products-area) .footer .cta,
:root body .has-actionbar.has-actionbar ~ .footer.footer .cta,
:root .empty-btn,
:root .mm-cust .modal-btn,
:root .mm-cust .btn-cancel,
:root .mm-cust .btn-confirm,
:root .ds-login-sheet__submit,
:root .cta {
  border-radius: 31px;
}

/* Produto (aberto): sem barra branca no rodapé — só o botão flutuando sobre o conteúdo */
:root #product-footer-form.footer:not(.has-closed-info) {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  padding-top: 0;
}
:root #product-footer-form.footer:not(.has-closed-info) > * { pointer-events: auto; }

/* Personalização (PC e celular): sem barra no topo nem no rodapé — só o botão de voltar e os botões flutuando */
:root body.mm-cust .ds-pageheader {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
}
:root body.mm-cust .app > .footer,
:root body.mm-cust .footer {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
}

/* Personalização: remove as barras de largura total desenhadas por pseudo-elementos (PC) */
:root body.mm-cust .footer::before,
:root body.mm-cust .footer::after,
:root body.mm-cust .ds-pageheader::before,
:root body.mm-cust .ds-pageheader::after {
  content: none;
  display: none;
}

/* Rodapés (produto, sacola, perfil…): sem a faixa branca de largura total desenhada por ::before/::after no PC */
:root .footer::before,
:root .footer::after,
:root #product-footer-form.footer::before,
:root #product-footer-form.footer::after {
  content: none !important;
  display: none !important;
}
