/* ============================================================
   BIBI FOOD — style.css
   Bootstrap 5.3 + Custom Design System
   ============================================================ */

/* ── Design Tokens (Bibi Food Brand System) ─────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Inter:wght@400;600;700&display=swap');

:root {
  --dm-moss:       #7E8420; /* Verde Musgo */
  --dm-moss-dark:  #5e6216;
  --dm-moss-light: #9fa636;
  --dm-orange:     #EE7C13; /* Laranja */
  --dm-orange-dark:#c96204;
  --dm-beige:      #EDDDCC; /* Bege */
  
  /* Mapping legacy variables to keep codebase intact and easily branded */
  --dm-red:        var(--dm-moss);
  --dm-red-dark:   var(--dm-moss-dark);
  --dm-red-light:  var(--dm-orange);
  --dm-gold:       var(--dm-orange);
  --dm-warm:       #fcf8f3;
  --dm-bg:         #fbf7f2;
  --dm-surface:    #ffffff;
  --dm-text:       #3e3830; /* Soft dark brown instead of hard black */
  --dm-muted:      #8a7d6e;
  --dm-border:     #e6dfd5;
  --dm-shadow:     0 4px 15px rgba(126, 132, 32, 0.06);
  --dm-radius:     16px;
  --dm-radius-sm:  10px;
  --dm-font-brand: 'Fredoka', 'Playfair Display', Georgia, serif;
  --dm-font-body:  'Inter', 'Nunito', system-ui, sans-serif;
  --dm-transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--dm-font-body);
  background: var(--dm-bg);
  color: var(--dm-text);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────── */
.dm-header {
  background: var(--dm-surface);
  border-bottom: 2px solid var(--dm-border);
  z-index: 1030;
}

.dm-logo-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--dm-border);
  background-color: var(--dm-surface);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dm-logo-img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.dm-brand {
  font-family: var(--dm-font-brand);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--dm-red);
  line-height: 1;
  letter-spacing: -.5px;
}
.dm-tagline {
  font-size: .7rem;
  color: var(--dm-muted);
  letter-spacing: .5px;
}

.dm-btn-cart {
  background: var(--dm-warm);
  border: none;
  border-radius: 50%;
  width: 42px; height: 42px;
  padding: 0;
  color: var(--dm-red);
  transition: background var(--dm-transition);
}
.dm-btn-cart:hover { background: var(--dm-red); color: #fff; }

.dm-cart-badge { font-size: .65rem; }

.dm-badge-open  { background: #27ae60; font-size: .7rem; }
.dm-badge-closed{ background: #95a5a6; font-size: .7rem; }

/* ── Hero ───────────────────────────────────────────────────── */
.dm-hero {
  position: relative;
  background: linear-gradient(135deg, var(--dm-moss-dark) 0%, var(--dm-moss) 50%, var(--dm-orange) 100%);
  overflow: hidden;
}
.dm-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.dm-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.3));
}
.dm-hero-title {
  font-family: var(--dm-font-brand);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
  margin: 0;
}
.dm-hero-sub {
  font-size: .9rem;
  opacity: .9;
  letter-spacing: .5px;
}
.dm-info-pill {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .78rem;
  font-weight: 600;
}

/* ── Search ─────────────────────────────────────────────────── */
.dm-search-wrap { position: relative; }
.dm-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--dm-muted); font-size: 1rem; pointer-events: none;
}
.dm-search {
  padding-left: 2.5rem;
  border-radius: 999px;
  border: 2px solid var(--dm-border);
  background: var(--dm-surface);
  height: 44px;
  font-size: .9rem;
}
.dm-search:focus {
  border-color: var(--dm-red);
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}

/* ── Category Nav ───────────────────────────────────────────── */
.dm-cat-nav {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .5rem;
}
.dm-cat-nav::-webkit-scrollbar { display: none; }

.dm-cat-btn {
  flex-shrink: 0;
  background: var(--dm-surface);
  border: 2px solid var(--dm-border);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  font-family: var(--dm-font-body);
  color: var(--dm-muted);
  transition: all var(--dm-transition);
  cursor: pointer;
  white-space: nowrap;
}
.dm-cat-btn:hover,
.dm-cat-btn.active {
  background: var(--dm-red);
  border-color: var(--dm-red);
  color: #fff;
}

/* ── Section Title ──────────────────────────────────────────── */
.dm-section-title {
  font-family: var(--dm-font-brand);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dm-text);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--dm-border);
}

/* ── Product Card ───────────────────────────────────────────── */
.dm-card {
  border: none;
  border-radius: var(--dm-radius);
  box-shadow: var(--dm-shadow);
  background: var(--dm-surface);
  cursor: pointer;
  transition: transform var(--dm-transition), box-shadow var(--dm-transition);
  overflow: hidden;
}
.dm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(192,57,43,.2);
}

