/* =============================================================================
   storefront-enhancements.css — Camada premium do cardápio público
   =============================================================================
   Carregar DEPOIS de app.css E storefront-mobile.css
   Objetivo: refinar a experiência do cliente sem quebrar layout existente.
   - Microinterações
   - Estados de feedback (item no carrinho, hover, etc)
   - Bottom sheets nativos (drag handle)
   - Visual mais "delivery app" (iFood/Rappi vibe)
*/

/* ===========================================================================
   0) VARS EXTRAS — gradientes, sombras e curvas refinadas
   =========================================================================== */
:root {
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-card-hover: 0 14px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 106, 0, 0.12);
  --shadow-card-light-hover: 0 14px 32px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(255, 106, 0, 0.15);
  --gradient-brand-soft: linear-gradient(135deg, rgba(255, 106, 0, 0.10), rgba(255, 138, 29, 0.04));
  --gradient-promo: linear-gradient(135deg, #22c55e, #16a34a);
  --gradient-bestseller: linear-gradient(135deg, #f59e0b, #ea580c);
  --gradient-hot: linear-gradient(135deg, #ef4444, #f59e0b);
  --gradient-featured: linear-gradient(135deg, #8b5cf6, #6366f1);
}

/* ===========================================================================
   1) BANNER & PROFILE — gradiente sutil de overlay pro nome ficar legível
   =========================================================================== */
.store-banner {
  position: relative;
}
.store-banner__img {
  transition: transform 600ms var(--ease-out-soft);
}
@media (hover: hover) {
  .store-banner:hover .store-banner__img {
    transform: scale(1.02);
  }
}

/* Status — pequenas micro animações no dot */
.store-status__dot {
  position: relative;
}
.store-status--open .store-status__dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: var(--success);
  opacity: 0.35;
  animation: pulse-dot 2s ease-out infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.55; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Meta items mais "tap-friendly" e com hover sutil */
.store-meta-item--clickable {
  cursor: pointer;
  transition: background 180ms ease, transform 150ms ease, border-color 180ms ease;
  border: 1px solid transparent;
}
.store-meta-item--clickable:hover {
  background: var(--bg-2);
  border-color: var(--border);
}
.store-meta-item--clickable:active {
  transform: scale(0.97);
}

/* ===========================================================================
   2) CATEGORY PILLS — refinamento, ativa com indicador melhor
   =========================================================================== */
.categories-nav {
  z-index: 30;
  transition: box-shadow 200ms ease;
}
.categories-nav.is-scrolled {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .categories-nav.is-scrolled {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.category-pill {
  position: relative;
  transition: all 200ms var(--ease-out-soft);
  white-space: nowrap;
}
.category-pill:not(.is-active):hover {
  transform: translateY(-1px);
}
.category-pill.is-active {
  box-shadow: 0 4px 14px rgba(255, 106, 0, 0.35);
}

/* Fade nas bordas do scroll horizontal — sugere "tem mais" */
.categories-nav__scroll {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}

/* ===========================================================================
   3) PRODUCT CARD — refinamentos premium + estado "no carrinho"
   =========================================================================== */
.product-card {
  transition: transform 240ms var(--ease-out-soft),
              box-shadow 240ms ease,
              border-color 240ms ease,
              background 200ms ease;
}
@media (hover: hover) {
  .product-card:hover {
    box-shadow: var(--shadow-card-hover);
  }
  [data-theme="light"] .product-card:hover {
    box-shadow: var(--shadow-card-light-hover);
  }
}

/* Quando o produto já está no carrinho, ganha um anel sutil + badge */
.product-card.has-in-cart {
  border-color: rgba(255, 106, 0, 0.40);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-1)),
              linear-gradient(135deg, rgba(255, 106, 0, 0.06), transparent);
  background-clip: padding-box, border-box;
}
.product-card.has-in-cart .btn-add-product {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}
.product-card.has-in-cart .btn-add-product::after {
  content: attr(data-qty);
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--bg-1);
  color: var(--success);
  border: 2px solid var(--bg-1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .product-card.has-in-cart .btn-add-product::after {
  background: #fff;
  color: var(--success);
  border-color: #fff;
}

/* Pulse no botão quando acaba de adicionar */
.btn-add-product.just-added {
  animation: btn-pop 500ms var(--ease-spring);
}
@keyframes btn-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Badge melhor (gradientes) */
.badge {
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(4px);
}
.badge--promo { background: var(--gradient-promo); }
.badge--bestseller { background: var(--gradient-bestseller); }
.badge--hot { background: var(--gradient-hot); }
.badge--featured { background: var(--gradient-featured); }

/* Imagem com leve zoom no hover do card */
.product-card__img {
  transition: transform 500ms var(--ease-out-soft);
}
@media (hover: hover) {
  .product-card:hover .product-card__img {
    transform: scale(1.06);
  }
}

/* ===========================================================================
   4) MENU SECTION — separador melhor + título mais "magazine"
   =========================================================================== */
.menu-section__title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-section__title::before {
  content: '';
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: var(--brand-grad);
  display: inline-block;
}

/* ===========================================================================
   5) SEARCH BAR — focus state mais premium
   =========================================================================== */
.search-bar {
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.search-bar:focus-within {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.15);
}

/* ===========================================================================
   6) PRODUCT MODAL — bottom sheet com drag handle, mais premium
   =========================================================================== */
.product-modal {
  animation: sheet-up 320ms var(--ease-out-soft);
}
@keyframes sheet-up {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (min-width: 768px) {
  .product-modal {
    animation: modal-pop 280ms var(--ease-out-soft);
  }
  @keyframes modal-pop {
    from { transform: scale(0.96) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }
}

/* Drag handle no topo do modal (mobile) */
.product-modal::before,
.cart-modal::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 10;
  pointer-events: none;
}
[data-theme="light"] .product-modal::before,
[data-theme="light"] .cart-modal::before {
  background: rgba(0, 0, 0, 0.18);
}
@media (min-width: 768px) {
  .product-modal::before,
  .cart-modal::before {
    display: none;
  }
}

/* Imagem do modal com gradiente bottom pra texto ficar legível */
.product-modal__img-wrap::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 50%;
  background: linear-gradient(to top, rgba(15, 17, 23, 0.55), transparent);
  pointer-events: none;
}
[data-theme="light"] .product-modal__img-wrap::after {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.30), transparent);
}

/* Header sticky com nome — quando rola o conteúdo */
.product-modal__name {
  letter-spacing: -0.02em;
}

/* Modal close mais ergonômico */
.modal-close {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 150ms ease, background 200ms ease;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.08);
}
[data-theme="light"] .modal-close {
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .modal-close:hover {
  background: #fff;
}

/* ===========================================================================
   7) EXTRA GROUPS — visual mais "checklist", contador interno
   =========================================================================== */
.extra-group {
  background: var(--bg-1);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.extra-group.is-complete {
  border-color: rgba(34, 197, 94, 0.30);
}
.extra-group.is-complete .extra-group__header {
  background: rgba(34, 197, 94, 0.06);
}
.extra-group--invalid {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ============================================
   Wizard de adicionais (modal de produto)
   Quando o produto tem 2+ grupos, mostra:
   - Título "Personalize seu pedido"
   - Número da etapa (1, 2, 3...) no header de cada grupo
   - Hint "Obrigatório · Escolha 3" / "Opcional · até 5"
   - Counter "0/3" que atualiza ao escolher
   - Status no rodapé: "Faltam X etapas" ou "Tudo pronto"
============================================ */

/* Título geral */
.extras-wizard__title {
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.06), rgba(255, 106, 0, 0));
}
.extras-wizard__title--compact {
  padding: 14px 18px 10px;
  border-bottom: 0;
}
.extras-wizard__title strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.extras-wizard__title small {
  font-size: 12px;
  color: var(--fg-3);
}

/* ============================================
   MODO WIZARD — etapa por etapa (3+ grupos)
============================================ */

/* Container externo */
.extras-wizard {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  /* Sombra suave que aparece quando o usuário rola — dá profundidade */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  /* Margens negativas pra cobrir o padding do modal-body */
  margin: 0 -18px;
  padding: 0 18px;
}
[data-theme="light"] .extras-wizard {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
/* Esconde o header inteiro quando está na tela de revisão
   (a tela de revisão já tem seu próprio título "Revise seu pedido") */
.extras-wizard.is-hidden {
  display: none;
}

/* Bolinhas de progresso */
.extras-wizard__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 18px 14px;
  flex-wrap: wrap;
}
.wizard-step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  border: 2px solid transparent;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, transform 220ms ease;
  position: relative;
  flex-shrink: 0;
}
.wizard-step-dot::before {
  content: counter(step);
  counter-increment: step;
}
.extras-wizard__steps {
  counter-reset: step;
}
.wizard-step-dot--review::before {
  content: '';
}
.wizard-step-dot--review i {
  font-size: 13px;
}
/* Linha conectando as bolinhas (visual) */
.wizard-step-dot:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  width: 10px;
  height: 2px;
  background: var(--bg-3);
  transform: translateY(-50%);
  transition: background 220ms ease;
}
.wizard-step-dot.is-past {
  background: var(--success);
  color: #fff;
}
.wizard-step-dot.is-past::after {
  background: var(--success);
}
.wizard-step-dot.is-past::before {
  content: '\2713';
}
.wizard-step-dot--review.is-past::before { content: ''; }

