@import url('tokens.css');

* { box-sizing: border-box; }
html {
  overflow-x: clip;
  height: auto;
}
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  color: var(--bb-text);
  background: var(--bb-bg);
  overflow-x: clip;
  min-height: 100%;
}
#app {
  min-height: 100%;
}
img { max-width: 100%; height: auto; display: block; }
.hidden { display: none !important; }

html.scroll-locked,
body.scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}
body.scroll-locked #product-modal .product-sheet-body,
body.scroll-locked .cart-body,
body.scroll-locked .checkout-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* —— Header preto —— */
.store-header {
  background: var(--bb-black);
  color: #fff;
  padding: 12px 14px 14px;
  position: relative;
  z-index: 10;
  overflow: hidden;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.header-top .btn-orders,
.header-top .btn-sacola {
  padding: 5px 10px;
  min-height: 32px;
  font-size: 11px;
  font-weight: 600;
  gap: 5px;
  border-radius: 999px;
}
.header-top .btn-orders {
  border-width: 1px;
}
.header-top .btn-sacola {
  padding: 5px 10px 5px 9px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(225, 6, 0, 0.35);
}
.header-top .btn-orders .ui-icon--sm,
.header-top .btn-sacola .ui-icon--sm,
.header-top svg.lucide.ui-icon--sm {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
}
.header-top .sacola-count {
  min-width: 17px;
  height: 17px;
  font-size: 9px;
  font-weight: 800;
  padding: 0 4px;
}
.btn-orders {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-orders .ui-icon {
  color: var(--bb-red);
}
.btn-sacola {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bb-red);
  border: 0;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(225, 6, 0, 0.45);
}
.sacola-count {
  background: #fff;
  color: var(--bb-red);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
}
.header-main {
  display: block;
}
.header-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.brand-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0;
  min-width: 0;
}
.brand-tagline {
  margin: 10px 0 12px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #9ca3af;
  max-width: 22em;
}
.brand-visual-slot {
  position: absolute;
  z-index: 0;
  right: -12px;
  top: 0;
  width: 318px;
  height: 269px;
  max-height: none;
  min-height: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  line-height: 0;
}
.brand-visual-slot::after {
  content: "";
  position: absolute;
  left: 15%;
  top: 57%;
  width: 18%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 50%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 32%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 1;
}
.brand-visual-slot img {
  width: 318px;
  height: 269px;
  max-height: none;
  max-width: none;
  object-fit: contain;
  display: block;
  background: transparent;
}
.brand-visual-slot img.brand-visual--cover {
  object-fit: cover;
  padding: 0;
  max-height: none;
}
.brand-visual-slot img.bb-media--placeholder {
  object-fit: contain;
  padding: 8px;
  background: #141414;
  border: 1px dashed #333;
  border-radius: 12px;
}
.brand-brutal {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.35rem, 10.5vw, 3.1rem);
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 0.95;
}
.brand-burguer {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  letter-spacing: 0.28em;
  color: var(--bb-red);
  margin-top: 4px;
  line-height: 1;
}

