/* JualCepat Design System — Astryx-inspired UI */
:root {
  --fb-blue: #1877f2;
  --fb-blue-hover: #1565c0;
  --fb-blue-light: #e7f3ff;
  --fb-bg: #f0f2f5;
  --fb-card-bg: #ffffff;
  --fb-border: #e4e6eb;
  --fb-text-primary: #050505;
  --fb-text-secondary: #65676b;
  --fb-input-bg: #f0f2f5;
  --fb-hover-bg: #f2f2f2;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--fb-bg);
  color: var(--fb-text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Custom scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,.15); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(0,0,0,.25); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.15) transparent; }

a {
  text-decoration: none;
  color: inherit;
}

/* ==================== HEADER ==================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--fb-card-bg);
  border-bottom: 1px solid var(--fb-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.header-center {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 2;
  max-width: 680px;
  padding: 0 16px;
}

.header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 18px;
  color: var(--fb-text-primary);
  transition: background-color var(--transition);
  flex-shrink: 0;
}

.header-menu-btn:hover {
  background-color: var(--fb-input-bg);
}

.header-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--fb-blue);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  text-decoration: none;
}

.header-search-container {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.header-search-input {
  width: 100%;
  height: 40px;
  background-color: var(--fb-input-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  padding: 0 16px 0 42px;
  font-family: inherit;
  border: none;
  background: transparent;
  padding: 10px 10px 10px 44px;
  font-size: 14px;
  color: var(--fb-text-primary);
  outline: none;
}
.header-search-input::placeholder {
  color: var(--fb-text-secondary);
}
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-top: 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.search-dropdown.active {
  display: flex;
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--fb-text-primary);
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}
.search-dropdown-item:last-child {
  border-bottom: none;
}
.search-dropdown-item:hover {
  background: var(--fb-hover-bg);
}
.search-dropdown-img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-dropdown-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-dropdown-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-price {
  font-size: 13px;
  color: var(--fb-blue);
  font-weight: 600;
}

.header-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fb-text-secondary);
  pointer-events: none;
  display: flex;
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.header-circle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--fb-input-bg);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--fb-text-primary);
  transition: background-color var(--transition);
}

.header-circle-btn:hover {
  background-color: var(--fb-border);
}

/* ==================== MAIN PAGE LAYOUT & SIDEBAR ==================== */
.main-layout {
  display: block;
  margin-top: 56px;
  min-height: calc(100vh - 56px);
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--fb-card-bg);
  border-right: 1px solid var(--fb-border);
  padding: 16px;
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-280px);
}

body.sidebar-collapsed .content-area {
  margin-left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sidebar h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--fb-text-secondary);
  transition: background-color var(--transition);
}

.sidebar-close-btn:hover {
  background-color: var(--fb-input-bg);
}

.sidebar-section {
  border-top: 1px solid var(--fb-border);
  padding: 16px 0;
}

.sidebar-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--fb-text-primary);
}

/* Categories */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background-color var(--transition);
}

.category-item:hover {
  background-color: var(--fb-input-bg);
}

.category-item.active {
  background-color: var(--fb-blue-light);
  color: var(--fb-blue);
  font-weight: 600;
}

.category-icon-box {
  width: 32px;
  height: 32px;
  background-color: var(--fb-input-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background-color var(--transition);
}

.category-item.active .category-icon-box {
  background-color: var(--fb-blue-light);
  color: var(--fb-blue);
}

/* Price Filter */
.price-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 36px;
  border: 1px solid var(--fb-border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  background-color: var(--fb-input-bg);
  outline: none;
  transition: border-color var(--transition);
}

.price-input:focus {
  border-color: var(--fb-blue);
}

.price-filter-btn {
  width: 100%;
  height: 36px;
  background-color: var(--fb-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition);
}

.price-filter-btn:hover {
  background-color: var(--fb-blue-hover);
}

.sort-select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--fb-border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  background-color: var(--fb-input-bg);
  outline: none;
  cursor: pointer;
}

/* ==================== CONTENT AREA ==================== */
.content-area {
  margin-left: 280px;
  padding: 24px;
  max-width: 1200px;
  transition: margin-left 0.3s cubic-bezier(.2,.8,.2,1);
}

/* Mobile-only elements hidden on desktop */
.mobile-category-pills,
.mobile-filter-bar {
  display: none;
}

.content-header {
  margin-bottom: 20px;
}

.content-title {
  font-size: 20px;
  font-weight: 700;
}