.wizard-step-dot.is-active {
  background: var(--brand);
  color: #fff;
  border-color: rgba(255, 106, 0, 0.30);
  transform: scale(1.10);
}

/* Body das etapas: cada grupo é um "step" e só o ativo é visível */
.extras-wizard__body {
  position: relative;
}
.extra-group--wizard-step {
  display: none;
  animation: wizard-step-in 280ms ease;
}
.extra-group--wizard-step.is-active {
  display: block;
}
@keyframes wizard-step-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Footer do wizard com botões Voltar / Próximo */
.extras-wizard__footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 0 -18px -18px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .extras-wizard__footer {
  background: #fff;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}
.extras-wizard__footer .btn {
  flex: 1;
  max-width: 50%;
}
.extras-wizard__footer .btn--primary:disabled {
  opacity: 0.5;
}

/* Tela de revisão final */
.extras-wizard__review {
  display: none;
  padding: 18px;
  animation: wizard-step-in 280ms ease;
}
.extras-wizard__review.is-active {
  display: block;
}
.wizard-review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.10), rgba(255, 106, 0, 0.02));
  border-radius: 12px;
  margin-bottom: 16px;
}
.wizard-review-header i {
  font-size: 28px;
  color: var(--brand);
  flex-shrink: 0;
}
.wizard-review-header strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--fg);
}
.wizard-review-header small {
  display: block;
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 2px;
}

