/* ============================================================
   marketplace.css — Golden Source for Store Listings
   ============================================================ */

:root {
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  --accent-gradient: linear-gradient(135deg, #6366f1, #0ea5e9);
  --sidebar-w: 280px;
}

/* ============================================================
   Page Layout — Sidebar + Content
   ============================================================ */
.marketplace-wrapper {
  display: flex;
  align-items: flex-start;
}

.market-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  max-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2500;
  transform: translateX(-100%);
  background: white;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0; /* Tightened */
  padding: 1.5rem 0 5rem; /* No horizontal padding for full-width content */
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 20px 0 80px rgba(0,0,0,0.08);
}

.market-sidebar.open {
  transform: translateX(0);
}

.market-sidebar::-webkit-scrollbar { width: 4px; }
.market-sidebar::-webkit-scrollbar-track { background: transparent; }
.market-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
}
.market-sidebar::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 1.25rem; /* Internal padding for header */
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 950;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.01em;
}

/* Dot removed */

.sidebar-reset {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.sidebar-reset:hover {
  color: white;
  background: #0f172a;
  border-color: #0f172a;
  transform: scale(1.05);
}

/* ── Collapsible Section ── */
.sidebar-filters-container.glass-card {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  width: 100% !important;
}

.sidebar-filters-container {
  display: flex;
  flex-direction: column;
  background: transparent;
  width: 100%;
}

.filter-section {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Clean divider */
  background: transparent;
  transition: all 0.3s;
  width: 100%;
}

.filter-section:last-child { border-bottom: none; }

.filter-section.open {
  background: rgba(255, 255, 255, 0.5);
}

.filter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem; /* Large internal padding */
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: all 0.3s;
  width: 100%;
}

.filter-section.open .filter-section-header {
  background: rgba(0, 0, 0, 0.015);
}

.filter-section-header:hover {
  background: rgba(99, 102, 241, 0.06);
}

.filter-section-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.filter-section-label svg {
  color: var(--clr-primary);
  opacity: 0.8;
  transition: transform 0.3s;
}

.filter-section-header:hover .filter-section-label svg {
  transform: scale(1.1) rotate(-5deg);
  opacity: 1;
}

.filter-section-label svg {
  color: var(--clr-primary);
  flex-shrink: 0;
}

.filter-chevron {
  width: 16px;
  height: 16px;
  color: var(--clr-muted);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.filter-section.open .filter-chevron {
  transform: rotate(180deg);
}

.filter-section-body {
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0; /* Padding removed from container */
  display: flex;
  flex-direction: column;
  gap: 0; 
  width: 100%;
}

.city-list-container {
  display: flex;
  flex-direction: column; /* Stacked for full width */
  gap: 0;
  padding-bottom: 1rem;
  width: 100%;
}

.filter-section.open .filter-section-body {
  max-height: 300px;
  padding-bottom: 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom Scrollbar for internal sections */
.filter-section-body::-webkit-scrollbar {
  width: 5px;
}
.filter-section-body::-webkit-scrollbar-track {
  background: transparent;
}
.filter-section-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
}
.filter-section-body::-webkit-scrollbar-thumb:hover {
  background: var(--clr-primary);
}

.city-pill-btn {
  padding: 0.9rem 1.25rem;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100% !important;
}

.city-pill-btn:hover {
  background: rgba(99, 102, 241, 0.04);
  color: var(--clr-primary);
}

.city-pill-btn.active {
  background: var(--accent-gradient);
  color: white;
}

.type-pill-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100% !important;
  padding: 0.9rem 1.25rem;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.type-pill-btn:hover {
  background: rgba(99, 102, 241, 0.04);
  color: var(--clr-primary);
}

.type-pill-btn.active {
  background: var(--accent-gradient);
  color: white;
}

.filter-section.open .filter-section-body {
  max-height: 300px; /* Uniform limit */
  padding-bottom: 1.25rem;
  overflow-y: auto;
}

.filter-section-body::-webkit-scrollbar { width: 4px; }
.filter-section-body::-webkit-scrollbar-track { background: transparent; }
.filter-section-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }
.filter-section-body::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

/* ── Stores ── */
.store-pill-all {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100% !important;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--clr-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.store-pill-all:hover {
  background: rgba(99, 102, 241, 0.05);
}

.store-pill-all.active {
  background: var(--accent-gradient);
  color: white;
}

.store-pill-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100% !important;
  padding: 0.85rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.store-pill-btn:hover {
  background: rgba(0, 0, 0, 0.015);
}

.store-pill-btn.active {
  background: var(--accent-gradient);
  color: white;
}

.store-pill-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.store-pill-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.store-pill-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.store-pill-rating {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  opacity: 0.9;
}

.store-pill-btn.active .store-pill-rating {
  color: rgba(255, 255, 255, 0.9);
}

.category-pill-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: transparent;
  color: #334155;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  transition: all 0.3s;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  width: 100%;
}

.category-pill-link:hover {
  background: rgba(99, 102, 241, 0.05);
  color: var(--clr-primary);
  transform: none;
}

.category-pill-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: transform 0.3s;
}

