/* ==========================================================================
   Welelo.com - Design System & Mobile Responsive Engine
   ========================================================================== */

:root {
  --primary-blue: #0A84FF;
  --primary-blue-hover: #0066CC;
  --primary-blue-light: #EBF3FF;
  --accent-orange: #FF7A00;
  --accent-orange-hover: #E56E00;
  --accent-orange-light: #FFF2E6;
  --dark-bg: #0F172A;
  --dark-surface: #1E293B;
  --bg-main: #F4F8FC;
  --card-bg: #FFFFFF;
  --text-dark: #1A2533;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-color: #E2EAF4;
  --shadow-sm: 0 2px 8px rgba(10, 132, 255, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 132, 255, 0.1);
  --shadow-lg: 0 16px 36px rgba(10, 132, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', 'Noto Sans Ethiopic', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ABSOLUTE ZERO HORIZONTAL OVERFLOW & WRAPPING RULES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box !important;
  max-width: 100% !important;
}

html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   Navbar Header & W-Cart Logo
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--primary-blue);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.25);
  color: #ffffff;
  width: 100%;
}

.navbar-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.navbar-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
}

.w-cart-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.w-cart-svg {
  width: 100%;
  height: 100%;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
}

.logo-ext {
  color: var(--accent-orange);
}

.logo-sub {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.92;
}

.navbar-center {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Region Button */
.region-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.arrow-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

/* Portal Nav Tabs */
.portal-nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.25rem;
  border-radius: var(--radius-full);
}

.portal-tab {
  position: relative;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-tab.active {
  background: #ffffff;
  color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tab-badge-new {
  background: var(--accent-orange);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #ffffff;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.icon-nav-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-orange);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.sell-cta-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-orange);
  color: #ffffff;
  border: none;
  font-weight: 900;
  font-size: 0.9rem;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.4);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, #0A84FF 0%, #0066CC 100%);
  color: #ffffff;
  padding: 1.5rem 1rem 2.5rem;
  text-align: center;
  position: relative;
  width: 100%;
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.search-bar-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-full);
  padding: 0.3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  gap: 0.3rem;
  width: 100%;
}

.search-input-group {
  display: flex;
  align-items: center;
  flex: 1;
  padding-left: 0.8rem;
}

.search-icon-box {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.clear-search-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.4rem;
}

.search-submit-btn {
  background: var(--accent-orange);
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
}

.tag-label {
  opacity: 0.92;
  font-weight: 600;
}

.quick-tag {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 500;
}

/* ==========================================================================
   JIJI STYLE MOBILE 4-COLUMN CATEGORY GRID
   ========================================================================== */
.mobile-categories-section {
  padding: 1rem 0.85rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.mobile-categories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.mobile-categories-header h3 {
  font-size: 1rem;
  font-weight: 800;
}

.mobile-view-all {
  font-size: 0.8rem;
  color: var(--primary-blue);
  font-weight: 700;
  cursor: pointer;
}

.mobile-cat-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  width: 100%;
}

.mobile-cat-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-height: 84px;
}

.mobile-cat-card:active, .mobile-cat-card.active {
  background: var(--primary-blue-light);
  border-color: var(--primary-blue);
}