.wizard-review-section {
  background: var(--bg-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.wizard-review-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wizard-review-section__head strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}
.wizard-review-section__edit {
  background: transparent;
  border: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 150ms ease;
}
.wizard-review-section__edit:hover {
  background: rgba(255, 106, 0, 0.10);
}
.wizard-review-section__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.wizard-review-section__list li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--fg);
}
.wizard-review-section__price {
  color: var(--brand);
  font-weight: 700;
}
.wizard-review-section__empty {
  font-size: 12px;
  color: var(--fg-3);
  font-style: italic;
  padding: 4px 0;
}

/* No modo wizard, esconde o status genérico e o "+addToCart" sticky padrão
   (eles ficam confusos com o footer do wizard) */
.product-modal__body:has(.extras-wizard__footer) > #addToCartBtn,
.product-modal__body:has(.extras-wizard__footer) > .product-modal__extras-summary,
.product-modal__body:has(.extras-wizard__footer) > .product-modal__notes,
.product-modal__body:has(.extras-wizard__footer) > .product-modal__qty-row {
  display: none;
}

.extra-group__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  position: relative;
}
.extra-group--numbered .extra-group__header {
  grid-template-columns: 32px 1fr auto auto;
}

/* Número da etapa */
.extra-group__step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
  flex-shrink: 0;
}
.extra-group.is-complete .extra-group__step-num {
  background: var(--success);
  color: #fff;
  /* Substitui número pelo check */
  font-size: 0;
}
.extra-group.is-complete .extra-group__step-num::after {
  content: '\2713';
  font-size: 14px;
  font-weight: 900;
}
.extra-group--invalid .extra-group__step-num {
  background: rgba(239, 68, 68, 0.25);
  color: var(--danger);
  animation: pulse-error 600ms ease 2;
}
@keyframes pulse-error {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.10); }
}