.category-pill-link:hover img {
  transform: scale(1.1) rotate(5deg);
}

.filter-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--clr-muted);
  background: rgba(0,0,0,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}

.filter-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.3s;
}

.filter-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  width: 100%;
}

.filter-option:hover {
  background: rgba(0, 0, 0, 0.015);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.rating-row:hover {
  background: rgba(0, 0, 0, 0.01);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"],
.rating-row input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 7px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  flex-shrink: 0;
}

.filter-option input[type="radio"],
.rating-row input[type="radio"] {
  border-radius: 50%;
}

/* Custom Checkboxes/Radios Fix */
.filter-section-body input[type="checkbox"],
.filter-section-body input[type="radio"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  background: white !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.filter-section-body input[type="checkbox"] { border-radius: 6px !important; }
.filter-section-body input[type="radio"]    { border-radius: 50% !important; }

.filter-section-body input:checked {
  background: var(--clr-primary) !important;
  border-color: var(--clr-primary) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}

.filter-section-body input:checked::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 8px !important;
  height: 8px !important;
  background: white !important;
  border-radius: 50% !important;
  animation: checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.filter-section-body input[type="checkbox"]:checked::after {
  border-radius: 2px !important;
}

@keyframes checkPop {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}

.filter-option input[type="checkbox"]:checked::after {
  border-radius: 2px;
}

/* ── Rating Stars ── */
.rating-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: transparent;
  transition: all 0.2s;
}

.rating-row:hover {
  background: rgba(0, 0, 0, 0.015);
}

.rating-stars { 
  display: flex; 
  gap: 2px; 
  color: #fbbf24; /* Golden stars */
  font-size: 0.85rem; 
}

.rating-label { 
  font-size: 0.82rem; 
  font-weight: 700; 
  color: #1e293b; 
}

/* ── Price Range ── */
.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.5rem;
  width: 100%;
}

.price-range-inputs input[type="number"] {
  width: 100%;
  padding: 0.85rem;
  border: 1.5px solid rgba(0,0,0,0.06);
  background: white;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
  outline: none;
  transition: all 0.3s;
}

.price-range-inputs input[type="number"]:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.price-range-sep {
  color: #64748b;
  font-weight: 800;
}

.apply-price-btn {
  width: calc(100% - 2.5rem);
  margin: 0.5rem 1.25rem 1.25rem;
  padding: 0.85rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
}

.apply-price-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.25);
  filter: brightness(1.05);
}

/* ── Mobile Toggle Button ── */
.sidebar-toggle-btn {
  display: flex;
  position: fixed;
  bottom: 2rem; /* Relocated to bottom corner */
  right: 2rem;
  z-index: 2000;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  width: 64px; /* Circular FAB Style */
  height: 64px;
  border-radius: 50%;
  padding: 1.5rem;
  font-size: 0; /* Hide text, use icon only for cleaner FAB */
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(79, 70, 22, 0.4);
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-toggle-btn::before {
  content: '';
  width: 24px;
  height: 24px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/></svg>') no-repeat center;
  background-size: contain;
}

.sidebar-toggle-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 18px 40px rgba(79, 70, 22, 0.5);
}

body.sidebar-active .sidebar-toggle-btn {
  display: none;
}

.sidebar-toggle-btn:hover {
  background: var(--clr-primary-h);
  transform: translateY(-2px);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 850;
}

.sidebar-overlay.visible { display: block; }

/* ── Main Content ── */
.marketplace-layout {
  flex: 1;
  min-width: 0;
  padding: 0 clamp(1rem, 3vw, 2rem) 2rem; /* Consistent padding everywhere */
}

/* ── Store Grid ── */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 20vw, 340px), 1fr));
  gap: clamp(1.5rem, 2.5vw, 2.5rem);
  width: 100%;
}

/* ── Results Bar ── */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 0.8rem 1.4rem;
  background: white;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 4px 12px rgba(0,0,0,0.01);
  flex-wrap: wrap;
  gap: 1rem;
}

.results-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--clr-muted);
}

.results-count span { color: var(--clr-text); font-weight: 900; }

.active-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--clr-primary);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.active-filter-tag:hover {
  background: var(--clr-primary);
  color: white;
  border-color: var(--clr-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.remove-tag {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1;
  opacity: 0.7;
  margin-left: 0.2rem;
}

.active-filter-tag:hover .remove-tag {
  opacity: 1;
}

/* ============================================================
   Premium Cards
   ============================================================ */
.premium-store-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 28px;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
  cursor: pointer;
}

.premium-store-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
  border-color: var(--clr-primary);
}

.card-visual {
  height: 160px; /* Reduced from 220px */
  overflow: hidden;
  position: relative;
}

.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-store-card:hover .card-visual img {
  transform: scale(1.1);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.card-tag {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-primary);
  background: rgba(99, 102, 241, 0.06);
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
  width: fit-content;
}

.store-title {
  font-size: 1rem;
  font-weight: 900;
  margin: 0;
  color: #0f172a;
  line-height: 1.3;
}

/* Hide specs list in minimized view */
.card-specs-list {
  display: none;
}

.card-vendor-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0,0,0,0.03);
}