/* Tile 1: Special + Add Item Tile */
.mobile-cat-card.cat-add-item-tile {
  background: linear-gradient(135deg, #FFF2E6 0%, #FFE0C2 100%);
  border: 1px solid #FFC48C;
  color: var(--accent-orange);
}

.add-item-icon-box {
  width: 32px;
  height: 32px;
  background: var(--accent-orange);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(255, 122, 0, 0.4);
}

.mobile-cat-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.mobile-cat-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-add-item-tile .mobile-cat-name {
  color: var(--accent-orange);
  font-weight: 800;
}

/* ==========================================================================
   Fluid Main Layout Container
   ========================================================================== */
.main-container {
  width: 100%;
  max-width: 1600px;
  margin: 1.25rem auto 4rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.5rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.reset-filter-btn {
  font-size: 0.82rem;
  color: #ff3b30;
  font-weight: 700;
  cursor: pointer;
}

/* Category Tree (Desktop) */
.category-tree {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  font-weight: 600;
}

.cat-item:last-child {
  border-bottom: none;
}

.cat-item:hover, .cat-item.active {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.cat-icon-text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cat-icon {
  font-size: 1.15rem;
}

.cat-count {
  font-size: 0.75rem;
  background: #E2E8F0;
  color: var(--text-muted);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

/* Filter Card */
.filter-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-title {
  font-size: 1rem;
  font-weight: 800;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-select, .price-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: #ffffff;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.apply-filter-btn {
  background: var(--text-dark);
  color: #ffffff;
  border: none;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Private CV Card */
.cv-draft-card {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cv-badge {
  background: rgba(255, 122, 0, 0.25);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 122, 0, 0.4);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.cv-card-text {
  font-size: 0.8rem;
  color: #94A3B8;
  line-height: 1.4;
}

.cv-action-btn {
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ==========================================================================
   Content Area & Listings
   ========================================================================== */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.banner-carousel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.banner-card {
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.banner-blue {
  background: linear-gradient(135deg, #EBF3FF 0%, #D4E5FF 100%);
  border: 1px solid #BCD8FF;
}

.banner-orange {
  background: linear-gradient(135deg, #FFF2E6 0%, #FFE0C2 100%);
  border: 1px solid #FFC48C;
}

.banner-icon {
  font-size: 2.2rem;
}

.banner-info {
  flex: 1;
}

.banner-info h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.banner-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.banner-btn {
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.banner-btn-orange {
  background: var(--accent-orange);
}

/* Listing Toolbar */
.listing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  width: 100%;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.listing-heading {
  font-size: 1.15rem;
  font-weight: 900;
}

.item-count-badge {
  font-size: 0.8rem;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sort-select {
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: #ffffff;
}

.view-toggle {
  display: flex;
  gap: 0.3rem;
}

.view-btn {
  background: #F1F5F9;
  border: 1px solid var(--border-color);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}

.view-btn.active {
  background: var(--primary-blue);
  color: #ffffff;
}

/* Active Tags Bar */
.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #ffffff;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
  font-size: 0.85rem;
}

.active-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.active-tag {
  background: #E2E8F4;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.remove-tag-btn {
  border: none;
  background: none;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-muted);
}

.clear-all-tags-btn {
  background: none;
  border: none;
  color: #ff3b30;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
}

/* Product Card Grid (2 Columns on Mobile View) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.product-grid.list-view {
  grid-template-columns: 1fr;
}

/* Card Styling */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  width: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #BCD8FF;
}

/* FIXED 4:3 ASPECT RATIO IMAGE COVER CONTAINER */
.card-image-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #F8FAFC;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.card-condition-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(6px);
}

.tender-badge-pill {
  background: var(--accent-orange) !important;
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.fav-btn:hover, .fav-btn.active {
  color: #FF3B30;
}

.card-body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-price {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  border-top: 1px solid #F1F5F9;
  padding-top: 0.55rem;
}

.card-location {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   FIXED ROOT-LEVEL MOBILE BOTTOM NAVIGATION BAR (position: fixed !important)
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 60px !important;
  background: #FFFFFF !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  z-index: 99999 !important;
  border-top: 1px solid var(--border-color) !important;
}

.mob-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem;
}

.mob-nav-item.active {
  color: var(--primary-blue);
  font-weight: 800;
}

.mob-icon {
  width: 22px;
  height: 22px;
}

.mob-icon-wrap {
  position: relative;
}

.mob-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--accent-orange);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mob-nav-sell-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--accent-orange);
  cursor: pointer;
  margin-top: -14px;
}

.mob-sell-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.45);
  border: 3px solid #ffffff;
}

.mob-sell-icon {
  width: 24px;
  height: 24px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.modal-sm { max-width: 440px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 950px; }

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #F1F5F9;
  border: none;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.modal-header {
  padding: 1.5rem 1.5rem 0.5rem;
}

.modal-header h2, .modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.modal-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-submit {
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* Detail Modal Specifics */
.detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
  padding: 1.5rem;
}

.main-image-box {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #F8FAFC;
}

.main-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-condition-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-blue);
  color: #ffffff;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 800;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.thumb-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumb-img.active {
  border-color: var(--primary-blue);
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-category-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-blue);
  text-transform: uppercase;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.25;
}

.detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-price {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-blue);
}

.fav-detail-btn {
  background: #F1F5F9;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.detail-meta-list {
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-description-box {
  background: #F8FAFC;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.seller-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #ffffff;
}

.seller-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.seller-avatar {
  width: 46px;
  height: 46px;
  background: var(--primary-blue);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seller-details h4 {
  font-size: 0.95rem;
  font-weight: 800;
}

.stars {
  color: var(--accent-orange);
  font-size: 0.9rem;
}

.seller-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.show-phone-btn {
  background: var(--accent-orange);
  color: #ffffff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}

.action-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.chat-seller-btn, .make-offer-btn {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
}

.chat-seller-btn {
  background: #F1F5F9;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.make-offer-btn {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  border: 1px solid #BCD8FF;
}

/* Region Choice List */
.region-list {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
}

.region-item {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 76px;
  right: 16px;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0F172A;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Footer */
.footer {
  background: var(--dark-bg);
  color: #94A3B8;
  padding: 3rem 1.5rem 5.5rem;
  width: 100%;
}

.footer-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer-text {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.app-badges {
  display: flex;
  gap: 0.75rem;
}

.store-badge {
  background: var(--dark-surface);
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.88rem;
}

.footer-bottom {
  max-width: 1600px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.82rem;
}

/* ==========================================================================
   DEVICE UTILITIES & MOBILE MEDIA QUERIES
   ========================================================================== */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .main-container {
    grid-template-columns: 1fr;
    padding: 0 0.85rem 4.5rem;
    margin-top: 0.85rem;
    width: 100% !important;
  }

  /* 2 COLUMNS PRODUCT GRID ON MOBILE PHONES */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    width: 100% !important;
  }

  .detail-container {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .hero-section {
    padding: 1rem 0.85rem 1.8rem;
  }

  .search-submit-btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
  }

  .region-pill-btn span {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
