/* ═══════════════════════════════════════════════════════════════════
   sacola.css — Boi na Brasa
   Design system: sacola drawer, sacola bar, tokens
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --br:         #e8000a;
  --br-dark:    #c50008;
  --br-light:   #fff0f0;
  --surface:    #ffffff;
  --page:       #f5f5f5;
  --text-1:     #111827;
  --text-2:     #4b5563;
  --text-3:     #9ca3af;
  --border:     #e5e7eb;
  --green:      #15803d;
  --green-bg:   #f0fdf4;
  --r-sm:       8px;
  --r-md:       14px;
  --r-lg:       20px;
  --r-pill:     999px;
  --sh-sm:      0 1px 4px rgba(0,0,0,.08);
  --sh-md:      0 4px 20px rgba(0,0,0,.12);
  --sh-lg:      0 8px 40px rgba(0,0,0,.18);
}

/* ── Overlay ─────────────────────────────────────────────────────── */
.sacola-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sacola-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer ──────────────────────────────────────────────────────── */
.sacola-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 100vw);
  background: var(--surface);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--sh-lg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
.sacola-drawer.open {
  transform: translateX(0);
}

/* Header */
.sacola-header {
  display: flex;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 14px;
}
.sacola-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--page);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.sacola-close:hover { background: var(--border); color: var(--text-1); }
.sacola-close svg { width: 20px; height: 20px; }
.sacola-header__info { flex: 1; min-width: 0; }
.sacola-header__title {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}
.sacola-header__count {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 400;
}

/* Body */
.sacola-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px;
}

/* Empty state */
.sacola-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 8px;
}
.sacola-empty__icon { font-size: 60px; line-height: 1; opacity: .35; margin-bottom: 8px; }
.sacola-empty__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}
.sacola-empty__sub { font-size: 14px; color: var(--text-3); }
.sacola-empty__link {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--br);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 10px 22px;
  border: 2px solid var(--br);
  border-radius: var(--r-pill);
  transition: all .2s;
}
.sacola-empty__link:hover { background: var(--br); color: #fff; }

/* Items */
.sacola-items { padding: 8px 0 16px; }

.sacola-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.sacola-item:last-child { border-bottom: none; }

.sacola-item__info { flex: 1; min-width: 0; }
.sacola-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.35;
  margin-bottom: 2px;
}
.sacola-item__complements {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.4;
  margin-top: 4px;
}
.sacola-item__unit-price {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.sacola-item__subtotal {
  font-size: 15px;
  font-weight: 700;
  color: var(--br);
  margin-top: 8px;
  display: inline-block;
}

.sacola-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}
.sacola-item__del {
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-3);
  font-size: 19px;
  line-height: 1;
  transition: color .2s;
  display: flex;
}
.sacola-item__del:hover { color: var(--br); }

/* Qty control */
.sacola-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
  height: 36px;
}
.sacola-qty__btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--br);
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
  line-height: 1;
}
.sacola-qty__btn:hover { background: var(--br-light); }
.sacola-qty__btn:disabled { color: var(--border); cursor: not-allowed; }
.sacola-qty__val {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  user-select: none;
}

/* Footer */
.sacola-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  background: var(--surface);
}
.sacola-totals { margin-bottom: 14px; }
.sacola-totals__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-2);
}
.sacola-totals__row--main {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.sacola-totals__row--main span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.sacola-totals__row--main span:last-child {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
}
.sacola-totals__note {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}
.sacola-totals__note i { color: var(--text-3); }
.sacola-totals__free { color: var(--green); font-weight: 600; }

.sacola-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 22px;
  background: var(--br);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
  gap: 8px;
  font-family: inherit;
}
.sacola-cta:hover { background: var(--br-dark); }
.sacola-cta:active { transform: scale(.985); }
.sacola-cta__label { flex: 1; text-align: left; }
.sacola-cta__total {
  background: rgba(255,255,255,.2);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Bottom Bar ──────────────────────────────────────────────────── */
.sacola-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1039;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  transform: translateY(120%);
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
.sacola-bar.visible {
  transform: translateY(0);
  pointer-events: auto;
}
.sacola-bar__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--br);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(232,0,10,.45);
  transition: background .2s, transform .1s, box-shadow .2s;
  font-family: inherit;
  gap: 8px;
}
.sacola-bar__btn:hover {
  background: var(--br-dark);
  box-shadow: 0 8px 30px rgba(232,0,10,.5);
}
.sacola-bar__btn:active { transform: scale(.98); }

.sacola-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sacola-bar__badge {
  background: #fff;
  color: var(--br);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 26px;
}
.sacola-bar__icon { font-size: 18px; }
.sacola-bar__label { font-size: 15px; }
.sacola-bar__total {
  background: rgba(255,255,255,.18);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