/* ==================== PRODUCT GRID ==================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Product Card — Astryx ClickableCard style */
.product-card {
  background-color: var(--fb-card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image-container {
  width: 100%;
  padding-top: 100%;
  position: relative;
  background-color: #f7f8fa;
  overflow: hidden;
}

.card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}

.product-card:hover .card-image {
  transform: scale(1.04);
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--fb-text-primary);
}

.card-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--fb-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.card-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.card-location {
  font-size: 12px;
  color: var(--fb-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  background-color: var(--fb-blue-light);
  color: var(--fb-blue);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.card-badge.sold {
  background-color: #ffebe9;
  color: #ff4d4f;
}

/* ==================== PRODUCT DETAIL SPLIT LAYOUT ==================== */
.detail-layout {
  display: flex;
  height: calc(100vh - 56px);
  margin-top: 56px;
  background-color: #000;
  overflow: hidden;
}

.detail-photo-viewer {
  flex: 1;
  background-color: #18191a;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.detail-photo-main-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 0;
  position: relative;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background-color var(--transition);
  z-index: 10;
}

.gallery-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.gallery-nav-btn.prev {
  left: 24px;
}

.gallery-nav-btn.next {
  right: 24px;
}

.detail-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Gallery Thumbnails */
.detail-gallery {
  display: flex;
  gap: 8px;
  padding: 12px 24px 16px;
  overflow-x: auto;
  flex-shrink: 0;
  justify-content: center;
}

.detail-gallery::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity var(--transition), border-color var(--transition);
  flex-shrink: 0;
  background-color: #2a2a2a;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  border-color: var(--fb-blue);
}

.detail-info-sidebar {
  width: 360px;
  background-color: var(--fb-card-bg);
  border-left: 1px solid var(--fb-border);
  height: 100%;
  overflow-y: auto;
}

.detail-info-content {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-header-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.detail-price {
  font-size: 18px;
  font-weight: 700;
}

.detail-meta-row {
  font-size: 13px;
  color: var(--fb-text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-meta-row span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary {
  width: 100%;
  height: 40px;
  background-color: var(--fb-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color var(--transition);
}

.btn-primary:hover {
  background-color: var(--fb-blue-hover);
}

.btn-secondary {
  width: 100%;
  height: 40px;
  background-color: var(--fb-input-bg);
  color: var(--fb-text-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color var(--transition);
}

.btn-secondary:hover {
  background-color: var(--fb-border);
}

.detail-specs-box {
  border-top: 1px solid var(--fb-border);
  border-bottom: 1px solid var(--fb-border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.spec-label {
  color: var(--fb-text-secondary);
}

.spec-val {
  font-weight: 600;
}

.detail-description-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.detail-description-text {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}

.trust-badge-card {
  background-color: var(--fb-bg);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.trust-icon {
  font-size: 18px;
  color: var(--fb-blue);
  flex-shrink: 0;
}

.trust-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.trust-desc {
  font-size: 11px;
  color: var(--fb-text-secondary);
  line-height: 1.4;
}

.seller-profile-card {
  border-top: 1px solid var(--fb-border);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.seller-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--fb-blue-light);
  color: var(--fb-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.seller-details {
  display: flex;
  flex-direction: column;
}

.seller-name {
  font-weight: 600;
  font-size: 14px;
}

.seller-rating {
  font-size: 12px;
  color: var(--fb-text-secondary);
  margin-top: 1px;
}

/* ==================== FOOTER ==================== */
footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 12px;
  color: var(--fb-text-secondary);
  border-top: 1px solid var(--fb-border);
  background-color: var(--fb-card-bg);
  margin-top: 32px;
}

/* ==================== RESPONSIVE (MOBILE ≤ 900px) ==================== */
@media (max-width: 900px) {
  .header-menu-btn {
    display: none !important;
  }
  
  .header-menu-btn.mobile-only-back {
    display: flex !important;
  }
  
  .desktop-only {
    display: none !important;
  }

  .header-left {
    flex: 0 0 auto;
    gap: 8px;
  }
  
  .header-right {
    flex: 0 0 auto;
  }

  .header-center {
    flex: 1;
    padding: 0 8px;
  }

  .header-logo-text {
    font-size: 16px;
  }

  .header-search-container {
    width: 100%;
    margin: 0;
  }

  .header-search-input {
    height: 36px;
    font-size: 13px;
    padding: 0 12px 0 34px;
  }

  .header-search-icon {
    left: 12px;
    font-size: 13px;
  }

  /* Hide sidebar completely on mobile */
  .sidebar {
    display: none !important;
  }

  .content-area {
    margin-left: 0;
    padding: 12px;
  }
  
  /* Sticky Mobile Top Nav */
  .mobile-top-nav {
    position: sticky;
    top: 56px;
    background-color: var(--fb-bg);
    z-index: 80;
    margin: -12px -12px 12px;
    padding: 12px 0 0;
    border-bottom: 1px solid var(--fb-border);
  }

  /* Mobile category pills */
  .mobile-category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 12px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-category-pills::-webkit-scrollbar {
    display: none;
  }

  .pill-item {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-full);
    background-color: var(--fb-card-bg);
    border: 1px solid var(--fb-border);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--fb-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color var(--transition), color var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
  }

  .pill-item.active {
    background-color: var(--fb-blue-light);
    color: var(--fb-blue);
    border-color: var(--fb-blue-light);
  }

  /* Mobile filter bar */
  .mobile-filter-bar {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
  }

  .filter-bar-btn {
    flex: 1;
    height: 36px;
    border: 1px solid var(--fb-border);
    border-radius: var(--radius-full);
    background-color: var(--fb-card-bg);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--fb-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color var(--transition);
    box-shadow: var(--shadow-sm);
  }

  .filter-bar-btn:hover,
  .filter-bar-btn:active {
    background-color: var(--fb-input-bg);
  }

  .content-header {
    margin-bottom: 12px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .product-card {
    border-radius: var(--radius-md);
  }

  .card-body {
    padding: 10px;
  }

  .card-price {
    font-size: 14px;
  }

  .card-title {
    font-size: 12px;
    min-height: 32px;
  }

  /* Product Detail Mobile */
  .detail-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .detail-photo-viewer {
    height: auto;
    max-height: 50vh;
  }

  .detail-photo-main-wrap {
    padding: 0;
    min-height: 200px;
    max-height: 40vh;
  }

  .gallery-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .gallery-nav-btn.prev {
    left: 8px;
  }

  .gallery-nav-btn.next {
    right: 8px;
  }

  .detail-gallery {
    padding: 8px 16px 12px;
  }

  .gallery-thumb {
    width: 52px;
    height: 52px;
  }

  .detail-info-sidebar {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--fb-border);
  }

  .detail-info-content {
    padding-bottom: 80px;
  }

  .detail-btn-group {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--fb-card-bg);
    border-top: 1px solid var(--fb-border);
    padding: 10px 16px;
    flex-direction: row;
    gap: 8px;
    z-index: 110;
    box-shadow: 0 -2px 10px rgba(0,0,0,.05);
  }

  .detail-btn-group button {
    flex: 1;
    height: 44px;
    margin: 0;
  }

  .btn-secondary {
    flex: 0 0 50px !important;
    width: 50px;
    font-size: 0;
    padding: 0;
  }

  .btn-secondary i {
    font-size: 16px;
  }
}

/* ==================== MOBILE BOTTOM SHEET MODAL ==================== */
.mobile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: flex-end;
}

.mobile-modal.active {
  display: flex;
}

.mobile-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,.5);
  z-index: 1;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-modal-content {
  position: relative;
  width: 100%;
  max-height: 80vh;
  background-color: var(--fb-card-bg);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: 20px 16px 32px;
  z-index: 2;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}

.mobile-modal.active .mobile-modal-content {
  transform: translateY(0);
}

.mobile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fb-border);
  flex-shrink: 0;
}

.mobile-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--fb-text-primary);
}

.mobile-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--fb-input-bg);
  border: none;
  color: var(--fb-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background-color var(--transition);
}

.mobile-modal-close:hover {
  background-color: var(--fb-border);
}

.mobile-modal-body {
  overflow-y: auto;
  flex: 1;
}

.mobile-modal-section {
  display: none;
}

/* Mobile Sort Options */
.mobile-sort-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sort-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition);
  color: var(--fb-text-primary);
}

.sort-option:hover,
.sort-option.active {
  background-color: var(--fb-input-bg);
}

.sort-option.active {
  color: var(--fb-blue);
  font-weight: 600;
}

.sort-option i {
  display: none;
  font-size: 14px;
}

.sort-option.active i {
  display: block;
  color: var(--fb-blue);
}

/* ==================== CUSTOM MODAL ==================== */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 16px;
}
.custom-modal-overlay.active {
  display: flex;
}
.custom-modal-box {
  background: var(--fb-card-bg);
  width: 100%;
  max-width: 450px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s ease-out;
}
@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.custom-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.custom-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--fb-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  transition: background 0.2s;
}
.custom-modal-close:hover {
  background: var(--fb-hover-bg);
  color: var(--fb-text-primary);
}
.custom-modal-body {
  padding: 24px;
  color: var(--fb-text-primary);
}
.custom-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
