@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 4px 15px rgba(0,0,0,0.06);
  --shadow-3d: 6px 6px 12px rgba(163,177,198,0.3), -6px -6px 12px rgba(255,255,255,0.9);
  --shadow-hover: 8px 8px 16px rgba(163,177,198,0.4), -8px -8px 16px rgba(255,255,255,0.95);
  --shadow-inner: inset 4px 4px 8px rgba(163,177,198,0.3), 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: 70px;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #e0e0e0; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

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

/* ========== NAVBAR - FIXED ========== */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 0 0 18px 18px;
  min-height: 52px;
  transition: var(--transition);
}
.logo {
  font-size: 20px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
  text-align: center;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-actions {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#login-btn {
  padding: 7px 14px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255,122,0,0.25);
  transition: var(--transition);
  font-size: 12px;
  white-space: nowrap;
}
#login-btn:hover {
  box-shadow: 0 5px 15px rgba(255,122,0,0.4);
  transform: translateY(-1px);
}

/* Profile Image Fix */
#user-profile {
  display: none;
  align-items: center;
  cursor: pointer;
  position: relative;
}
#user-img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-3d);
  object-fit: cover;
  background: #ffe0cc;
}
#user-img[src=""], #user-img:not([src]) {
  background: #ffe0cc url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="40" r="25" fill="%23ff7a00"/><ellipse cx="50" cy="95" rx="40" ry="30" fill="%23ff7a00"/></svg>') center/cover;
}

/* Profile Dropdown Fix */
.profile-dropdown {
  position: absolute;
  top: 44px;
  right: -5px;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 6px 0;
  min-width: 200px;
  display: none;
  flex-direction: column;
  z-index: 150;
  max-height: 60vh;
  overflow-y: auto;
}
.profile-dropdown.active { display: flex; }
.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}
.dropdown-header img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
  background: #ffe0cc;
}
.dropdown-header img[src=""], .dropdown-header img:not([src]) {
  background: #ffe0cc url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="40" r="25" fill="%23ff7a00"/><ellipse cx="50" cy="95" rx="40" ry="30" fill="%23ff7a00"/></svg>') center/cover;
}
.d-name { font-weight: 800; font-size: 13px; color: var(--text-dark); word-break: break-word; }
.d-email { font-size: 11px; color: var(--text-light); word-break: break-word; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  cursor: pointer; font-weight: 600; font-size: 12px; color: var(--text-dark);
  transition: 0.15s; border: none; background: none; width: 100%; text-align: left; text-decoration: none;
}
.dropdown-item:hover { background: #f5f5f5; }
.dropdown-item i { width: 18px; text-align: center; font-size: 14px; }
.logout-item { color: var(--danger); border-top: 1px solid #eee; }

.nav-icon-btn {
  position: relative; font-size: 18px; color: var(--primary); width: 36px; height: 36px;
  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 12px;
  background: var(--card-bg); border: none; color: var(--primary);
  padding: 7px 14px; border-radius: 18px; cursor: pointer; font-weight: 700;
  box-shadow: var(--shadow-3d); transition: var(--transition); font-size: 13px;
}
.btn-back:hover { box-shadow: var(--shadow-hover); }

/* ========== GRIDS - FIXED SPACING ========== */
.category-grid, .product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  padding: 12px;
}
.category-card, .product-card {
  background: var(--card-bg);
  padding: 16px 12px;
  border-radius: 18px;
  text-align: center;
  box-shadow: var(--shadow-3d);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
}
.category-card:hover, .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.category-card::before, .product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  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: 42px;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
  transition: var(--transition);
}
.category-card:hover .category-img, .product-card:hover .product-img {
  transform: scale(1.08);
}

.category-name, .product-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 2;
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,122,0,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,122,0,0); }
}
.product-price {
  font-weight: 800;
  font-size: 17px;
  color: var(--primary);
  margin: 6px 0;
}
.product-stock { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.stock-in { color: var(--success); }
.stock-out { color: var(--danger); }

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

.add-btn, .wishlist-btn-card {
  background: var(--card-bg);
  color: var(--primary);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-3d);
  transition: var(--transition);
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.add-btn:hover, .wishlist-btn-card:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}
.add-btn:active { box-shadow: var(--shadow-inner); transform: scale(0.94); }
.wishlist-btn-card.active { background: var(--primary); color: #fff; }
.card-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

/* ========== ORDER MODAL ========== */
.order-modal-content { text-align: center; }
.order-modal-content h3 { font-size: 18px; margin-bottom: 4px; }
.order-modal-content .order-price {
  font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 12px;
}
.order-modal-content input, .order-modal-content select {
  margin: 6px 0; background: #f5f5f5; border: 2px solid transparent;
  border-radius: 10px; padding: 10px; width: 100%; font-size: 13px;
  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: #fff8f0; padding: 10px; border-radius: 10px; margin: 8px 0;
  font-size: 12px; font-weight: 700; color: #e65100;
}
.payment-numbers { text-align: left; }
.copy-btn {
  background: var(--card-bg); border: none; padding: 5px 10px; border-radius: 6px;
  font-weight: 700; cursor: pointer; color: var(--primary); box-shadow: var(--shadow-3d);
  font-size: 11px;
}

/* ========== FORM CONTROLS ========== */
.form-control {
  width: 100%; padding: 10px 14px; border: 2px solid transparent;
  background: #f5f5f5; border-radius: 10px; outline: none;
  font-size: 13px; 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 12px center;
  padding-right: 32px;
}

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; justify-content: center; align-items: center; z-index: 1000;
  opacity: 0; transition: 0.25s;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-box {
  background: var(--card-bg); width: 92%; max-width: 420px; padding: 20px 16px;
  border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,0.15);
  position: relative; transform: scale(0.9); transition: 0.25s 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: 560px; }