.dm-card-img-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: #f0e6d8;
}
.dm-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.dm-card:hover .dm-card-img { transform: scale(1.05); }

.dm-badge-destaque {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--dm-gold);
  color: #fff;
  font-size: .65rem;
  border-radius: 999px;
  padding: .25rem .6rem;
}

.dm-card-title {
  font-family: var(--dm-font-brand);
  font-size: .95rem;
  font-weight: 700;
  color: var(--dm-text);
}
.dm-card-desc {
  font-size: .78rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dm-preco {
  font-size: 1rem;
  font-weight: 800;
  color: var(--dm-red);
  font-family: var(--dm-font-brand);
}

.dm-btn-add {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--dm-red);
  color: #fff;
  border: none;
  padding: 0;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dm-transition), transform .15s;
}
.dm-btn-add:hover { background: var(--dm-red-dark); transform: scale(1.1); }
.dm-btn-add:active { transform: scale(.95); }

/* ── Offcanvas Carrinho ─────────────────────────────────────── */
.dm-offcanvas {
  width: min(400px, 100vw) !important;
  border-radius: var(--dm-radius) 0 0 var(--dm-radius);
}
.dm-offcanvas-header {
  background: var(--dm-red);
  color: #fff;
  padding: 1.1rem 1.25rem;
}
.dm-offcanvas-header .offcanvas-title { font-family: var(--dm-font-brand); font-size: 1.15rem; }

/* Item carrinho */
.dm-cart-item {
  background: var(--dm-warm);
  border-radius: var(--dm-radius-sm);
  padding: .75rem;
  margin-bottom: .6rem;
  border: 1px solid var(--dm-border);
}
.dm-cart-item-name { font-weight: 700; font-size: .9rem; }
.dm-cart-item-price { color: var(--dm-red); font-weight: 800; font-size: .9rem; }

.dm-qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--dm-border);
  background: #fff;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dm-transition);
}
.dm-qty-btn:hover { border-color: var(--dm-red); color: var(--dm-red); }

/* ── Botão Finalizar ────────────────────────────────────────── */
.dm-btn-finalizar {
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .75rem;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .3px;
  transition: background var(--dm-transition), transform .15s;
}
.dm-btn-finalizar:hover { background: #1da851; color: #fff; transform: translateY(-1px); }
.dm-btn-finalizar:active { transform: translateY(0); }

/* ── Modal Produto ──────────────────────────────────────────── */
.dm-modal { border-radius: var(--dm-radius); overflow: hidden; }
.dm-modal-img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--dm-radius-sm); }
.dm-modal-title { font-family: var(--dm-font-brand); font-size: 1.4rem; font-weight: 900; }
.dm-modal-preco { color: var(--dm-red); font-size: 1.3rem; font-weight: 800; font-family: var(--dm-font-brand); }

/* Adicional checkbox card */
.dm-adicional-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .75rem;
  border: 1.5px solid var(--dm-border);
  border-radius: var(--dm-radius-sm);
  cursor: pointer;
  background-color: #ffffff;
  transition: all var(--dm-transition);
  margin-bottom: .4rem;
  position: relative;
}
.dm-adicional-item:hover { border-color: var(--dm-red); }
.dm-adicional-item.selected { 
  border-color: var(--dm-red); 
  background: #fdf0ee; 
  padding-left: 2.5rem;
}
.dm-adicional-item.selected::before {
  content: '\F26A'; /* bootstrap icon check-circle-fill */
  font-family: "bootstrap-icons";
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--dm-red);
  font-size: 1.2rem;
  opacity: 0.9;
}


/* ── FAB WhatsApp ───────────────────────────────────────────── */
.dm-fab-whatsapp {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 54px; height: 54px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37,211,102,.4);
  z-index: 999;
  transition: transform var(--dm-transition), box-shadow var(--dm-transition);
}
.dm-fab-whatsapp:hover {
  transform: scale(1.08);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37,211,102,.5);
}

/* ── Footer ─────────────────────────────────────────────────── */
.dm-footer {
  background: var(--dm-surface);
  border-top: 2px solid var(--dm-border);
}

/* ── Animações ──────────────────────────────────────────────── */
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.dm-product-wrap { animation: slideInUp .35s ease both; }

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 576px) {
  .dm-hero-title { font-size: 1.4rem; }
  .dm-card-img-wrap { height: 140px; }
}

/* ── Utilitários ────────────────────────────────────────────── */
.fs-xs { font-size: .55rem !important; }
.fw-800 { font-weight: 800 !important; }
