/* DesiMall — app.css */

/* ── Header ──────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--header-bg); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-muted);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; height: var(--header-height);
}
.header-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.header-logo img { width: 34px; height: 34px; object-fit: contain; }
.header-logo span {
  font-size: 1.2rem; font-weight: 800;
  background: var(--grad-brand); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; white-space: nowrap;
}
.header-search {
  flex: 1; display: flex; align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-muted); border-radius: var(--radius-full);
  padding: 0 16px; gap: 8px; transition: var(--transition);
  max-width: 520px;
}
.header-search:focus-within { border-color: var(--primary); background: rgba(255,107,0,0.05); }
.search-icon { color: var(--text-muted); font-size: 0.85rem; }
.header-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-main); font-size: 0.9rem; padding: 10px 0;
}
.header-search input::placeholder { color: var(--text-muted); }
.btn-search-go {
  background: var(--grad-brand); color: #fff;
  border: none; border-radius: var(--radius-full);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.8rem; flex-shrink: 0; transition: var(--transition);
}
.btn-search-go:hover { filter: brightness(1.1); }
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.header-action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-muted);
  color: var(--text-sub); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  font-family: var(--font);
}
.header-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-badge {
  background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 5px; border-radius: var(--radius-full);
  line-height: 1.4;
}
.btn-hamburger {
  display: none; background: none; border: none;
  color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
  padding: 6px; flex-shrink: 0;
}
.mobile-search, .mobile-type-toggle { display: none; }

/* ── Profile Dropdown ─────────────────────────────────────── */
.profile-dropdown {
  position: fixed; top: calc(var(--header-height) + 8px); right: 20px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 8px;
  box-shadow: var(--shadow-lg); z-index: var(--z-dropdown);
  min-width: 200px; animation: fadeIn 0.2s ease;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-md);
  color: var(--text-sub); font-size: 0.88rem;
  cursor: pointer; transition: var(--transition); width: 100%;
  background: none; border: none; font-family: var(--font); text-align: left;
}
.dropdown-item:hover { background: rgba(255,107,0,0.08); color: var(--primary); }
.dropdown-item.danger:hover { background: rgba(229,57,53,0.08); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border-muted); margin: 4px 0; }

/* ── Layout ───────────────────────────────────────────────── */
.app-layout {
  max-width: var(--max-width); margin: 0 auto;
  display: grid; grid-template-columns: 260px 1fr;
  gap: 0; min-height: calc(100vh - var(--header-height));
}

/* ── Sidebar ──────────────────────────────────────────────── */
.app-sidebar {
  width: 260px; flex-shrink: 0;
  border-right: 1px solid var(--border-muted);
  background: var(--sidebar-bg);
  height: calc(100vh - var(--header-height));
  position: sticky; top: var(--header-height);
  overflow-y: auto;
}
.sidebar-inner { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-section { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.sidebar-heading {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.sidebar-divider { height: 1px; background: var(--border-muted); margin: 4px 0; }

/* Location */
.location-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.location-info span { font-size: 0.82rem; color: var(--text-sub); font-weight: 500; }
.btn-link { background: none; border: none; color: var(--primary); font-size: 0.78rem; cursor: pointer; font-family: var(--font); }

/* Radius Buttons */
.radius-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.radius-btn {
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-muted);
  color: var(--text-muted); transition: var(--transition); font-family: var(--font);
}
.radius-btn.active, .radius-btn:hover { background: rgba(255,107,0,0.15); border-color: var(--primary); color: var(--primary); }

/* Categories */
.category-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-md);
  font-size: 0.82rem; color: var(--text-muted); cursor: pointer;
  background: none; border: none; text-align: left; width: 100%;
  transition: var(--transition); font-family: var(--font);
}
.cat-item:hover { background: rgba(255,107,0,0.08); color: var(--text-sub); }
.cat-item.active { background: rgba(255,107,0,0.12); color: var(--primary); font-weight: 600; }
.sub-cats { padding-left: 16px; display: none; flex-direction: column; gap: 2px; }
.sub-cats.open { display: flex; }

/* Price Range */
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { flex: 1; padding: 7px 10px; font-size: 0.82rem; }
.price-inputs span { color: var(--text-muted); }

/* Rating Filter */
.rating-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.rating-btn {
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-muted);
  color: var(--text-muted); transition: var(--transition); font-family: var(--font);
}
.rating-btn.active, .rating-btn:hover { background: rgba(255,184,0,0.15); border-color: var(--accent); color: var(--accent); }

/* ── Main Content ─────────────────────────────────────────── */
.app-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }

/* Banners */
.banner-slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; height: 200px; }
.banner-track { display: flex; height: 100%; transition: transform 0.5s ease; }
.banner-slide { flex-shrink: 0; width: 100%; height: 100%; position: relative; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.banner-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: var(--transition); border: none; padding: 0; }
.banner-dot.active { background: #fff; width: 20px; border-radius: var(--radius-full); }

/* Results Bar */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px;
}
.results-info { display: flex; align-items: center; gap: 10px; }
#resultsCount { font-size: 0.85rem; color: var(--text-muted); }
#btnFilterMob { display: none; }

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* Listing Card */
.listing-card {
  background: var(--card-bg); border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition); cursor: pointer;
  display: flex; flex-direction: column;
}
.listing-card:hover {
  border-color: var(--border-hover); box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}
.card-img-wrap {
  position: relative; width: 100%; height: 160px;
  background: rgba(255,255,255,0.03); overflow: hidden;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.listing-card:hover .card-img-wrap img { transform: scale(1.05); }
.card-type-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(13,15,20,0.8); backdrop-filter: blur(6px);
  padding: 3px 8px; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 700; color: var(--text-sub);
}
.card-featured {
  position: absolute; top: 8px; right: 8px;
  background: var(--grad-gold); color: #000;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 800;
}
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 0.88rem; font-weight: 600; color: var(--text-main); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-seller { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.card-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-price { font-size: 1rem; font-weight: 800; color: var(--primary); }
.card-mrp { font-size: 0.72rem; color: var(--text-muted); text-decoration: line-through; }
.card-rating { display: flex; align-items: center; gap: 3px; font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.card-footer { padding: 0 12px 12px; display: flex; gap: 6px; }
.btn-add-cart {
  flex: 1; padding: 7px; border-radius: var(--radius-md);
  background: rgba(255,107,0,0.12); border: 1px solid var(--border);
  color: var(--primary); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn-add-cart:hover { background: var(--primary); color: #fff; }

/* Skeleton */
.listing-skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--card-bg) 25%, rgba(255,255,255,0.05) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  height: 280px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Load More */
.load-more-wrap { display: flex; justify-content: center; padding: 16px 0; }

/* ── Cart Drawer ───────────────────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: calc(var(--z-modal) - 1); backdrop-filter: blur(4px);
}
.cart-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 360px;
  background: var(--card-bg); border-left: 1px solid var(--border);
  z-index: var(--z-modal); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-muted);
}
.cart-header h3 { font-size: 1rem; font-weight: 700; }
.cart-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.cart-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: flex; gap: 12px; padding: 10px;
  background: rgba(255,255,255,0.03); border-radius: var(--radius-md);
  border: 1px solid var(--border-muted);
}
.cart-item img { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-item-name { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.cart-item-price { font-size: 0.82rem; color: var(--primary); font-weight: 700; }
.cart-item-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.8rem; align-self: flex-start; }
.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border-muted); display: flex; flex-direction: column; gap: 12px; }
.cart-total { font-size: 1rem; font-weight: 700; display: flex; justify-content: space-between; }

/* Sidebar overlay mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: calc(var(--z-sticky) - 1);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .header-search { max-width: 360px; }
  .listing-type-toggle { display: none; }
  .mobile-type-toggle { display: flex; }
}

@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed; left: -280px; top: var(--header-height);
    height: calc(100vh - var(--header-height)); z-index: var(--z-sticky);
    transition: left 0.3s ease; width: 280px;
  }
  .app-sidebar.open { left: 0; }
  .sidebar-overlay { display: block; }
  .header-inner { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .header-logo span { display: none; }
  .header-search { display: none; }
  .mobile-search {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border-muted);
    border-radius: var(--radius-full); padding: 0 14px; width: 100%;
    margin-top: 8px; order: 10;
  }
  .mobile-search input { flex: 1; background: none; border: none; outline: none; color: var(--text-main); font-size: 0.88rem; padding: 9px 0; font-family: var(--font); }
  .mobile-search i { color: var(--text-muted); font-size: 0.82rem; }
  .mobile-search button { background: var(--grad-brand); color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .mobile-type-toggle {
    display: flex; width: 100%;
    border-top: 1px solid var(--border-muted); padding: 8px 14px; gap: 8px;
  }
  .mob-type-btn {
    flex: 1; padding: 7px; border-radius: var(--radius-md);
    background: transparent; border: 1px solid var(--border-muted);
    color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: var(--transition); font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .mob-type-btn.active { background: var(--grad-brand); color: #fff; border-color: transparent; }
  .header-actions span { display: none; }
  .btn-hamburger { display: block; }
  #btnFilterMob { display: flex; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .cart-drawer { width: 100%; }
  .app-main { padding: 12px; }
}
