/* ==========================================================
   SILVA DRINKS — Cardápio Cliente  |  Tropical Verão
   Mobile-first · Max 640px · Fraunces + Manrope
   ========================================================== */

/* === Tokens === */
:root {
  --sun-100:   #FFE9A8;
  --peach-200: #FFCFA1;
  --coral-300: #FF9A6B;
  --leaf-600:  #2F6E3F;
  --leaf-400:  #5BA56A;
  --ink-900:   #1B1B1B;
  --ink-600:   #4A4A4A;
  --paper:     #FFFCF5;
  --cherry:    #D6334B;
  --sky:       #7BC9D9;
  --border:    1.5px solid #1B1B1B;
  --r-card:    14px;
  --r-pill:    999px;
}

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

/* === Root === */
.client-root {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-900);
  min-height: 100dvh;
  background:
    linear-gradient(180deg, var(--sun-100) 0%, var(--peach-200) 55%, var(--coral-300) 100%)
    fixed;
  overflow-x: hidden;
  position: relative;
}

/* === Layout === */
.client-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 130px;
  position: relative;
  z-index: 1;
}

/* === Views (SPA) === */
.view { display: none; }
.view.active { display: block; }

/* ================================================================
   CORNER LEAF DECORATIONS
   ================================================================ */
.leaf-corner {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}
.leaf-corner--tl { top: -4px; left: -4px; width: 155px; }
.leaf-corner--tr { top: -4px; right: -4px; width: 155px; }
.leaf-corner--bl { bottom: 60px; left: -4px; width: 110px; opacity: .65; }

/* ================================================================
   BRAND HEADER
   ================================================================ */
.brand-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 90px 24px 40px;
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(3.25rem, 13vw, 5.5rem);
  font-weight: 900;
  line-height: .88;
  letter-spacing: -.04em;
  color: var(--ink-900);
  margin-bottom: 20px;
  text-shadow: 2px 3px 0 rgba(255,255,255,.35);
}

.tagline-pill {
  display: inline-block;
  background: var(--ink-900);
  color: #fff;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 9px 30px;
  border-radius: var(--r-pill);
  letter-spacing: .02em;
}

/* ================================================================
   CATEGORY SECTIONS
   ================================================================ */
.category-section {
  position: relative;
  margin-top: 52px;
  animation: riseIn .5s ease both;
}
.category-section:nth-child(1) { animation-delay: .05s; }
.category-section:nth-child(2) { animation-delay: .15s; }
.category-section:nth-child(3) { animation-delay: .25s; }
.category-section:nth-child(4) { animation-delay: .35s; }

/* Pill sits on top of card border */
.category-pill-wrap {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
}

.category-pill {
  background: #fff;
  border: var(--border);
  border-radius: var(--r-pill);
  padding: 7px 28px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(27,27,27,.07);
}

.category-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-card);
  padding: 24px 20px 18px;
  position: relative;
  z-index: 1;
}

/* ================================================================
   SUBCATEGORY LABEL (ex: Cerveja / Água dentro de Bebidas)
   ================================================================ */
.subcategory-label {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-400, #888);
  margin: 14px 0 2px;
}
.subcategory-label:first-child { margin-top: 0; }

/* ================================================================
   DRINK ROWS
   ================================================================ */
.drink-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(27,27,27,.09);
}
.drink-row:last-child { border-bottom: none; }
.drink-row:active { background: rgba(255,255,255,.4); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }

.drink-info { flex: 1; min-width: 0; }

.drink-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-900);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-tag {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  display: block;
}

.btn-pick {
  flex-shrink: 0;
  cursor: pointer;
  background: var(--leaf-600);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 20px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .01em;
  transition: background .15s, transform .1s;
  touch-action: manipulation;
  min-height: 44px;
}
.btn-pick:hover  { background: var(--leaf-400); }
.btn-pick:active { transform: scale(.95); }

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--ink-600);
  font-style: italic;
  padding: 16px 0 8px;
  font-size: .9rem;
}