.extra-group__head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.extra-group__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--fg);
  line-height: 1.25;
}
.extra-group__description {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.4;
}

/* Hint reformulado: obrigatorio (laranja) ou opcional (cinza) */
.extra-group__hint {
  background: var(--bg-3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.extra-group__hint.is-required {
  background: rgba(255, 106, 0, 0.12);
  color: var(--brand);
}
.extra-group__hint.is-optional {
  background: var(--bg-3);
  color: var(--fg-3);
}
.extra-group--invalid .extra-group__hint {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Contador "0/3" do grupo */
.extra-group__counter {
  background: var(--bg-3);
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  min-width: 32px;
  text-align: center;
  transition: background 200ms ease, color 200ms ease;
}
.extra-group__counter.is-partial {
  background: rgba(255, 106, 0, 0.15);
  color: var(--brand);
}
.extra-group__counter.is-complete {
  background: var(--success);
  color: #fff;
}

/* Esconde o check pseudo antigo (agora vem do step-num) */
.extra-group.is-complete .extra-group__title::after {
  display: none;
}
/* Fallback se NÃO for wizard (1 grupo só): check fica no título */
.extra-group:not(.extra-group--numbered).is-complete .extra-group__title::after {
  content: '\2713';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--success);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  margin-left: 4px;
}

/* Status global no rodapé do wizard */
.extras-wizard__status {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 240ms ease, color 240ms ease;
  background: var(--bg-2);
  color: var(--fg-3);
}
.extras-wizard__status:empty {
  display: none;
}
.extras-wizard__status.is-pending {
  background: rgba(255, 106, 0, 0.10);
  color: var(--brand);
}
.extras-wizard__status.is-ready {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  animation: status-ready 320ms ease;
}
.extras-wizard__status i {
  font-size: 16px;
}
@keyframes status-ready {
  from { transform: scale(0.96); opacity: 0.6; }
  to   { transform: scale(1); opacity: 1; }
}

.extra-option {
  transition: background 150ms ease, padding-left 200ms ease;
  position: relative;
  user-select: none;
}
.extra-option:has(input:checked) {
  background: var(--brand-soft);
  font-weight: 600;
}
.extra-option:has(input:checked) .extra-option__price {
  color: var(--brand);
}
.extra-option:active {
  background: var(--bg-2);
}

/* Visual mais limpo dos inputs (acessibilidade preservada) */
.extra-option input {
  accent-color: var(--brand);
  cursor: pointer;
}

/* ===========================================================================
   8) MODAL FOOTER — sticky no mobile com botão grande
   =========================================================================== */
.product-modal__body {
  display: flex;
  flex-direction: column;
}
/* Espaço entre a última seção (Quantidade) e o botão sticky de adicionar,
   pra o botão não cobrir visualmente o controle de quantidade ao rolar até o fim. */
.product-modal__body > .product-modal__qty-row {
  margin-bottom: 16px;
}
.product-modal__body > #addToCartBtn:not(:disabled):not(.is-disabled) {
  /* Sticky bottom no scroll do body do modal */
  position: sticky;
  bottom: 0;
  margin: 12px -18px -18px;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ff6a00, #ff8a1d);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 150ms ease, box-shadow 200ms ease;
}
.product-modal__body > #addToCartBtn:active:not(:disabled):not(.is-disabled) {
  transform: translateY(1px);
}
[data-theme="light"] .product-modal__body > #addToCartBtn:not(:disabled):not(.is-disabled) {
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
/* Estado loja fechada — botão fica com mesmo estilo do wizard:
   margens normais, cantos arredondados, sem ocupar a barra inteira.
   Mantém o gradient laranja com opacity reduzida pra dar feedback visual. */
