/* ============================
   VARIÁVEIS E RESET
   ============================ */
:root {
  --roxo:   #5E1675;
  --creme:  #F7E7CE;
  --verde:  #A0C25A;
  --escuro: #1a1a1a;
  --cinza:  #f5f5f5;
  --borda:  #eee;
  --sombra: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: #f9f9f9;
  color: var(--escuro);
  min-height: 100vh;
  padding-bottom: 100px;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================
   HEADER
   ============================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--roxo);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-logo img {
  height: 36px;
  width: 36px;
}

.header-brand {
  color: var(--creme);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.cart-btn {
  position: relative;
  background: var(--creme);
  color: var(--roxo);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
}

.cart-btn:hover { opacity: 0.9; }

.cart-badge {
  background: var(--verde);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.cart-badge.visible { display: flex; }

/* ============================
   HERO
   ============================ */
.hero {
  background: var(--roxo);
  padding: 28px 20px 36px;
  text-align: center;
  color: var(--creme);
}

.hero-title {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 20px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(247,231,206,0.3);
  color: var(--creme);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  white-space: nowrap;
}

.pill.verde {
  background: var(--verde);
  border-color: var(--verde);
  color: #fff;
}

/* ============================
   MENU NAV (abas)
   ============================ */
.menu-nav {
  display: flex;
  background: #fff;
  border-bottom: 2px solid var(--borda);
  position: sticky;
  top: 64px;
  z-index: 90;
}

.menu-nav-btn {
  flex: 1;
  padding: 14px 8px;
  font-size: 13px;
  font-weight: 800;
  color: #999;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  text-align: center;
}

.menu-nav-btn.active {
  color: var(--roxo);
  border-bottom-color: var(--roxo);
}

/* ============================
   SEÇÕES DO MENU
   ============================ */
.menu-section {
  padding: 20px 16px 8px;
}

.section-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 4px;
}

.section-sub {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
}

/* ============================
   CARDS DE PRODUTO
   ============================ */
.product-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  margin-bottom: 16px;
  overflow: hidden;
}

.product-image-wrap {
  background: var(--creme);
  display: flex;
  justify-content: center;
  padding: 20px;
  min-height: 180px;
}

.product-image-wrap img {
  height: 160px;
  width: auto;
  object-fit: contain;
}

.product-body {
  padding: 16px;
}

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.product-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--escuro);
}

.product-price {
  font-size: 17px;
  font-weight: 900;
  color: var(--roxo);
  white-space: nowrap;
  margin-left: 8px;
}

.product-desc {
  font-size: 13px;
  color: #777;
  margin-bottom: 14px;
  line-height: 1.5;
}

.includes-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--creme);
  color: var(--roxo);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 50px;
  margin-bottom: 14px;
}

/* ============================
   SELETOR DE TAMANHO (combos)
   ============================ */
.size-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.size-btn {
  flex: 1;
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  transition: all 0.15s;
}

.size-btn.selected {
  border-color: var(--roxo);
  background: var(--roxo);
  color: var(--creme);
}

.size-btn-label {
  font-size: 13px;
  font-weight: 800;
  display: block;
}

.size-btn-price {
  font-size: 11px;
  opacity: 0.75;
  display: block;
  margin-top: 2px;
}

.size-btn.selected .size-btn-price { opacity: 0.85; }

/* ============================
   COMPLEMENTOS
   ============================ */
.comp-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--escuro);
  margin-bottom: 10px;
}

.comp-label span {
  color: var(--roxo);
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.comp-btn {
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--escuro);
  background: #fff;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-btn.selected {
  border-color: var(--roxo);
  background: var(--roxo);
  color: var(--creme);
}

.comp-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.comp-btn .check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.comp-btn.selected .check::after { content: '✓'; }

.adicionais-section { margin-bottom: 14px; }

.adicionais-label {
  font-size: 12px;
  font-weight: 700;
  color: #999;
  margin-bottom: 8px;
}

/* ============================
   CONTROLE DE QUANTIDADE + BOTÃO
   ============================ */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 38px;
  height: 38px;
  font-size: 18px;
  font-weight: 700;
  color: var(--roxo);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qty-btn:hover { background: var(--cinza); }

.qty-value {
  min-width: 36px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  padding: 0 4px;
}