/* ================================================================
   FLOATING ACTION BUTTON — Ver Pedido
   ================================================================ */
.fab-cart {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 608px;

  display: none; /* flex when cart has items */
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;

  background: var(--cherry);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 16px 28px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  box-shadow: 0 8px 28px rgba(214,51,75,.38);
  z-index: 100;
  transition: transform .2s, box-shadow .2s;
}
.fab-cart:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 12px 36px rgba(214,51,75,.45);
}
.fab-cart:active { transform: translateX(-50%) scale(.97); }

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--cherry);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: .82rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

/* ================================================================
   VIEW HEADERS (Summary / Confirmation)
   ================================================================ */
.view-header {
  text-align: center;
  padding: 70px 24px 28px;
}

.view-title {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--ink-900);
}
.view-title--success { color: var(--leaf-600); }

.view-subtitle {
  margin-top: 10px;
  font-size: .95rem;
  color: var(--ink-600);
}

/* ================================================================
   ORDER CARD (Summary View)
   ================================================================ */
.order-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(27,27,27,.09);
  gap: 12px;
}
.order-row:last-child { border-bottom: none; }

.item-info { flex: 1; min-width: 0; }

.order-item-name {
  font-weight: 700;
  font-size: .95rem;
  display: block;
}

.order-item-sub {
  font-size: .82rem;
  color: var(--ink-600);
  margin-top: 2px;
  display: block;
}