.product-modal__body > #addToCartBtn.is-disabled,
.product-modal__body > #addToCartBtn:disabled,
#addToCartBtn.is-disabled,
#addToCartBtn:disabled {
  background: linear-gradient(135deg, #ff6a00, #ff8a1d) !important;
  --btn-bg: linear-gradient(135deg, #ff6a00, #ff8a1d) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  --btn-fg: rgba(255, 255, 255, 0.95) !important;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.55 !important;
  /* Sai do modo "barra colada no rodapé" e vira "botão normal" */
  margin: 12px 0 8px !important;
  border-radius: var(--radius) !important;
  padding: 14px 18px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.20) !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800 !important;
}
[data-theme="light"] #addToCartBtn.is-disabled,
[data-theme="light"] #addToCartBtn:disabled {
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
#addToCartBtn.is-disabled i,
#addToCartBtn:disabled i {
  font-size: 18px;
}
#addToCartBtn.is-disabled:active {
  transform: none !important;
}
/* No modo wizard: o #addToCartBtn fica display: none.
   Reforça pra que :disabled não anule essa regra. */
.product-modal__body:has(.extras-wizard__footer) > #addToCartBtn:disabled,
.product-modal__body:has(.extras-wizard__footer) > #addToCartBtn.is-disabled {
  display: none !important;
}

/* Mesmo tratamento pro botão "Confirmar" do wizard quando loja fechada */
#wizardNext:disabled {
  background: linear-gradient(135deg, #ff6a00, #ff8a1d) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  opacity: 0.50;
  cursor: not-allowed;
}

/* Quantidade & botão lado a lado no mobile */
.product-modal__qty {
  margin-bottom: 0;
}
.product-modal__qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 6px;
}
.product-modal__qty-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qty-btn {
  background: var(--bg-3);
  transition: transform 120ms ease, background 180ms ease;
}
.qty-btn:hover:not(:disabled) {
  background: var(--bg-1);
}
.qty-btn:active {
  transform: scale(0.9);
}

/* ===========================================================================
   9) CART ITEM — mais polido (botão remover, hover)
   =========================================================================== */
.cart-item {
  position: relative;
  transition: background 180ms ease, transform 200ms ease;
  animation: cart-item-in 280ms var(--ease-out-soft);
}
@keyframes cart-item-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cart-item.is-removing {
  animation: cart-item-out 250ms ease forwards;
}
@keyframes cart-item-out {
  to { opacity: 0; transform: translateX(40px); height: 0; padding: 0; margin: 0; }
}
.cart-item:hover {
  background: var(--bg-3);
}