.close-btn {
  position: absolute; top: 8px; right: 8px; font-size: 16px;
  background: #f0f0f0; border: none; width: 30px; height: 30px;
  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: 8px; margin-bottom: 16px; justify-content: center; }
.auth-tab {
  padding: 8px 18px; background: #f0f0f0; border: none; border-radius: 20px;
  font-weight: 700; cursor: pointer; color: var(--text-light); transition: var(--transition); font-size: 13px;
}
.auth-tab.active { background: var(--primary-gradient); color: #fff; box-shadow: 0 3px 10px rgba(255,122,0,0.25); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  width: 100%; padding: 10px; border: 2px solid #ddd; border-radius: 10px;
  background: #f5f5f5; color: var(--text-dark); font-size: 13px;
}
.auth-form input:focus { border-color: var(--primary); outline: none; }
.auth-action-btn {
  background: var(--primary-gradient); color: #fff; border: none; padding: 10px;
  border-radius: 10px; font-weight: 800; cursor: pointer; transition: var(--transition);
}
.auth-link { font-size: 12px; text-align: center; color: var(--secondary); cursor: pointer; text-decoration: underline; }

/* ========== HISTORY ========== */
.history-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.history-filter-btn {
  padding: 6px 12px; border: 2px solid #ddd; background: var(--card-bg); color: var(--text-dark);
  border-radius: 16px; cursor: pointer; font-weight: 700; font-size: 11px; transition: var(--transition);
}
.history-filter-btn.active-filter {
  background: var(--primary-gradient); color: #fff; border-color: transparent;
}
.history-search-input {
  width: 100%; padding: 10px 14px; border-radius: 20px; border: 2px solid #ddd;
  background: #f5f5f5; font-weight: 600; font-size: 13px; outline: none;
  color: var(--text-dark); margin-bottom: 10px; box-shadow: var(--shadow-inner);
}
.order-history-card {
  background: var(--card-bg); padding: 12px; border-radius: 14px; margin-bottom: 8px;
  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-id { font-weight: 800; font-size: 13px; color: var(--primary); }
.order-date { font-size: 11px; color: var(--text-light); margin: 2px 0; }
.order-info { font-size: 12px; color: var(--text-dark); margin: 2px 0; }
.order-total { font-weight: 800; color: var(--primary); text-align: right; }
.order-status { padding: 3px 8px; border-radius: 14px; font-weight: 700; font-size: 10px; }
.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; }
.no-orders { text-align: center; padding: 30px; color: var(--text-light); font-weight: 600; }

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

/* ========== SUPPORT FAB ========== */
.support-wrapper {
  position: fixed; bottom: 80px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 900;
}
.s-btn {
  width: 42px; height: 42px; border-radius: 50%; display: flex; justify-content: center;
  align-items: center; background: var(--card-bg); color: var(--primary); font-size: 20px;
  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 - FIXED ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.06);
  border-radius: 16px 16px 0 0;
  z-index: 999;
  padding: 4px 0 6px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: #b0b8c1;
  font-size: 10px;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 8px;
}
.bottom-nav-item i {
  font-size: 18px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item.active i {
  transform: scale(1.12);
}
.bottom-nav-item:active {
  transform: scale(0.94);
}

/* ========== ALERT ICON ========== */
.alert-icon-wrapper {
  width: 65px; height: 65px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; justify-content: center; align-items: center; font-size: 30px;
}
.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: 8px 10px; min-height: 46px; border-radius: 0 0 14px 14px; }
  .logo { font-size: 17px; max-width: 50vw; }
  #login-btn { padding: 6px 10px; font-size: 11px; }
  #user-img { width: 30px; height: 30px; }
  .nav-icon-btn { width: 32px; height: 32px; font-size: 16px; }
  .category-grid, .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 10px;
  }
  .category-card, .product-card { padding: 14px 10px; min-height: 155px; border-radius: 16px; }
  .category-img, .product-img { font-size: 38px; }
  .category-name, .product-title { font-size: 13px; }
  .product-price { font-size: 15px; }
  .add-btn, .wishlist-btn-card { width: 32px; height: 32px; font-size: 14px; }
  .profile-dropdown { right: -10px; min-width: 180px; }
  .bottom-nav { height: 56px; border-radius: 14px 14px 0 0; }
  .bottom-nav-item { font-size: 9px; }
  .bottom-nav-item i { font-size: 17px; }
}