@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;600;700&family=Poppins:wght@400;600;700;800&display=swap');

:root {
  --primary: #ff7a00;
  --primary-gradient: linear-gradient(135deg, #ff7a00, #ff3d00);
  --secondary: #0984e3;
  --secondary-gradient: linear-gradient(135deg, #0984e3, #00cec9);
  --bg-color: #f5f6fa;
  --card-bg: #ffffff;
  --text-dark: #2d3436;
  --text-light: #636e72;
  --gold: #ff7a00;
  --danger: #e74c3c;
  --success: #00b894;
  --shadow-soft: 0 8px 20px rgba(0,0,0,0.06);
  --shadow-3d: 6px 6px 12px rgba(163,177,198,0.4), -6px -6px 12px rgba(255,255,255,0.9);
  --shadow-hover: 10px 10px 18px rgba(163,177,198,0.5), -10px -10px 18px rgba(255,255,255,0.95);
  --shadow-inner: inset 4px 4px 8px rgba(163,177,198,0.4), inset -4px -4px 8px rgba(255,255,255,0.9);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin:0; padding:0; box-sizing:border-box; font-family: 'Hind Siliguri', 'Poppins', sans-serif; -webkit-tap-highlight-color:transparent; }

body {
  background: var(--bg-color);
  color: var(--text-dark);
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding-bottom: 75px; /* for bottom nav */
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #e0e0e0; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* ========== MARQUEE ========== */
.marquee-container {
  background: var(--primary-gradient);
  color: #fff;
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-text {
  display: inline-block;
  animation: marquee 20s linear infinite;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
}
@keyframes marquee {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ========== NAVBAR ========== */
.navbar {
  display: flex; justify-content: center; align-items: center;
  padding: 12px 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  position: sticky; top: 0; z-index: 100;
  border-radius: 0 0 22px 22px;
  margin-bottom: 6px;
  transition: var(--transition);
}
.logo {
  font-size: 22px; font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}
.nav-actions { position: absolute; right: 20px; display: flex; align-items: center; gap: 10px; }
#login-btn {
  padding: 8px 18px; background: var(--primary-gradient); color: #fff;
  border: none; border-radius: 20px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,122,0,0.3); transition: var(--transition); font-size: 13px;
}
#login-btn:hover { box-shadow: 0 6px 18px rgba(255,122,0,0.5); transform: translateY(-2px); }
#user-profile { display: none; align-items: center; cursor: pointer; position: relative; }
#user-img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--primary); box-shadow: var(--shadow-3d); object-fit: cover; }
.profile-dropdown {
  position: absolute; top: 48px; right: 0; background: var(--card-bg); border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15); padding: 6px 0; min-width: 210px;
  display: none; flex-direction: column; z-index: 150;
}
.profile-dropdown.active { display: flex; }
.dropdown-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #eee; }
.dropdown-header img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--primary); }
.d-name { font-weight: 800; font-size: 14px; color: var(--text-dark); }
.d-email { font-size: 11px; color: var(--text-light); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--text-dark); transition: 0.2s;
  border: none; background: none; width: 100%; text-align: left; text-decoration: none;
}
.dropdown-item:hover { background: #f0f0f0; }
.dropdown-item i { width: 20px; text-align: center; }
.logout-item { color: var(--danger); border-top: 1px solid #eee; }
.nav-icon-btn {
  position: relative; font-size: 20px; color: var(--primary); width: 42px; height: 42px;
  display: flex; justify-content: center; align-items: center; border-radius: 50%;
  background: var(--card-bg); box-shadow: var(--shadow-3d); cursor: pointer; transition: var(--transition);
  border: none; text-decoration: none;
}
.nav-icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ========== BACK BUTTON ========== */
.btn-back {
  display: none; margin: 8px 20px;
  background: var(--card-bg); border: none; color: var(--primary);
  padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 700;
  box-shadow: var(--shadow-3d); transition: var(--transition);
}
.btn-back:hover { box-shadow: var(--shadow-hover); }

/* ========== CATEGORY & PRODUCT GRIDS ========== */
.category-grid, .product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; padding: 20px;
}
.category-card, .product-card {
  background: var(--card-bg); padding: 20px 14px; border-radius: 22px;
  text-align: center; box-shadow: var(--shadow-3d); transition: var(--transition);
  cursor: pointer; position: relative; overflow: hidden;
}
.category-card:hover, .product-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-hover);
}
.category-card::before, .product-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: var(--primary-gradient); transform: scaleX(0); transition: transform 0.3s ease;
}
.category-card:hover::before, .product-card:hover::before { transform: scaleX(1); }
.category-img, .product-img { font-size: 50px; margin-bottom: 10px; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.1)); }
.category-name, .product-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.category-desc { font-size: 12px; color: var(--text-light); }
.product-badge {
  position: absolute; top: 10px; left: 10px; background: var(--primary-gradient);
  color: #fff; font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 12px; z-index: 2;
}
.product-price { font-weight: 800; font-size: 18px; color: var(--primary); margin: 8px 0; }