.cart-qty-btn {
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.cart-qty-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.cart-qty-btn:active {
  transform: scale(0.85);
}

/* ===========================================================================
   10) CART FLOAT (mobile) — animação de "item entrou" no contador
   =========================================================================== */
.cart-float {
  animation: float-in 350ms var(--ease-spring);
}
@keyframes float-in {
  from { opacity: 0; transform: translateY(80px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cart-float__count {
  transition: transform 250ms var(--ease-spring);
}
.cart-float__count.bump {
  animation: count-bump 450ms var(--ease-spring);
}
@keyframes count-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.cart-float__btn {
  position: relative;
  overflow: hidden;
}
.cart-float__btn::after {
  /* Brilho passando */
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 700ms ease;
}
.cart-float__btn:hover::after {
  left: 130%;
}

/* ===========================================================================
   11) CART SIDEBAR (desktop) — header com contador
   =========================================================================== */
.cart-sidebar__title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.cart-sidebar__count {
  margin-left: auto;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

/* ===========================================================================
   11b) PRODUCT CARD PLACEHOLDER NEUTRO (produto sem foto)
   Override do estilo antigo (letra colorida) — agora é só um ícone discreto
   pra ficar visualmente neutro e profissional.
   =========================================================================== */
.product-card__img-placeholder {
  /* Cancela gradientes coloridos do app.css */
  background: var(--bg-2) !important;
  /* Cancela cor branca do texto */
  color: var(--fg-3) !important;
  font-size: 36px !important;
  /* Cancela text-shadow */
  text-shadow: none !important;
  /* Borda sutil */
  border: 1px dashed var(--border);
  border-radius: inherit;
}
[data-theme="light"] .product-card__img-placeholder {
  background: #f6f6f6 !important;
  color: #999 !important;
}
/* Cancela o pseudo-element ::before (padrão decorativo) e variantes coloridas */
.product-card__img-placeholder::before {
  display: none;
}
.product-card__img-placeholder i {
  position: relative;
  z-index: 1;
}

/* ===========================================================================
   12) FLY-TO-CART ANIMATION — feedback visual ao adicionar
   =========================================================================== */
.fly-clone {
  position: fixed;
  z-index: 90;
  border-radius: 12px;
  pointer-events: none;
  transition: all 700ms cubic-bezier(0.55, 0.05, 0.45, 0.95);
  box-shadow: 0 8px 32px rgba(255, 106, 0, 0.6);
  opacity: 1;
}
.fly-clone.fly-end {
  transform: scale(0.15) rotate(20deg);
  opacity: 0.2;
}
.fly-clone img,
.fly-clone .fly-clone__inner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.fly-clone__inner {
  background: linear-gradient(135deg, #ff6a00, #ff8530);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
}

/* ===========================================================================
   13) EMPTY STATE — visual mais convidativo no carrinho vazio
   =========================================================================== */
.cart-empty {
  padding: 36px 16px;
  animation: empty-fade 400ms ease;
}
@keyframes empty-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.cart-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--bg-2);
  border-radius: 50%;
  margin: 0 auto 12px;
  font-size: 32px;
}

/* ===========================================================================
   14) TOAST — mais polido com ícone
   =========================================================================== */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 14px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.30);
  animation: toast-slide-up 280ms var(--ease-spring);
  backdrop-filter: blur(12px);
  /* Limita largura - nunca estoura mobile e nunca fica gigante em desktop */
  max-width: min(420px, calc(100vw - 32px));
  text-align: left;
  word-break: break-word;
}
@keyframes toast-slide-up {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast--success {
  background: rgba(34, 197, 94, 0.95);
  color: #fff;
}
.toast--error {
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
}
.toast--warning {
  background: rgba(245, 158, 11, 0.95);
  color: #1a1a1a;
}
.toast--info {
  background: rgba(15, 17, 23, 0.92);
  color: #fff;
  border: 1px solid var(--border);
}
.toast::before {
  font-family: 'Phosphor';
  font-weight: 900;
  font-size: 20px;
  flex-shrink: 0;
}
.toast--success::before { content: '\eb8a'; /* check */ }
.toast--error::before   { content: '\e8fc'; /* x circle */ }
.toast--warning::before { content: '\e9d8'; /* warning */ }
.toast--info::before    { content: '\e9b6'; /* info */ }

/* ===========================================================================
   15) PRODUCT MODAL — resumo de extras na hora (slot inline)
   =========================================================================== */
.product-modal__extras-summary {
  font-size: 12px;
  color: var(--fg-2);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 10px 12px;
  margin: -6px 0 14px;
  display: none;
}
.product-modal__extras-summary.has-extras {
  display: block;
}
.product-modal__extras-summary strong {
  color: var(--fg);
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===========================================================================
   16) BACK-TO-CART NUDGE — botão para voltar pro topo
   =========================================================================== */
.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: 100px;
  width: 44px;
  height: 44px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
  z-index: 35;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}
.scroll-top-btn.is-visible {
  display: flex;
  animation: float-in 300ms var(--ease-spring);
}
.scroll-top-btn:hover {
  background: var(--bg-2);
  transform: translateY(-2px);
}
@media (min-width: 992px) {
  .scroll-top-btn { bottom: 24px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  .scroll-top-btn { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  @media (min-width: 992px) {
    .scroll-top-btn { bottom: 24px; }
  }
}

/* ===========================================================================
   17) CHECKOUT — refinos
   =========================================================================== */
.checkout-card {
  position: relative;
  transition: border-color 200ms ease;
}
.checkout-card:focus-within {
  border-color: rgba(255, 106, 0, 0.30);
}

/* Step badge no canto superior direito dos cards de checkout */
.checkout-card__title {
  letter-spacing: -0.01em;
  font-size: 16px;
}
.checkout-card__title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 10px;
  font-size: 16px;
  flex-shrink: 0;
}

/* Payment options — selo "selecionado" mais claro */
.payment-option__card {
  position: relative;
  transition: all 200ms var(--ease-out-soft);
}
.payment-option input:checked + .payment-option__card {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 106, 0, 0.18);
}
.payment-option input:checked + .payment-option__card::after {
  content: '\eb8a'; /* check */
  font-family: 'Phosphor';
  font-weight: 900;
  position: absolute;
  top: 6px; right: 6px;
  width: 18px;
  height: 18px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Resumo de checkout — items com fade */
.checkout-item {
  animation: cart-item-in 280ms var(--ease-out-soft);
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.checkout-item:last-of-type {
  border-bottom: 0;
}

/* Total final destacado */
.checkout-total-row--total {
  font-size: 20px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 2px solid var(--border);
}
.checkout-total-row--total span:last-child {
  font-size: 24px;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -0.02em;
}

/* Botão submit do checkout — gradient e brilho */
#submitOrderBtn {
  position: relative;
  overflow: hidden;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 16px;
  font-size: 16px;
  box-shadow: 0 10px 26px rgba(255, 106, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
#submitOrderBtn:not(:disabled)::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.30), transparent);
  transform: skewX(-20deg);
  transition: left 900ms ease;
}
#submitOrderBtn:hover:not(:disabled)::after { left: 140%; }
#submitOrderBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Loading state do submit */
#submitOrderBtn.is-loading {
  pointer-events: none;
}
#submitOrderBtn.is-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -3px;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===========================================================================
   18) FORM FOCUS — todas as inputs com ring suave
   =========================================================================== */
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.12);
  outline: none;
}