/* Moldura única: logo + fotos de produtos */
.bb-thumb {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: #e5e7eb;
  border: 1px solid var(--bb-border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bb-thumb--logo {
  width: 64px;
  height: 64px;
  background: #141414;
  border-color: #333;
}
.bb-thumb--cart {
  width: 64px;
  height: 64px;
}
.bb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bb-thumb--logo img,
.bb-thumb img.bb-media--logo {
  object-fit: contain;
  padding: 8px;
  background: #141414;
}
.bb-thumb img.bb-media--placeholder {
  object-fit: contain;
  padding: 10px;
  border: 0;
}

.status-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}
.pill-open {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.pill-open.closed {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.35);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4ade80;
}
.pill-open.closed .status-dot { background: #f87171; }
.pill-hours {
  background: #1a1a1a;
  color: #d4d4d8;
  border: 1px solid #333;
  font-weight: 600;
}
.pill-hours .ui-icon { color: var(--bb-red); }

/* —— Faixa promo (escura) —— */
.welcome-strip { background: #0a0a0a; padding: 0 12px 10px; }
.promo-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(225, 6, 0, 0.55);
  border-radius: 14px;
  background: #121212;
  margin-bottom: 8px;
}
.promo-star {
  width: 36px;
  height: 36px;
  background: var(--bb-red);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.promo-text {
  font-size: 11px;
  line-height: 1.35;
  color: #e4e4e7;
  min-width: 0;
}
.promo-text strong {
  display: block;
  color: #fff;
  font-size: 12px;
  margin-bottom: 2px;
}
.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bb-red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* —— Tabs categorias —— */
.categories-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--bb-border);
  scrollbar-width: none;
}
.categories-nav::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #374151;
  padding: 12px 14px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cat-tab.active {
  color: #111;
  border-bottom-color: var(--bb-red);
}
.cat-tab.active .cat-ico { color: var(--bb-red); }

/* —— Produtos —— */
.menu-light {
  background: var(--bb-bg);
  padding: 10px 12px 88px;
  min-height: 40vh;
}
body.has-cart-float .menu-light {
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
body.has-cart-float .site-footer {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* Barra flutuante Ver Sacola */
.cart-float-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  max-width: 480px;
  margin: 0 auto;
}
.cart-float-bar.hidden {
  display: none;
}
.cart-float-bar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bb-red);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 56px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(225, 6, 0, 0.42);
}
.cart-float-count {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
}
.cart-float-label {
  flex: 1;
  text-align: left;
  letter-spacing: 0.02em;
}
.cart-float-total {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}
.cart-float-bar-btn .ui-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.products-list { display: grid; gap: 10px; }
.product-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--bb-border);
  border-radius: 14px;
  padding: 10px 52px 10px 10px;
}
.product-card > .bb-thumb {
  width: 96px;
  height: 96px;
}
.product-card > .bb-media,
.product-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: transparent;
}
.product-card > .bb-media--placeholder,
.product-card .bb-thumb img.bb-media--placeholder {
  object-fit: contain;
  padding: 10px;
}
.product-body { min-width: 0; }
.product-body h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #111;
  line-height: 1.2;
}
.product-body .ingredients {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--bb-text-muted);
}
.product-body .price {
  font-size: 15px;
  font-weight: 800;
  color: var(--bb-red);
}
.product-body .price .old {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 12px;
  margin-right: 6px;
}
.product-tags { display: none; }
.add-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--bb-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 6, 0, 0.35);
}
.add-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.state-box { text-align: center; color: var(--bb-text-muted); padding: 24px 12px; }
.site-footer {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 16px;
  background: #fff;
  border-top: 1px solid var(--bb-border);
}