.order-total-bar {
  background: var(--ink-900);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-total-label {
  font-family: 'Fraunces', serif;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
}

.order-total-value {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -.02em;
}

/* ================================================================
   BUTTONS (full-width, view actions)
   ================================================================ */
.btn-full {
  display: block;
  width: 100%;
  cursor: pointer;
  padding: 16px 20px;
  border: none;
  border-radius: var(--r-pill);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  transition: opacity .2s, transform .1s;
  text-align: center;
  min-height: 52px;
  touch-action: manipulation;
}
.btn-full:active { transform: scale(.98); }

.btn-dark     { background: var(--ink-900); color: #fff; }
.btn-cherry   { background: var(--cherry);  color: #fff; box-shadow: 0 4px 16px rgba(214,51,75,.28); }
.btn-muted    { background: rgba(27,27,27,.08); color: var(--ink-900); }
.btn-whatsapp { background: #25D366; color: #fff; box-shadow: 0 4px 16px rgba(37,211,102,.30); }

/* Quick-add (+) para drinks sem fruta */
.btn-quick-add {
  flex-shrink: 0;
  cursor: pointer;
  background: var(--leaf-600);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
  touch-action: manipulation;
}
.btn-quick-add:hover  { background: var(--leaf-400); }
.btn-quick-add:active { transform: scale(.88); }

.btn-remove {
  cursor: pointer;
  background: none;
  border: 1.5px solid var(--cherry);
  color: var(--cherry);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-family: 'Manrope', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  touch-action: manipulation;
  transition: background .15s, color .15s;
}
.btn-remove:hover { background: var(--cherry); color: #fff; }

.btn-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* ================================================================
   PIX CARD (Confirmation View)
   ================================================================ */
.pix-total-block {
  text-align: center;
  margin: 28px 0 20px;
}

.pix-total-label {
  font-size: .88rem;
  color: var(--ink-600);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pix-total-value {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  letter-spacing: -.03em;
  color: var(--ink-900);
}

.pix-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-card);
  padding: 28px 22px;
  text-align: center;
  margin: 0 0 24px;
}

.pix-card-label {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-600);
  margin-bottom: 14px;
  display: block;
}

.pix-key {
  background: var(--sun-100);
  border: 2px dashed var(--leaf-600);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .04em;
  word-break: break-all;
  color: var(--ink-900);
  margin-bottom: 16px;
}

.btn-copy {
  cursor: pointer;
  background: var(--leaf-600);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 10px 24px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  transition: background .15s;
  touch-action: manipulation;
}
.btn-copy:hover { background: var(--leaf-400); }

.copy-feedback {
  display: none;
  font-size: .85rem;
  color: var(--leaf-600);
  font-weight: 700;
  margin-top: 10px;
}

.confirm-note {
  font-style: italic;
  color: var(--ink-600);
  font-size: .88rem;
  text-align: center;
  margin: 16px 0 24px;
  line-height: 1.6;
}

/* ================================================================
   MODAL (bottom sheet on mobile)
   ================================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27,27,27,.55);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal-card {
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 36px 26px 48px;
  width: 100%;
  max-width: 640px;
  text-align: center;
  animation: slideUp .28s cubic-bezier(.22,.68,0,1.2);
}

.modal-drink-name {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(1.5rem, 6vw, 2rem);
  letter-spacing: -.025em;
  margin-bottom: 4px;
  line-height: 1.1;
}

.modal-drink-price {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink-600);
  margin-bottom: 0;
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 26px 0 32px;
}

.qty-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--ink-900);
  background: transparent;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  touch-action: manipulation;
  line-height: 1;
}
.qty-circle:hover { background: var(--ink-900); color: #fff; }
.qty-circle:active { transform: scale(.9); }

.qty-value {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 2.25rem;
  min-width: 44px;
  text-align: center;
  letter-spacing: -.02em;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  text-align: center;
  padding: 12px 0 32px;
}

.admin-link {
  color: rgba(27,27,27,.28);
  font-size: .72rem;
  text-decoration: none;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s;
}
.admin-link:hover { color: rgba(27,27,27,.55); }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ================================================================
   MODAL — SEÇÕES EXTRAS (Opcionais + Monte seu copo)
   ================================================================ */
.modal-card {
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-section {
  text-align: left;
  border-top: 1px solid rgba(27,27,27,.10);
  margin-top: 20px;
  padding-top: 16px;
}

.modal-section-title {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-600);
  margin-bottom: 12px;
}

/* Checkboxes de opcionais */
.opcionais-check-list { display: flex; flex-direction: column; gap: 4px; }

.opcional-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
}
.opcional-check-row:hover { background: rgba(27,27,27,.04); }

.opcional-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--leaf-600);
  flex-shrink: 0;
  cursor: pointer;
}

.opcional-check-nome {
  flex: 1;
  font-weight: 600;
  font-size: .92rem;
}

.opcional-check-preco {
  font-family: 'Fraunces', serif;
  font-size: .85rem;
  color: var(--leaf-600);
  font-weight: 700;
  white-space: nowrap;
}

/* Chips de fruta */
.frutas-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fruta-chip {
  cursor: pointer;
  background: var(--paper);
  border: 1.5px solid var(--ink-900);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--ink-900);
  transition: background .15s, color .15s, border-color .15s;
  touch-action: manipulation;
}
.fruta-chip:hover { background: rgba(27,27,27,.06); }

.fruta-chip--selecionada {
  background: var(--leaf-600);
  border-color: var(--leaf-600);
  color: #fff;
}

.fruta-chip--desabilitada {
  opacity: .35;
  cursor: not-allowed;
}

.frutas-aviso {
  font-size: .85rem;
  color: var(--ink-600);
  font-style: italic;
}

/* Subtotal no modal */
.modal-subtotal {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  color: var(--ink-600);
  margin: 0 0 24px;
  text-align: center;
}
.modal-subtotal strong {
  color: var(--ink-900);
  font-size: 1.2rem;
}

/* Botão desabilitado */
#modal-add-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Extras no resumo do pedido */
.order-item-extras {
  display: block;
  font-size: .78rem;
  color: var(--ink-600);
  margin-top: 2px;
  line-height: 1.5;
}

