/**
 * Dubuz 2026 - HD Marketplace Layout
 * Refined grid, sidebar, and card styling
 * Exact match to Reference Theme
 */

/* ========================================
   GLOBAL & LAYOUT
   ======================================== */
.hd-marketplace-container {
  display: grid;
  grid-template-columns: 292px 1fr;
  gap: 24px;
  max-width: 1536px; /* Matches reference max-w-[1536px] */
  margin: 0 auto;
  padding: 24px 24px; /* Matches px-6 py-6 */
  width: 100%;
}

@media (max-width: 1023px) {
  .hd-marketplace-container {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
}

/* ========================================
   SIDEBAR (Reference Match)
   ======================================== */
.hd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 292px;
}

.hd-sidebar-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px; /* Matches rounded-2xl */
  padding: 16px; /* Matches p-4 */
  overflow: visible;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Matches shadow-xs */
}

/* Main Platform Links Sidebar Card */
.hd-sidebar-nav {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.hd-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px; /* Matches text-xs */
  font-weight: 600; /* Matches font-semibold */
  color: #334155;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hd-sidebar-nav-item:hover {
  background: #f8fafc;
}

.hd-sidebar-nav-item.is-active {
  background: #fff1f2;
  color: #f43f5e;
  font-weight: 700; /* Matches font-bold */
}

.hd-sidebar-nav-item i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

/* Filter Section */
.hd-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.hd-filter-header span {
  font-size: 11px; /* Matches text-[11px] */
  font-weight: 900; /* Matches font-black */
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hd-filter-group {
  margin-bottom: 12px;
}

.hd-filter-group-title {
  display: block;
  font-size: 10px; /* Matches text-[10px] */
  font-weight: 800; /* Matches font-extrabold */
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* Reference Select & Input Style */
.hd-sidebar select.hd-input,
.hd-sidebar input.hd-input {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px; /* Matches text-xs */
  font-weight: 700; /* Matches font-bold */
  color: #1e293b;
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hd-sidebar select.hd-input:focus,
.hd-sidebar input.hd-input:focus {
  border-color: #f43f5e;
  outline: none;
}

/* Advanced Filter Toggle */
.hd-adv-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  color: #f43f5e;
  transition: all 0.2s;
}

.hd-adv-toggle:hover {
  color: #e11d48;
}

/* ========================================
   CENTER CONTENT
   ======================================== */

/* Top Filter Bar */
.hd-top-filter-bar {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hd-top-filter-bar.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.hd-top-filter-bar .search-wrap {
  position: relative;
  min-width: 200px;
  flex: 1;
}

.hd-top-filter-bar .search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #94a3b8;
}

.hd-top-filter-bar .search-wrap input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px 8px 32px;
  font-size: 12px; /* Matches text-xs */
  font-weight: 500; /* Matches font-medium */
  color: #1e293b;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hd-top-filter-bar select {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px; /* Matches text-xs */
  font-weight: 700; /* Matches font-bold */
  color: #334155;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Listing Info Header */
.hd-listing-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  margin-top: 16px;
  margin-bottom: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hd-listing-info-header .count {
  font-size: 12px; /* Matches text-xs */
  font-weight: 900; /* Matches font-black */
  color: #1e293b;
}

.hd-listing-info-header .location {
  font-size: 11px; /* Matches text-[11px] */
  font-weight: 700; /* Matches font-bold */
  color: #94a3b8;
}

/* ========================================
   GRID & CARDS (Exact Reference Match)
   ======================================== */
.hd-listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1279px) {
  .hd-listing-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .hd-listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hd-listing-grid { grid-template-columns: 1fr; }
}

.hd-listing-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hd-listing-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-color: #fb7185; /* Matches hover:border-rose-400 */
  transform: translateY(-2px);
}

.hd-listing-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  overflow: hidden;
}

.hd-listing-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.hd-listing-card:hover .hd-listing-image {
  transform: scale(1.05);
}

.hd-listing-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f43f5e; /* Matches bg-rose-500 */
  color: #ffffff;
  font-weight: 800; /* Matches font-extrabold */
  font-size: 9px; /* Matches text-[9px] */
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.hd-heart-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: all 0.2s;
  border: 0;
}

.hd-heart-btn:hover {
  color: #f43f5e;
}

.hd-listing-price-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900; /* Matches font-black */
  font-size: 12px; /* Matches text-xs */
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hd-listing-price-tag span {
  font-size: 9px; /* Matches text-[9px] */
  color: #fb7185; /* Matches text-rose-400 */
  font-weight: 700; /* Matches font-bold */
  margin-bottom: 2px;
}

.hd-listing-content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hd-listing-title {
  font-size: 12px; /* Matches text-xs */
  font-weight: 700; /* Matches font-bold */
  color: #0f172a; /* Matches text-slate-900 */
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.hd-listing-card:hover .hd-listing-title {
  color: #f43f5e;
}

.hd-listing-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px; /* Matches text-[10px] */
  font-weight: 700; /* Matches font-bold */
  color: #94a3b8; /* Matches text-slate-400 */
}

.hd-listing-footer i {
  color: #f43f5e;
  margin-right: 2px;
}
