/**
 * Marketplace Archive CSS (/ads/)
 * Source: Final HTML/Marketplace/Marketplace main page/alagheza_used_appliances_marketplace_backend_seo_fixed_v7.html
 * Template: archive-alagheza_ad.php
 */

:root {
  --blue: #2E3192; --blue2: #0B2E83; --red: #D6083B; --green: #0E9F43; --gold: #F6B51E;
  --bg: #F6F8FC; --card: #fff; --text: #101828; --muted: #667085; --line: #E4E9F2; --soft: #F2F5FB;
  --radius: 18px; --shadow: 0 8px 22px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.marketplace-archive {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Tajawal", Arial, sans-serif;
  line-height: 1.55;
}

body.marketplace-archive .page,
body.marketplace-archive #al-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===== Breadcrumbs ===== */
.marketplace-archive .breadcrumbs {
  max-width: 1560px;
  margin: 16px auto 8px;
  padding: 0 18px;
  color: #506080;
  font-size: 14px;
  display: flex;
  gap: 8px;
}
.marketplace-archive .breadcrumbs a { color: #1D3E8A; font-weight: 700; }

/* ===== Market Hero ===== */
.marketplace-archive .market-hero { padding: 28px 18px; }
.marketplace-archive .market-hero-grid {
  max-width: 1560px;
  margin: auto;
  display: grid;
  grid-template-columns: 280px 1fr auto;
  gap: 18px;
  align-items: stretch;
}

.marketplace-archive .sell-col { display: grid; gap: 14px; align-content: start; }
.marketplace-archive .sell-panel {
  background: linear-gradient(135deg, var(--blue2), #1D3E8A);
  color: #fff;
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.marketplace-archive .sell-panel h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.marketplace-archive .sell-panel p { margin: 0; color: #d4e1ff; font-size: 15px; font-weight: 700; line-height: 1.7; }
.marketplace-archive .sell-panel a {
  background: #fff;
  color: var(--blue2);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 900;
  text-align: center;
  display: block;
  font-size: 15px;
}
.marketplace-archive .trust-counter {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
  font-size: 14px;
}
.marketplace-archive .trust-counter strong { color: var(--blue2); }

.marketplace-archive .market-hero-copy { display: flex; flex-direction: column; justify-content: center; }
.marketplace-archive .market-hero-copy h1 { font-size: clamp(32px, 4vw, 48px); margin: 0 0 14px; line-height: 1.2; font-weight: 900; }
.marketplace-archive .market-hero-copy h1 span { color: var(--blue2); }
.marketplace-archive .market-hero-copy p { margin: 0 0 20px; color: var(--muted); font-size: 17px; max-width: 640px; line-height: 1.8; }

.marketplace-archive .hero-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.marketplace-archive .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EEF4FF;
  border: 1px solid #D8E3F7;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  color: #1D3E8A;
  font-size: 14px;
}

.marketplace-archive .hero-image-card {
  width: 340px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}
.marketplace-archive .hero-image-card img { width: 100%; height: 100%; object-fit: cover; }
.marketplace-archive .hero-image-note {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255, 255, 255, .94);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  font-size: 13px;
  color: var(--blue2);
}

/* Mobile sell/trust */
.marketplace-archive .mobile-sell-trust { display: none; }

/* ===== Layout ===== */
.marketplace-archive .market-layout {
  max-width: 1560px;
  margin: auto;
  padding: 0 18px 40px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Filters */
.marketplace-archive .market-filters {
  position: sticky; top: 88px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.marketplace-archive .filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.marketplace-archive .filter-head h2 { font-size: 20px; margin: 0; color: var(--blue2); }
.marketplace-archive .filter-clear { color: var(--blue); font-weight: 900; font-size: 13px; }
.marketplace-archive .filter-head-actions { display: flex; align-items: center; gap: 10px; }
.marketplace-archive .filter-close { display: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #344054; font-family: inherit; font-weight: 900; }
.marketplace-archive .field { width: 100%; padding: 0; margin-bottom: 13px; }
.marketplace-archive .field label { display: block; font-weight: 900; color: #344054; margin-bottom: 7px; font-size: 13px; }
.marketplace-archive .market-select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 12px; font-family: inherit; color: #344054; outline: none; }
.marketplace-archive .market-input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 12px; font-family: inherit; outline: none; }
.marketplace-archive .market-range { width: 100%; accent-color: var(--blue); height: 8px; border-radius: 999px; cursor: pointer; }
.marketplace-archive .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.marketplace-archive .checks label { font-weight: 700; font-size: 12px; color: #475467; display: flex; gap: 6px; align-items: center; }
.marketplace-archive .checks input { width: 16px; height: 16px; accent-color: var(--blue); }
.marketplace-archive .dynamic-filter { display: none; }
.marketplace-archive .dynamic-filter.show { display: block; }
.marketplace-archive .apply-filter { width: 100%; height: 46px; border: 0; border-radius: 12px; background: var(--blue2); color: #fff; font-family: inherit; font-weight: 900; font-size: 14px; margin-top: 6px; }
.marketplace-archive .filter-backdrop { display: none; }
.marketplace-archive .mobile-filter { display: none; }

/* Categories strip */
.marketplace-archive .market-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 14px;
  scrollbar-width: none;
}
.marketplace-archive .market-categories::-webkit-scrollbar { display: none; }
.marketplace-archive .market-cat {
  flex: 0 0 auto;
  width: 130px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: #1D3E8A;
  box-shadow: var(--shadow);
  transition: .15s;
}
.marketplace-archive .market-cat:hover { transform: translateY(-2px); border-color: #C8D6EA; }
.marketplace-archive .market-cat img { width: 100%; height: 80px; object-fit: cover; border-radius: 10px; margin-bottom: 7px; }
.marketplace-archive .market-cat.active { border-color: var(--blue2); background: #EEF4FF; }

/* Product sections */
.marketplace-archive .market-section { margin-top: 20px; }
.marketplace-archive .section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.marketplace-archive .section-title h2 { margin: 0; font-size: 23px; color: var(--blue2); }
.marketplace-archive .section-title a { font-weight: 900; color: var(--blue); font-size: 14px; }

/* Featured product grid */
.marketplace-archive .product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.marketplace-archive .used-product {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: .15s ease;
  box-shadow: var(--shadow);
}
.marketplace-archive .used-product:hover { transform: translateY(-2px); border-color: #C8D6EA; box-shadow: 0 12px 24px rgba(16, 24, 40, .08); }
.marketplace-archive .used-product img { width: 100%; height: 160px; object-fit: cover; }
.marketplace-archive .used-product .fav { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--red); font-size: 14px; z-index: 2; }
.marketplace-archive .used-product .tag {
  position: absolute; top: 10px; right: 10px;
  background: var(--gold); color: #3a2500;
  border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 900;
  z-index: 2;
}
.marketplace-archive .used-product h3 { margin: 10px 12px 4px; font-size: 15px; line-height: 1.35; }
.marketplace-archive .used-product .meta { margin: 0 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.marketplace-archive .used-price { margin: 8px 12px; font-size: 20px; font-weight: 900; color: var(--blue2); }
.marketplace-archive .card-bottom { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 12px; }
.marketplace-archive .condition { font-size: 12px; font-weight: 900; color: var(--green); }
.marketplace-archive .time { font-size: 11px; color: var(--muted); font-weight: 700; }

/* Latest grid */
.marketplace-archive .latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.marketplace-archive .latest-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  transition: .15s;
}
.marketplace-archive .latest-card:hover { transform: translateY(-2px); border-color: #C8D6EA; }
.marketplace-archive .latest-card img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.marketplace-archive .latest-card h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; }
.marketplace-archive .latest-card strong { color: var(--blue2); font-size: 16px; }
.marketplace-archive .latest-card .meta { margin: 2px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }

/* Trust strip */
.marketplace-archive .trust-strip-market {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 24px 0;
}
.marketplace-archive .trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 13px;
  color: #344054;
}
.marketplace-archive .trust-item i { font-style: normal; font-weight: 900; color: var(--blue2); }

/* Advice grid */
.marketplace-archive .advice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.marketplace-archive .advice-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.marketplace-archive .advice-card h2 { margin: 0 0 14px; font-size: 22px; color: var(--blue2); }
.marketplace-archive .advice-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.marketplace-archive .advice-card li { padding-inline-start: 26px; position: relative; color: #344054; font-weight: 700; }
.marketplace-archive .advice-card li:before { content: "✓"; position: absolute; right: 0; color: var(--green); font-weight: 900; }
.marketplace-archive .advice-card p { color: var(--muted); font-weight: 700; margin: 0 0 14px; line-height: 1.7; }
.marketplace-archive .advice-card a.primary { background: var(--blue2); color: #fff; border-radius: 10px; padding: 12px 18px; display: inline-block; font-weight: 900; }

/* Mobile extras */
.marketplace-archive .mobile-extra-cat,
.marketplace-archive .mobile-extra-card,
.marketplace-archive .mobile-extra-latest { display: none; }

/* ===== Pagination ===== */
.marketplace-archive .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.marketplace-archive .page-link {
  width: 42px; height: 42px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center;
  font-weight: 900; color: #475467;
  box-shadow: 0 6px 14px rgba(16, 24, 40, .04);
}
.marketplace-archive .page-link.active { background: var(--blue2); color: #fff; border-color: var(--blue2); }

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  .marketplace-archive .market-hero-grid { grid-template-columns: 240px 1fr 300px; }
  .marketplace-archive .hero-image-card { width: 100%; min-width: 250px; }
  .marketplace-archive .market-layout { grid-template-columns: 240px 1fr; }
  .marketplace-archive .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .marketplace-archive .market-hero-grid { grid-template-columns: 1fr; }
  .marketplace-archive .sell-col { display: none; }
  .marketplace-archive .mobile-sell-trust { display: grid; gap: 14px; padding: 0 18px 18px; }
  .marketplace-archive .hero-image-card { display: block; width: 100%; height: 280px; }
  .marketplace-archive .market-layout { grid-template-columns: 1fr; display: block; padding: 0 12px 112px; }

  .marketplace-archive .market-filters {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    max-height: 82vh; overflow-y: auto;
    z-index: 69; border-radius: 22px 22px 0 0;
    padding: 18px 16px 24px;
    box-shadow: 0 -18px 48px rgba(16, 24, 40, .28);
    transform: translateY(110%);
    transition: transform .28s ease;
    display: block !important;
  }
  .marketplace-archive .market-filters.open { transform: translateY(0); }
  .marketplace-archive .filter-close { display: grid; place-items: center; }
  .marketplace-archive .filter-backdrop { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .54); z-index: 68; backdrop-filter: blur(2px); }
  .marketplace-archive .filter-backdrop.show { display: block; }

  .marketplace-archive .mobile-filter {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 50%; bottom: 18px; left: auto; top: auto;
    transform: translateX(50%); z-index: 70;
    min-width: 168px;
    background: var(--blue2); border-radius: 999px;
    box-shadow: 0 14px 34px rgba(11, 46, 131, .32);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .28);
  }
  .marketplace-archive .mobile-filter button {
    height: 46px; min-width: 168px; border: 0;
    background: transparent; color: #fff;
    font-weight: 900; font-family: inherit; font-size: 13px;
    padding: 0 18px;
    display: flex; align-items: center; justify-content: center; gap: 7px;
  }

  .marketplace-archive .product-grid { grid-template-columns: 1fr 1fr; }
  .marketplace-archive .latest-grid { grid-template-columns: 1fr 1fr; }
  .marketplace-archive .advice-grid { grid-template-columns: 1fr; }
  .marketplace-archive .market-categories { gap: 8px; }
  .marketplace-archive .market-cat { width: 110px; }
  .marketplace-archive .market-cat img { height: 64px; }
  .marketplace-archive .mobile-extra-cat { display: block !important; }
  .marketplace-archive .pagination { padding-bottom: 68px; }
}

@media (max-width: 640px) {
  .marketplace-archive .product-grid { grid-template-columns: 1fr; }
  .marketplace-archive .latest-grid { grid-template-columns: 1fr; }
  .marketplace-archive .market-hero-copy h1 { font-size: 28px; }
  .marketplace-archive .hero-badge { font-size: 12px; padding: 7px 11px; }
  .marketplace-archive .hero-image-card { height: 200px; }
  .marketplace-archive .mobile-extra-card { display: block !important; }
  .marketplace-archive .mobile-extra-latest { display: flex !important; }
  .marketplace-archive .trust-strip-market { gap: 8px; }
  .marketplace-archive .trust-item { font-size: 12px; padding: 8px 12px; }
}