/* ========== BUTTONS ========== */
.btn-main {
  background: var(--primary-gradient); color: #fff; border: none;
  width: 100%; padding: 12px 24px; border-radius: 18px; font-weight: 800;
  cursor: pointer; transition: var(--transition); font-size: 14px;
  box-shadow: 0 6px 15px rgba(255,122,0,0.3);
}
.btn-main:hover { box-shadow: 0 8px 22px rgba(255,122,0,0.5); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: 14px; width: auto; }
.btn-secondary {
  background: var(--secondary-gradient); color: #fff; border: none;
  width: 100%; padding: 12px 24px; border-radius: 18px; font-weight: 800;
  cursor: pointer; transition: var(--transition);
}
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }

/* ========== ORDER MODAL ========== */
.order-modal-content { text-align: center; }
.order-modal-content h3 { margin-bottom: 6px; }
.order-modal-content .order-price { font-size: 24px; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.order-modal-content input, .order-modal-content select {
  margin: 8px 0; background: #f5f5f5; border: 2px solid transparent;
  border-radius: 12px; padding: 12px; width: 100%; font-size: 14px;
  color: var(--text-dark); box-shadow: var(--shadow-inner);
}
.order-modal-content input:focus, .order-modal-content select:focus { border-color: var(--primary); outline: none; }
.payment-info {
  background: #fff3e0; padding: 12px; border-radius: 12px; margin: 10px 0;
  font-size: 13px; font-weight: 700; color: #e65100;
}
.copy-btn {
  background: var(--card-bg); border: none; padding: 6px 12px; border-radius: 8px;
  font-weight: 700; cursor: pointer; color: var(--primary); box-shadow: var(--shadow-3d);
  margin-left: 8px; font-size: 12px;
}

/* ========== FORM CONTROLS ========== */
.form-control {
  width: 100%; padding: 12px 15px; border: 2px solid transparent;
  background: #f5f5f5; border-radius: 12px; outline: none;
  font-size: 14px; font-weight: 600; color: var(--text-dark);
  box-shadow: var(--shadow-inner); transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); background: #fff; }
select.form-control {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 35px;
}

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; justify-content: center; align-items: center; z-index: 1000;
  opacity: 0; transition: 0.3s;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-box {
  background: var(--card-bg); width: 92%; max-width: 440px; padding: 24px 20px;
  border-radius: 22px; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  position: relative; transform: scale(0.8); transition: 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  max-height: 85vh; overflow-y: auto;
}
.modal-overlay.active .modal-box { transform: scale(1); }
.wide-modal { max-width: 600px; }
.close-btn {
  position: absolute; top: 10px; right: 10px; font-size: 18px;
  background: #f0f0f0; border: none; width: 34px; height: 34px;
  border-radius: 50%; display: flex; justify-content: center; align-items: center;
  cursor: pointer; color: var(--text-light); transition: var(--transition); z-index: 10;
}
.close-btn:hover { background: var(--danger); color: #fff; }

/* ========== AUTH TABS ========== */
.auth-tabs { display: flex; gap: 10px; margin-bottom: 20px; justify-content: center; }
.auth-tab {
  padding: 10px 20px; background: #f0f0f0; border: none; border-radius: 25px;
  font-weight: 700; cursor: pointer; color: var(--text-light); transition: var(--transition);
}
.auth-tab.active { background: var(--primary-gradient); color: #fff; box-shadow: 0 4px 12px rgba(255,122,0,0.3); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 12px;
  background: #f5f5f5; color: var(--text-dark); font-size: 14px;
}
.auth-form input:focus { border-color: var(--primary); outline: none; }
.auth-action-btn {
  background: var(--primary-gradient); color: #fff; border: none; padding: 12px;
  border-radius: 12px; font-weight: 800; cursor: pointer; transition: var(--transition);
}
.auth-link { font-size: 13px; text-align: center; color: var(--secondary); cursor: pointer; text-decoration: underline; }

/* ========== HISTORY ========== */
.history-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.history-filter-btn {
  padding: 7px 16px; border: 2px solid #ddd; background: var(--card-bg); color: var(--text-dark);
  border-radius: 20px; cursor: pointer; font-weight: 700; font-size: 12px; transition: var(--transition);
}
.history-filter-btn.active-filter { background: var(--primary-gradient); color: #fff; border-color: transparent; }
.history-search-input {
  width: 100%; padding: 12px 15px; border-radius: 25px; border: 2px solid #ddd;
  background: #f5f5f5; font-weight: 600; font-size: 14px; outline: none;
  color: var(--text-dark); margin-bottom: 12px; box-shadow: var(--shadow-inner);
}
.order-history-card {
  background: var(--card-bg); padding: 14px; border-radius: 16px; margin-bottom: 10px;
  cursor: pointer; box-shadow: var(--shadow-soft); transition: var(--transition);
  border-left: 4px solid var(--primary);
}
.order-history-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.order-status { padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: 11px; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-processing { background: #e3f2fd; color: #1565c0; }
.status-confirmed, .status-completed { background: #e8f5e9; color: #2e7d32; }
.status-cancelled { background: #ffebee; color: #c62828; }

/* ========== WALLET ========== */
#wallet-balance { font-size: 28px; }
#wallet-requests-list { margin-top: 10px; }
.wallet-request-item {
  background: #f9f9f9; padding: 10px; border-radius: 10px; margin-bottom: 8px;
  display: flex; justify-content: space-between; font-size: 13px;
}

/* ========== SUPPORT FAB ========== */
.support-wrapper {
  position: fixed; bottom: 85px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 900;
}
.s-btn {
  width: 46px; height: 46px; border-radius: 50%; display: flex; justify-content: center;
  align-items: center; background: var(--card-bg); color: var(--primary); font-size: 22px;
  text-decoration: none; box-shadow: var(--shadow-3d); transition: var(--transition);
}
.s-btn:hover { transform: scale(1.1); box-shadow: var(--shadow-hover); }
.s-btn.wa { color: #25D366; }
.s-btn.tg { color: #0088cc; }

/* ========== BOTTOM NAVIGATION BAR ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 20px 20px 0 0;
  z-index: 999;
  padding: 6px 0 8px;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: #b0b8c1; font-size: 11px; font-weight: 600;
  transition: color 0.3s ease, transform 0.2s ease; cursor: pointer; border: none; background: none;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active i { transform: scale(1.15); }
.bottom-nav-item:active { transform: scale(0.95); }

/* ========== ALERT ICON ========== */
.alert-icon-wrapper { width: 75px; height: 75px; border-radius: 50%; margin: 0 auto 12px; display: flex; justify-content: center; align-items: center; font-size: 36px; }
.alert-error { background: #ffebee; color: #c62828; }
.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-info { background: #e3f2fd; color: #1565c0; }

#custom-alert-modal { z-index: 2000 !important; }

/* ========== RESPONSIVE ========== */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .support-wrapper { bottom: 20px; }
}

@media (max-width: 480px) {
  .navbar { padding: 10px 12px; }
  .logo { font-size: 18px; }
  .category-grid, .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .category-card, .product-card { padding: 15px; }
  .category-img, .product-img { font-size: 42px; }
  .category-name, .product-title { font-size: 14px; }
  .product-price { font-size: 16px; }
}