:root { --brand:#0ea5e9; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  background:#f8fafc;
}

.topbar {
  background:var(--brand);
  color:#fff;
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position: sticky;
  top:0;
  z-index:40;
}

.brand a {
  color:#fff;
  font-weight:800;
  text-decoration:none;
  letter-spacing:.3px;
}

.nav a,
.nav button {
  color:#fff;
  margin-right:12px;
  text-decoration:none;
  background:none;
  border:none;
  cursor:pointer;
  font: inherit;
}

.nav a:hover,
.nav button:hover {
  text-decoration:underline;
}

.container {
  max-width: 980px;
  margin: 26px auto;
  padding: 0 14px;
}

.btn {
  background:var(--brand);
  border:none;
  color:#fff;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
}

.btn.secondary {
  background:#e5e7eb;
  color:#111827;
}

.card {
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
}

.mt-2 { margin-top:8px; }
.mt-4 { margin-top:16px; }
.mt-6 { margin-top:24px; }

.muted { color:#6b7280; }

/* Modal de login */
.modal-wrap {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.25);
  z-index:50;
}

.modal {
  max-width:420px;
  margin:10vh auto;
  background:#fff;
  border-radius:12px;
  padding:18px;
}

.input {
  padding:10px 12px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  width:100%;
}

.grid {
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

@media (min-width: 640px){
  .grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }
}

/* Floating Cart (bolha) */
.floating-cart {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  z-index: 99995;
  transition: all .2s ease-in-out;
  font-size: 15px;
}

.floating-cart:hover {
  transform: scale(1.05);
}

.fc-icon {
  font-size: 20px;
}

/* Backdrop do drawer */
.cart-overlay {
  position: fixed;
  inset:0;
  background: rgba(15,23,42,.55);
  opacity:0;
  pointer-events:none;
  transition: opacity .25s ease-in-out;
  z-index:99990;
}

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

/* Drawer estilo iFood */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  box-shadow: -3px 0 16px rgba(15,23,42,0.35);
  padding: 16px 16px 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease-in-out;
}

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

.cd-header {
  display: flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.cd-header-title {
  font-weight:700;
  font-size:18px;
  color:#111827;
}

.cd-close {
  background:none;
  border:none;
  font-size:22px;
  cursor:pointer;
  line-height:1;
  color:#6b7280;
}

.cd-store-hint {
  font-size:12px;
  color:#6b7280;
  margin-bottom:10px;
}

.cd-items {
  flex:1;
  overflow-y:auto;
  padding-right:4px;
  margin-bottom:10px;
}

.cd-item {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid #f3f4f6;
  font-size:14px;
}

.cd-thumb {
  width:56px;
  height:56px;
  border-radius:12px;
  overflow:hidden;
  background:#f3f4f6;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.cd-thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.cd-thumb-fallback {
  font-size:22px;
}

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

.cd-item-name {
  font-weight:500;
  color:#111827;
  margin-bottom:2px;
  word-break:break-word;
}

.cd-item-price {
  font-size:12px;
  color:#6b7280;
}

.cd-item-subtotal {
  font-size:12px;
  color:#111827;
  font-weight:600;
  margin-top:2px;
}

.cd-item-actions {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
  margin-left:4px;
}

.cd-qty {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
}

.cd-qty-btn {
  width:26px;
  height:26px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-size:16px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

.cd-remove {
  background:none;
  border:none;
  color:#9ca3af;
  font-size:14px;
  cursor:pointer;
  padding:0;
}

.cd-footer {
  border-top:1px solid #e5e7eb;
  padding-top:10px;
}

.cd-total-line {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:4px;
}

.cd-total-label {
  font-size:14px;
  color:#374151;
}

.cd-total-value {
  font-size:16px;
  font-weight:700;
  color:#111827;
}

.cd-summary {
  font-size:12px;
  color:#6b7280;
  margin-bottom:8px;
}

.cd-btn-main {
  width:100%;
  padding:12px 14px;
  font-size:15px;
  border-radius:999px;
}

@media (max-width: 480px){
  .cart-drawer{
    max-width:100%;
    border-radius:16px 0 0 16px;
  }
}