/* Inputs readonly cinza mais sutil */
.form-control[readonly] {
  background: var(--bg-2);
  cursor: default;
}

/* ===========================================================================
   19) CHECKOUT - cep status com ícone
   =========================================================================== */
.coupon-message {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: msg-in 220ms ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.coupon-message--success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}
.coupon-message--error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}
.coupon-message--loading {
  background: var(--bg-2);
  color: var(--fg-2);
}

/* ===========================================================================
   20) MOBILE — refinos finais bottom sheet
   =========================================================================== */
@media (max-width: 768px) {
  .product-modal__img-wrap {
    aspect-ratio: 16/10;
  }
  .product-modal__body {
    padding: 14px 16px;
  }
  .product-modal__name {
    font-size: 20px;
    padding-right: 50px; /* espaço pro close button */
  }
  .extra-group__header {
    padding: 12px 14px;
  }
  .extra-option {
    padding: 14px;
    font-size: 14px;
  }
  .product-modal__body > #addToCartBtn:not(:disabled):not(.is-disabled) {
    margin: 14px -16px -14px;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    font-size: 17px;
  }

  /* No mobile, cart-modal vai full-bottom-sheet com drag handle */
  .cart-modal {
    padding-top: 18px;
  }
  .cart-modal__header {
    padding-top: 18px;
  }
}

/* ===========================================================================
   21) ACCESSIBILITY - reduce motion
   =========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===========================================================================
   22) STICKY MODAL HEADER (nome do produto quando rola)
   =========================================================================== */