/* —— Botões / modais —— */
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary { background: var(--bb-red); color: #fff; }
.btn-ghost { background: #fff; color: var(--bb-text); border: 1px solid var(--bb-border); }
.btn-whatsapp { background: #128c7e; color: #fff; }
.btn-block { width: 100%; }

.cart-drawer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.cart-drawer[aria-hidden="false"] { pointer-events: auto; }
.cart-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cart-drawer-inner {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  color: var(--bb-text);
  border-left: 1px solid var(--bb-border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}
.cart-drawer[aria-hidden="false"] .cart-drawer-inner { transform: translateX(0); }
.cart-drawer[aria-hidden="false"] .cart-backdrop { opacity: 1; }
.cart-items { flex: 1; overflow: auto; display: grid; gap: 0.75rem; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.5rem;
  background: var(--bb-bg);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--bb-border);
}
.cart-item .bb-thumb--cart img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-footer { border-top: 1px solid var(--bb-border); padding-top: 0.75rem; }
.cart-summary { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.qty-controls { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; margin-top: 4px; }
.qty-controls button {
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--bb-border);
  background: #fff;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.modal[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.modal-dialog {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  color: var(--bb-text);
  border: 1px solid var(--bb-border);
  border-radius: 18px;
  padding: 1rem;
  position: relative;
}
.modal-lg { width: min(960px, 100%); }
.icon-btn-lucide {
  border: 0;
  background: var(--bb-bg);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-close { position: absolute; top: 0.5rem; right: 0.5rem; }
.modal-dialog input:not([type="radio"]):not([type="checkbox"]),
.modal-dialog select,
.modal-dialog textarea {
  width: 100%;
  border: 1px solid var(--bb-border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  font-size: 15px;
}
.modal-dialog input[type="radio"],
.modal-dialog input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--bb-red);
}
.form-grid { display: grid; gap: 0.65rem; }
.checkout-grid { display: grid; gap: 1rem; }
@media (min-width: 800px) { .checkout-grid { grid-template-columns: 1.2fr 0.8fr; } }
.checkout-summary { background: var(--bb-bg); border-radius: 12px; padding: 0.75rem; border: 1px solid var(--bb-border); }
.summary-row { display: flex; justify-content: space-between; margin: 0.35rem 0; color: var(--bb-text-muted); }
.summary-row.total { font-size: 1.1rem; font-weight: 800; color: var(--bb-text); }
.form-feedback { min-height: 1.2rem; color: var(--bb-red); }
.modal-product-media .bb-media { width: 100%; max-height: 160px; object-fit: cover; border-radius: 12px; }

#modal-content h2 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.05rem;
  line-height: 1.25;
}
#modal-content > p {
  margin: 0.2rem 0;
  font-size: 0.85rem;
  color: var(--bb-text-muted);
}
#product-modal .modal-dialog {
  overflow: hidden;
  max-height: none;
}
#product-modal #customize-form > label.field-label-upper {
  display: block;
}
#product-modal #customize-form textarea {
  margin-bottom: 4px;
}
#customize-form > label:not(.option-item) {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bb-text-muted);
}
#customize-form textarea {
  min-height: 56px;
  padding: 8px 10px;
}
#customize-form input[type="number"] {
  max-width: 88px;
  min-height: 40px;
  padding: 8px 10px;
}
#customize-form > p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.option-group {
  margin: 0;
  padding: 8px 10px;
  background: var(--bb-bg);
  border-radius: 10px;
  border: 1px solid var(--bb-border);
}
.option-group h4 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bb-text-muted);
}
.option-list { display: grid; gap: 2px; }
.option-group--chips .option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 0;
}
.option-group--chips .option-item {
  flex: 0 1 auto;
  padding: 0;
  margin: 0;
}
.option-group--chips .option-item span:first-child {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--bb-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.8rem;
  white-space: nowrap;
}
.option-group--chips .option-item:has(input:checked) span:first-child {
  border-color: var(--bb-red);
  background: #fff1f1;
  color: var(--bb-red-dark);
  font-weight: 700;
}
.option-group--chips .option-item span:last-child { display: none; }
.option-group--chips .option-item input {
  position: absolute;
  opacity: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  inset: 0;
}
.option-item span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.option-item span:last-child {
  font-size: 0.78rem;
  color: var(--bb-text-muted);
  flex-shrink: 0;
}
.timeline { list-style: none; padding: 0; margin: 1rem 0; }
.timeline li { padding: 0.5rem 0.75rem; border-left: 3px solid var(--bb-border); margin-bottom: 0.35rem; color: var(--bb-text-muted); }
.timeline li.done { border-color: var(--bb-red); color: var(--bb-text); }
.timeline li.current { background: var(--bb-red-soft); font-weight: 700; }
#orders-modal .modal-dialog {
  max-height: min(88vh, 720px);
  overflow: auto;
}
.orders-hint { text-align: left; margin: 0 0 10px; }
.order-history { display: grid; gap: 10px; margin-top: 12px; }
.order-history-card {
  border: 1px solid var(--bb-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.order-history-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.order-status {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--bb-red);
}
.order-status--completed { color: #047857; }
.order-status--cancelled { color: #6b7280; }
.order-history-meta { margin: 4px 0; font-size: 0.75rem; color: var(--bb-text-muted); }
.order-history-items { margin: 0; padding-left: 16px; font-size: 0.78rem; }
.order-history-card .timeline { margin: 8px 0 0; }
.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #111;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

@media (max-width: 400px) {
  .brand-visual-slot,
  .brand-visual-slot img {
    width: 224px;
    height: 189px;
  }
  .brand-tagline {
    font-size: 0.68rem;
  }
  .bb-thumb--logo { width: 56px; height: 56px; }
}
