/* === GLOBAL RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #161616; }
::-webkit-scrollbar-thumb { background: #3a3737; border-radius: 99px; }
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* === NAVBAR — always dark so hamburger always visible === */
#navbar {
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
#navbar.scrolled {
  background: rgba(13, 13, 13, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

/* === MARQUEE === */
.marquee-track {
  animation: marquee 22s linear infinite;
  display: flex;
  white-space: nowrap;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* === FADE IN UP ANIMATION === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

/* === PRODUCT CARD === */
.product-card {
  background: #1E1C1C;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border-color: rgba(232, 38, 26, 0.3);
}
.product-card .card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.product-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .card-img img {
  transform: scale(1.06);
}
.product-card .card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* === QTY SELECTOR === */
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.15s;
  user-select: none;
  cursor: pointer;
  line-height: 1;
}
.qty-btn:hover { border-color: #E8261A; color: #E8261A; }

/* === CATEGORY PILL === */
.cat-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12);
  color: #9ca3af;
  transition: all 0.2s;
}
.cat-pill:hover { border-color: rgba(232,38,26,0.5); color: #E8261A; }
.cat-pill.active { background: #E8261A; border-color: #E8261A; color: white; }

/* === DEAL CARD === */
.deal-card {
  background: linear-gradient(135deg, #1E1C1C 0%, #252222 100%);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border-color: rgba(245,166,35,0.5);
}
.deal-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: #E8261A;
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
}

/* === ADD BUTTON === */
.add-btn {
  background: #E8261A;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}
.add-btn:hover { background: #C41A10; transform: scale(1.03); }
.add-btn:active { transform: scale(0.97); }

/* === CART ITEM === */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cart-item img {
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* === SECTION TRANSITIONS === */
.menu-section {
  animation: fadeInUp 0.5s ease forwards;
}

/* === TOAST === */
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === RESPONSIVE GRID === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* === MOBILE NAV LINKS === */
.mobile-nav-link {
  display: block;
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 500;
  color: #d1d5db;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.mobile-nav-link:hover { color: #E8261A; }

/* === HAMBURGER ANIMATION === */
#hamburgerBtn.open #hb1 {
  transform: translateY(7px) rotate(45deg);
}
#hamburgerBtn.open #hb2 {
  opacity: 0;
  transform: scaleX(0);
}
#hamburgerBtn.open #hb3 {
  transform: translateY(-7px) rotate(-45deg);
}
#hamburgerBtn.open {
  border-color: #E8261A;
}

/* === MOBILE MENU ANIMATION === */
#mobileMenu {
  transition: opacity 0.2s ease;
}


#checkoutModal {
  align-items: center;
}
#checkoutModal.flex { display: flex !important; }

/* === STAGGERED CARD ANIMATION === */
.product-card {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

/* === MOBILE CARD BOTTOM FIX === */
@media (max-width: 479px) {
  .product-card .card-body {
    padding: 8px 9px 10px;
    gap: 4px;
  }
  .product-card .card-body h3 {
    font-size: 11px;
    line-height: 1.3;
  }
  .product-card .card-body p {
    display: none; /* hide desc on very small cards */
  }
  /* Stack price on top, qty+add below */
  .card-bottom {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 4px;
  }
  .card-bottom .card-price-row {
    display: flex;
    justify-content: flex-start;
  }
  .card-bottom .card-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
  }
  .card-bottom .card-actions .qty-group {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    overflow: hidden;
  }
  .card-bottom .card-actions .qty-group button {
    width: 26px; height: 26px;
    background: transparent;
    border: none;
    color: #d1d5db;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .card-bottom .card-actions .qty-group span {
    font-size: 12px;
    font-weight: 700;
    color: white;
    width: 18px;
    text-align: center;
  }
  .card-bottom .card-actions .add-btn {
    flex: 1;
    padding: 7px 6px;
    font-size: 11px;
    border-radius: 8px;
    white-space: nowrap;
  }
}

/* Tablet and above — original single-row layout */
@media (min-width: 480px) {
  .card-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 2px;
  }
  .card-bottom .card-price-row {}
  .card-bottom .card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .card-bottom .card-actions .qty-group {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
  }
  .card-bottom .card-actions .qty-group button {
    width: 28px; height: 28px;
    background: transparent;
    border: none;
    color: #d1d5db;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .card-bottom .card-actions .qty-group button:hover { color: #E8261A; }
  .card-bottom .card-actions .qty-group span {
    font-size: 13px;
    font-weight: 700;
    color: white;
    width: 20px;
    text-align: center;
  }
  .card-bottom .card-actions .add-btn {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 9px;
  }
}