.vendor-avatar {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.vendor-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-visual::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: skewX(-20deg);
  transition: 0.8s;
  pointer-events: none;
  z-index: 3;
}

.premium-store-card:hover .card-visual::after {
  left: 150%;
}

.premium-store-card:hover .card-visual img { transform: scale(1.1); }

.rating-tag {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 2;
}

.store-featured-badge {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 900;
  z-index: 4;
  box-shadow: 0 8px 20px rgba(79, 110, 241, 0.3);
  letter-spacing: -0.01em;
}

.card-specs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.spec-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--clr-text);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
}

.premium-store-card:hover .spec-pill {
  border-color: rgba(79, 70, 229, 0.15);
  background: #fff;
}

.utility-bar {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0.5rem 0;
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.util-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--clr-muted);
}

.util-item.active { color: #10b981; }

.action-row {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.btn-primary-gradient {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 1rem;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(99,102,241,0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(99,102,241,0.3);
}

/* Category Pills */
.category-pill {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.4rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  color: var(--clr-muted);
  background: var(--clr-bg-alt);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.category-pill.active {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.2);
  color: var(--clr-primary);
  font-weight: 800;
  transform: translateX(4px);
}

.category-pill:hover:not(.active) {
  background: #fff;
  border-color: var(--clr-border);
  transform: translateX(3px);
}

.type-pill-btn {
  padding: 0.8rem 1rem;
  font-size: 0.76rem;
  letter-spacing: -0.01em;
  margin-right: 0.4rem;
  margin-bottom: 0.6rem;
  display: inline-flex;
  width: auto;
  border-radius: 100px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--clr-text);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 700;
}

.type-pill-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.type-pill-btn.active {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
  display: none;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

.store-modal {
  max-width: 1000px;
  width: 100%;
  background: #fff;
  border-radius: 48px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 50px 100px rgba(0,0,0,0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-close:hover {
  background: #fff;
  color: var(--clr-primary);
  transform: rotate(90deg) scale(1.1);
}

.store-modal-header { height: 280px; position: relative; }
.store-modal-header img { width: 100%; height: 100%; object-fit: cover; }

.store-modal-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(15,23,42,0.9));
}

.store-branding-overlay {
  position: absolute;
  bottom: 3rem;
  left: 2.5rem;
  right: 2.5rem;
  z-index: 20;
  color: #fff;
}

/* Product Detail Page View (Inside Modal) */
.product-detail-modal {
  display: flex;
  flex-direction: column;
}

.product-detail-hero {
  height: 400px;
  position: relative;
}

.product-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-content {
  padding: 3rem;
  background: #fff;
  border-radius: 40px 40px 0 0;
  margin-top: -3rem;
  position: relative;
  z-index: 10;
}

.product-info-section {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.product-title-group h2 {
  font-size: 2.8rem;
  font-weight: 950;
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: #0f172a;
}

.product-price-large {
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-primary);
  display: block;
  margin-bottom: 2rem;
}

.product-specs-detailed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-spec-pill {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.03);
  font-weight: 700;
  color: #334155;
}

.detail-spec-pill svg {
  color: var(--clr-primary);
}

/* Integrated Store Details */
.product-store-section {
  padding: 3rem;
  background: #f1f5f9;
  border-radius: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}

.store-large-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.store-detail-content h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-primary);
  margin-bottom: 0.5rem;
  font-weight: 900;
}

.store-detail-name {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.store-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
}

.meta-item svg {
  color: var(--clr-primary);
  opacity: 0.7;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   Search Hub
   ============================================================ */
.search-hub {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: all 0.3s ease;
}

.search-hub:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1), 0 8px 24px rgba(0,0,0,0.06);
}

.search-icon-wrapper {
  color: var(--clr-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-hub:focus-within .search-icon-wrapper { color: var(--clr-primary); }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--clr-text);
  background: transparent;
}

.search-input::placeholder { color: #94a3b8; }

.search-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .modal-grid { grid-template-columns: 1fr; gap: 2rem; }
  .store-modal-body { padding: 2.5rem 1.5rem; margin-top: -3rem; }
  .store-branding-overlay { left: 2rem; bottom: 3.5rem; }
}

@media (max-width: 960px) {
  /* No special desktop sidebar hidden logic anymore, it's universal */
}

@media (max-width: 768px) {
  .search-hub {
    flex-direction: column;
    padding: 1rem;
    gap: 0.8rem;
    border-radius: 16px;
  }

  .search-btn {
    width: 100%;
    padding: 0.8rem;
  }
  
  .marketplace-layout { 
    padding: 0 1rem 1.5rem; 
  }
}

@media (max-width: 600px) {
  .store-grid { 
    grid-template-columns: 1fr; 
  }
  
  .results-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .active-filters {
    width: 100%;
  }
  
  .sidebar-toggle-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
  }
}

/* ============================================================
   Animations & Polish
   ============================================================ */
@keyframes filterShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.store-pill-all.active {
  position: relative;
  overflow: hidden;
}

.store-pill-all.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  background-size: 200% 100%;
  animation: filterShimmer 3s infinite linear;
  pointer-events: none;
}