/* ================================================================
   CONTROLES DE QTD NO RESUMO
   ================================================================ */
.qty-mini-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qty-mini-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-900);
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .12s, color .12s;
  touch-action: manipulation;
}
.qty-mini-btn:hover  { background: var(--ink-900); color: #fff; }
.qty-mini-btn:active { transform: scale(.88); }

.qty-mini-val {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.05rem;
  min-width: 20px;
  text-align: center;
}

/* ================================================================
   CAMPO NOME DO CLIENTE
   ================================================================ */
.name-field {
  display: block;
  margin: 20px 0 8px;
}

.name-field-label {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-600);
  margin-bottom: 8px;
}

.name-input {
  width: 100%;
  padding: 14px 18px;
  border: var(--border);
  border-radius: var(--r-card);
  background: var(--paper);
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-900);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.name-input:focus {
  border-color: var(--leaf-600);
  box-shadow: 0 0 0 3px rgba(47,110,63,.15);
}
.name-input::placeholder { color: rgba(27,27,27,.35); }

/* ================================================================
   CÓDIGO DO PEDIDO (CONFIRMAÇÃO)
   ================================================================ */
.order-code-pill {
  display: inline-block;
  margin-top: 14px;
  background: var(--ink-900);
  color: var(--sun-100);
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: .12em;
  padding: 8px 22px;
  border-radius: var(--r-pill);
}
.order-code-pill:empty { display: none; }

/* ================================================================
   RESUMO COMPACTO NA CONFIRMAÇÃO
   ================================================================ */
.confirm-summary {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--r-card);
  padding: 16px 18px;
  margin: 0 0 20px;
}
.confirm-summary:empty { display: none; }

.cs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(27,27,27,.07);
  font-size: .88rem;
}
.cs-row:last-child { border-bottom: none; }

.cs-name { flex: 1; font-weight: 600; }
.cs-extras { font-weight: 400; color: var(--ink-600); font-size: .82rem; }
.cs-val  { font-family: 'Fraunces', serif; font-weight: 700; white-space: nowrap; }

/* ================================================================
   QR CODE PIX
   ================================================================ */
.pix-qr-canvas {
  display: block;
  margin: 0 auto 16px;
  border-radius: 12px;
  border: 2px solid var(--ink-900);
  background: var(--paper);
}

/* ================================================================
   BADGE DO CARRINHO — PULSO
   ================================================================ */
@keyframes badge-pulse {
  0%   { transform: scale(1); background: #fff; color: var(--cherry); }
  40%  { transform: scale(1.5); background: var(--sun-100); color: var(--ink-900); }
  100% { transform: scale(1); background: #fff; color: var(--cherry); }
}
.cart-badge--pulse {
  animation: badge-pulse .4s ease both;
}

/* ================================================================
   CONFETE TROPICAL
   ================================================================ */
.confete-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confete-piece {
  position: absolute;
  top: -40px;
  animation: confete-drop linear forwards;
}

@keyframes confete-drop {
  0%   { top: -40px; transform: rotate(0deg) translateX(0); opacity: 1; }
  80%  { opacity: 1; }
  100% { top: 110vh;  transform: rotate(var(--rot)) translateX(15px); opacity: 0; }
}

/* ================================================================
   EMPTY STATE NO CARRINHO
   ================================================================ */
.empty-state--cart {
  padding: 24px 16px;
  font-style: italic;
  color: var(--ink-600);
  text-align: center;
}

/* ================================================================
   DESKTOP (>= 768px)
   ================================================================ */
@media (min-width: 768px) {
  .client-container { padding: 0 32px 150px; }
  .brand-name { font-size: 5.5rem; }
  .leaf-corner--tl,
  .leaf-corner--tr { width: 210px; }
  .leaf-corner--bl { width: 150px; }
  .modal { align-items: center; }
  .modal-card {
    border-radius: 22px;
    max-width: 440px;
    margin: 0 auto;
  }
}