.add-btn {
  flex: 1;
  background: var(--roxo);
  color: var(--creme);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  transition: opacity 0.15s;
}

.add-btn:hover { opacity: 0.9; }
.add-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ============================
   DRAWER DO CARRINHO
   ============================ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 201;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.cart-drawer.open { transform: translateY(0); }

.cart-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--borda);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--roxo);
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cinza);
  color: #666;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-empty {
  text-align: center;
  color: #aaa;
  font-size: 14px;
  padding: 40px 0;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--borda);
}

.cart-item-info { flex: 1; }

.cart-item-name {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 3px;
}

.cart-item-detail {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--roxo);
}

.cart-item-remove {
  color: #ccc;
  font-size: 18px;
  padding: 4px;
  align-self: flex-start;
}

.cart-item-remove:hover { color: #e44; }

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--borda);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cart-total-label {
  font-size: 14px;
  font-weight: 700;
  color: #555;
}

.cart-total-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--roxo);
}

.checkout-btn {
  width: 100%;
  background: var(--verde);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  transition: opacity 0.15s;
}

.checkout-btn:hover { opacity: 0.9; }

/* ============================
   MODAL DE CHECKOUT
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 20px 40px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #555;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--escuro);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--roxo);
}

.form-input.error, .form-select.error {
  border-color: #e44;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

/* Pagamento */
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-opt {
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.payment-opt.selected {
  border-color: var(--roxo);
  background: #faf5fc;
}

.payment-opt-icon { font-size: 24px; margin-bottom: 6px; }

.payment-opt-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--escuro);
  display: block;
}

.payment-opt-sub {
  font-size: 11px;
  color: #888;
  display: block;
  margin-top: 2px;
}

.submit-btn {
  width: 100%;
  background: var(--roxo);
  color: var(--creme);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  transition: opacity 0.15s;
}

.submit-btn:hover { opacity: 0.9; }
.submit-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================
   PÁGINA PIX
   ============================ */
.pix-page {
  min-height: 100vh;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 60px;
}

.pix-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
}

.pix-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 4px;
  text-align: center;
}

.pix-sub {
  font-size: 14px;
  color: #777;
  text-align: center;
  margin-bottom: 24px;
}

.pix-qr-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  margin-bottom: 20px;
}

.pix-qr-wrap img {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
}

.pix-total {
  font-size: 24px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 4px;
}

.pix-timer {
  font-size: 13px;
  color: #888;
}

.pix-copy-section {
  width: 100%;
  max-width: 320px;
  margin-bottom: 20px;
}

.pix-copy-label {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  margin-bottom: 8px;
}

.pix-copy-row {
  display: flex;
  gap: 8px;
}

.pix-code-input {
  flex: 1;
  border: 2px solid var(--borda);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: #555;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: var(--roxo);
  color: var(--creme);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.copy-btn:hover { opacity: 0.9; }

.pix-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #888;
}

.pix-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--borda);
  border-top-color: var(--roxo);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ============================
   PÁGINA SUCESSO
   ============================ */
.success-page {
  min-height: 100vh;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--verde);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  margin-bottom: 20px;
}

.success-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 8px;
}

.success-sub {
  font-size: 15px;
  color: #777;
  margin-bottom: 28px;
  max-width: 300px;
}

.order-summary {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 20px;
  width: 100%;
  max-width: 360px;
  text-align: left;
  margin-bottom: 24px;
}

.order-summary-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--roxo);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--creme);
}

.order-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.order-row-label { color: #888; font-weight: 600; }
.order-row-value { font-weight: 800; }

.order-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 900;
  color: var(--roxo);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--creme);
}

.whatsapp-btn {
  width: 100%;
  max-width: 360px;
  background: #25D366;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.whatsapp-btn:hover { opacity: 0.9; }

/* ============================
   UTILITÁRIOS
   ============================ */
.divider {
  height: 1px;
  background: var(--borda);
  margin: 14px 0;
}

.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

/* ============================
   RESPONSIVO (desktop)
   ============================ */
@media (min-width: 480px) {
  .modal, .cart-drawer {
    max-width: 480px;
    margin: 0 auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(100%);
    border-radius: 20px 20px 0 0;
  }

  .modal-overlay.open .modal,
  .cart-drawer.open {
    transform: translateX(-50%) translateY(0);
  }

  body { max-width: 480px; margin: 0 auto; }
}