.product-modal__sticky-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 12px 50px 12px 16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 15px;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.product-modal.is-scrolled .product-modal__sticky-header {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===========================================================================
   23) SHARE OPTIONS - mais bonitas
   =========================================================================== */
.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease;
  color: var(--fg);
}
.share-option:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.share-option i {
  font-size: 28px;
  margin-bottom: 4px;
}
.share-option--whatsapp i { color: #25d366; }
.share-option--telegram i { color: #0088cc; }
.share-option strong {
  font-weight: 700;
  font-size: 13px;
}
.share-option small {
  color: var(--fg-2);
  font-size: 11px;
}
.share-option--copied {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}
.share-link-preview {
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 10px;
  margin-top: 4px;
}
.share-link-preview small {
  display: block;
  color: var(--fg-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.share-link-preview code {
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  word-break: break-all;
  font-weight: 600;
}

/* ===========================================================================
   24) CHECKOUT STEPPER — progresso visual no topo
   =========================================================================== */
.checkout-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 20px;
  margin-bottom: 8px;
}
.checkout-stepper__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-3);
  transition: color 200ms ease;
  white-space: nowrap;
}
.checkout-stepper__item.is-active,
.checkout-stepper__item.is-done {
  color: var(--fg);
}
.checkout-stepper__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--bg-3);
  font-size: 13px;
  font-weight: 800;
  color: var(--fg-3);
  transition: all 220ms var(--ease-out-soft);
  flex-shrink: 0;
}
.checkout-stepper__item.is-active .checkout-stepper__num {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.35);
}
.checkout-stepper__item.is-done .checkout-stepper__num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.checkout-stepper__item.is-done .checkout-stepper__num::before {
  content: '\eb8a'; /* check */
  font-family: 'Phosphor';
  font-weight: 900;
  font-size: 12px;
}
.checkout-stepper__item.is-done .checkout-stepper__num > * {
  display: none;
}
.checkout-stepper__connector {
  flex: 1;
  height: 2px;
  background: var(--bg-3);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.checkout-stepper__connector.is-active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--success), var(--brand));
  animation: connector-fill 400ms var(--ease-out-soft);
}
@keyframes connector-fill {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@media (max-width: 480px) {
  .checkout-stepper {
    gap: 4px;
  }
  .checkout-stepper__label {
    font-size: 11px;
  }
  .checkout-stepper__num {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* ===========================================================================
   25) AUTOFILL BANNER — fica mais bonito
   =========================================================================== */
.autofill-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.10), rgba(255, 138, 29, 0.04));
  border: 1px solid rgba(255, 106, 0, 0.25);
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  animation: msg-in 280ms ease;
}
.autofill-banner i:first-child {
  font-size: 20px;
  color: var(--brand);
  flex-shrink: 0;
}
.autofill-banner span {
  flex: 1;
}
.autofill-banner__close {
  background: transparent;
  border: 0;
  color: var(--fg-2);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 150ms ease;
}
.autofill-banner__close:hover {
  background: var(--bg-3);
}

/* ===========================================================================
   26) COUPON INPUT — visual mais "ticket"
   =========================================================================== */
.coupon-input {
  display: flex;
  gap: 8px;
}
.coupon-input .form-control {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.coupon-input .btn {
  flex-shrink: 0;
}
.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease;
  color: var(--fg);
}
.share-option:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.share-option i {
  font-size: 28px;
  margin-bottom: 4px;
}
.share-option--whatsapp i { color: #25d366; }
.share-option--telegram i { color: #0088cc; }
.share-option strong {
  font-weight: 700;
  font-size: 13px;
}
.share-option small {
  color: var(--fg-2);
  font-size: 11px;
}
.share-option--copied {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}
.share-link-preview {
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 10px;
  margin-top: 4px;
}
.share-link-preview small {
  display: block;
  color: var(--fg-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.share-link-preview code {
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  word-break: break-all;
  font-weight: 600;
}
