/**
 * Category Ads CSS (/{category}/ads/)
 * Source: Final HTML/Marketplace/Marketplace single category page/alagheza_marketplace_tvs_category_backend_schema_speed_fixed.html
 * Template: category-alagheza_ad.php
 */

:root {
  --ag-blue: #0b57d0;
  --ag-blue-dark: #0B2E83;
  --ag-cyan: #eaf5ff;
  --ag-soft: #f5f8fc;
  --ag-border: #dbe5f1;
  --ag-text: #102033;
  --ag-muted: #627287;
  --ag-green: #13a36f;
  --ag-orange: #f59e0b;
  --ag-red: #ef4444;
  --shadow: 0 14px 35px rgba(15, 35, 65, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }

body.category-ads {
  margin: 0;
  font-family: 'Tajawal', Arial, sans-serif;
  background: var(--ag-soft);
  color: var(--ag-text);
  line-height: 1.75;
}

body.category-ads .page,
body.category-ads #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; }

.category-ads .container { width: min(1180px, calc(100% - 32px)); margin: auto; }

/* ===== Hero ===== */
.category-ads .hero { padding: 34px 0 18px; background: linear-gradient(180deg, #fff 0%, #eef6ff 100%); }
.category-ads .breadcrumbs { font-size: 13px; color: var(--ag-muted); margin-bottom: 16px; display: flex; gap: 8px; }

.category-ads .hero-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 22px;
  align-items: stretch;
}

.category-ads .hero-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 30px;
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.category-ads .hero-card:after {
  content: "";
  position: absolute;
  left: -80px;
  top: -80px;
  width: 240px;
  height: 240px;
  background: #dff0ff;
  border-radius: 50%;
  opacity: .8;
}

.category-ads .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eaf5ff;
  color: var(--ag-blue);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.category-ads h1 { margin: 0 0 12px; font-size: 38px; line-height: 1.25; position: relative; z-index: 1; }
.category-ads .hero p { margin: 0 0 18px; color: var(--ag-muted); font-size: 17px; max-width: 720px; position: relative; z-index: 1; }

.category-ads .hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.category-ads .btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.category-ads .btn-primary { background: var(--ag-blue-dark); color: #fff; box-shadow: 0 10px 24px rgba(11, 46, 131, .2); }
.category-ads .btn-light { background: #eef5ff; color: var(--ag-blue); }
.category-ads .btn-outline { background: #fff; border: 1px solid var(--ag-border); color: var(--ag-text); }

.category-ads .hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.category-ads .stat {
  background: #f8fbff;
  border: 1px solid var(--ag-border);
  border-radius: 18px;
  padding: 14px;
}

.category-ads .stat strong { display: block; font-size: 22px; color: #071b3a; line-height: 1.2; }
.category-ads .stat span { font-size: 12px; color: var(--ag-muted); font-weight: 700; }

.category-ads .side-panel { display: grid; gap: 14px; }
.category-ads .trust-card {
  background: #071b3a;
  color: #fff;
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--shadow);
  min-height: 180px;
}

.category-ads .trust-card h3 { margin: 0 0 10px; font-size: 22px; }
.category-ads .trust-card p { color: #cfe1ff; margin: 0; font-size: 15px; }

.category-ads .mini-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.category-ads .mini-card strong { display: block; margin-bottom: 4px; }

/* ===== Layout: Filters + Products ===== */
.category-ads .layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  padding: 26px 0 40px;
  align-items: start;
}

/* Filters */
.category-ads .filters {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 96px;
}

.category-ads .filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.category-ads .filter-head h2 { font-size: 20px; margin: 0; }
.category-ads .filter-clear { color: var(--ag-blue); font-weight: 900; font-size: 13px; }
.category-ads .filter-head-actions { display: flex; align-items: center; gap: 10px; }
.category-ads .filter-close { display: none; width: 34px; height: 34px; border: 1px solid var(--ag-border); border-radius: 50%; background: #fff; font-family: inherit; font-weight: 900; }

.category-ads .filter-group {
  border-top: 1px solid #eef2f7;
  padding-top: 16px;
  margin-top: 16px;
}

.category-ads .filter-group:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.category-ads .filter-title { font-weight: 900; margin-bottom: 10px; color: #172842; }

.category-ads .field { width: 100%; border: 1px solid var(--ag-border); border-radius: 14px; padding: 12px; font-family: inherit; background: #f9fbff; color: #1f2937; margin-bottom: 8px; outline: none; }

.category-ads .market-select { width: 100%; height: 42px; border: 1px solid var(--ag-border); border-radius: 12px; background: #fff; padding: 0 12px; font-family: inherit; margin-bottom: 8px; outline: none; }
.category-ads .market-input { width: 100%; height: 42px; border: 1px solid var(--ag-border); border-radius: 12px; background: #fff; padding: 0 12px; font-family: inherit; outline: none; }
.category-ads .market-range { width: 100%; accent-color: var(--ag-blue); cursor: pointer; }

.category-ads .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.category-ads .checks label { font-weight: 700; font-size: 12px; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.category-ads .checks input { width: 16px; height: 16px; accent-color: var(--ag-blue); }

.category-ads .apply-filter { width: 100%; height: 46px; border: 0; border-radius: 12px; background: var(--ag-blue-dark); color: #fff; font-family: inherit; font-weight: 900; font-size: 14px; margin-top: 6px; cursor: pointer; }
.category-ads .filter-actions { display: grid; gap: 10px; margin-top: 18px; }

.category-ads .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.category-ads .chip {
  border: 1px solid var(--ag-border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.category-ads .chip.active { background: var(--ag-blue-dark); border-color: var(--ag-blue-dark); color: #fff; }

/* Content Head */
.category-ads .content-head {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.category-ads .content-head h2 { margin: 0; font-size: 22px; }
.category-ads .content-head p { margin: 2px 0 0; color: var(--ag-muted); font-size: 14px; }
.category-ads .sort { display: flex; gap: 10px; align-items: center; }

/* Product Grid */
.category-ads .product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.category-ads .product-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 24px;
  box-shadow: 0 10px 28px rgba(15, 35, 55, .06);
  overflow: hidden;
  position: relative;
  transition: .2s ease;
}

.category-ads .product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15, 35, 55, .10); border-color: #C8D6EA; }
.category-ads .product-card.featured { border: 2px solid #f5c15e; background: linear-gradient(180deg, #fffaf0 0%, #fff 34%); }

.category-ads .product-card .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: var(--ag-blue-dark);
  line-height: 1;
}

.category-ads .product-card .badge.verified { right: auto; left: 12px; background: var(--ag-green); color: #fff; }

.category-ads .product-card .media {
  height: 172px;
  background: #edf3f7;
  position: relative;
  overflow: hidden;
}

.category-ads .product-card .media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.category-ads .product-card .card-body { padding: 15px; }

.category-ads .product-card .cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ag-muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  gap: 8px;
}

.category-ads .product-card .product-title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.45;
  margin: 0 0 8px;
  color: #13263a;
  min-height: 50px;
}

.category-ads .product-card .price {
  font-size: 22px;
  font-weight: 900;
  color: var(--ag-blue-dark);
  margin-bottom: 9px;
  line-height: 1.3;
}

.category-ads .product-card .old-price {
  font-size: 13px;
  color: var(--ag-muted);
  text-decoration: line-through;
  margin-inline-start: 6px;
  font-weight: 700;
}

.category-ads .product-card .details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.category-ads .product-card .detail {
  background: #f7fafc;
  border: 1px solid var(--ag-border);
  border-radius: 13px;
  padding: 9px;
  font-size: 12px;
  color: #526071;
  font-weight: 800;
}

.category-ads .product-card .seller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--ag-border);
  gap: 8px;
}

.category-ads .product-card .seller-info { font-size: 13px; color: #4b5563; font-weight: 800; }
.category-ads .product-card .seller-info span { display: block; color: var(--ag-muted); font-size: 12px; margin-top: 3px; }
.category-ads .product-card .card-actions { display: flex; gap: 8px; margin-top: 12px; }

.category-ads .product-card .card-actions .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

/* ===== Pagination ===== */
.category-ads .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.category-ads .page-link {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--ag-border);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #475467;
  box-shadow: 0 6px 14px rgba(16, 24, 40, .04);
}

.category-ads .page-link.active { background: var(--ag-blue-dark); color: #fff; border-color: var(--ag-blue-dark); }
.category-ads .page-link.next { width: auto; padding: 0 16px; }

/* ===== Sections ===== */
.category-ads .sections { display: grid; gap: 18px; margin-top: 20px; }
.category-ads .section-card {
  background: #fff;
  border: 1px solid var(--ag-border);
  border-radius: 26px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.category-ads .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.category-ads .section-title h2 { margin: 0; font-size: 23px; }
.category-ads .horizontal-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.category-ads .info-card {
  background: #f8fbff;
  border: 1px solid var(--ag-border);
  border-radius: 20px;
  padding: 18px;
}

.category-ads .info-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eaf5ff;
  color: var(--ag-blue);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.category-ads .info-card h3 { margin: 0 0 8px; font-size: 18px; }
.category-ads .info-card p { margin: 0; color: var(--ag-muted); font-size: 14px; }

/* Price Index */
.category-ads .price-index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.category-ads .price-index-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid #DDE8F5;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(15, 35, 55, .07);
  display: flex;
  gap: 13px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  min-height: 162px;
  transition: .2s ease;
}

.category-ads .price-index-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(15, 35, 55, .11); }

.category-ads .price-index-card.recommended { border: 2px solid rgba(246, 181, 30, .55); background: linear-gradient(180deg, #FFF9EA 0%, #fff 54%); }

.category-ads .price-index-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ag-blue-dark), #0B5CFF);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 12px 22px rgba(11, 46, 131, .20);
}

.category-ads .price-index-content { flex: 1; }
.category-ads .price-label { display: block; color: var(--ag-muted); font-size: 13px; font-weight: 900; margin-bottom: 5px; }
.category-ads .price-index-card strong { display: block; color: var(--ag-blue-dark); font-size: 22px; line-height: 1.25; margin-bottom: 6px; }
.category-ads .price-index-card small { display: block; color: #53627A; font-weight: 700; font-size: 12px; line-height: 1.6; min-height: 38px; }

.category-ads .price-meter { height: 8px; background: #E8EEF7; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.category-ads .price-meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ag-green), var(--ag-blue)); }

.category-ads .market-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #F6B51E, #FFD166);
  color: #3A2500;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 900;
}

.category-ads .price-index-note {
  margin-top: 14px;
  border: 1px solid #CFEFD8;
  background: #F3FBF5;
  border-radius: 16px;
  padding: 12px 14px;
  color: #245B3A;
  font-weight: 800;
  line-height: 1.8;
}

/* ===== FAQ ===== */
.category-ads .faq details {
  background: #f8fbff;
  border: 1px solid var(--ag-border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.category-ads .faq summary { font-weight: 900; cursor: pointer; }
.category-ads .faq p { color: var(--ag-muted); margin: 10px 0 0; }

/* ===== Mobile ===== */
.category-ads .mobile-filter { display: none; }
.category-ads .mobile-sticky { display: none; }
.category-ads .mobile-advice-cards { display: none; }
.category-ads .mobile-buying-warning { display: none; }
.category-ads .filter-backdrop { display: none; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .category-ads .hero-grid,
  .category-ads .layout { grid-template-columns: 1fr; }

  .category-ads .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;
  }

  .category-ads .filters.open { transform: translateY(0); }
  .category-ads .filter-close { display: grid; place-items: center; }
  .category-ads .filter-backdrop { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .54); z-index: 68; backdrop-filter: blur(2px); }
  .category-ads .filter-backdrop.show { display: block; }
  .category-ads .side-panel { grid-template-columns: 1fr 1fr; }
  .category-ads .product-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .category-ads .horizontal-cards,
  .category-ads .price-index-grid { grid-template-columns: 1fr 1fr; }
  .category-ads .hero-card { padding: 24px; }
  .category-ads h1 { font-size: 30px; }
  .category-ads .hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .category-ads .content-head { align-items: flex-start; flex-direction: column; }
  .category-ads .sort { width: 100%; }
  .category-ads .sort select { width: 100%; }

  .category-ads .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(--ag-blue-dark);
    border-radius: 999px;
    box-shadow: 0 14px 34px rgba(11, 46, 131, .32);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .28);
  }

  .category-ads .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;
  }

  .category-ads .pagination { padding-bottom: 68px; }
}

@media (max-width: 640px) {
  .category-ads .container { width: min(100% - 22px, 1180px); }
  .category-ads .hero { padding-top: 20px; }
  .category-ads .hero-card { border-radius: 22px; padding: 20px; }
  .category-ads .eyebrow { font-size: 12px; }
  .category-ads h1 { font-size: 25px; }
  .category-ads .hero p { font-size: 15px; }
  .category-ads .hero-actions .btn { width: 100%; justify-content: center; }
  .category-ads .hero-stats { grid-template-columns: 1fr; gap: 8px; }
  .category-ads .side-panel { grid-template-columns: 1fr; }
  .category-ads .product-grid { grid-template-columns: 1fr !important; }
  .category-ads .horizontal-cards,
  .category-ads .price-index-grid { grid-template-columns: 1fr; }

  .category-ads .product-card {
    display: grid !important;
    grid-template-columns: 104px minmax(0, 1fr) !important;
    border-radius: 16px !important;
  }

  .category-ads .product-card .media { min-height: 158px !important; height: 100% !important; }
  .category-ads .product-card .card-body { padding: 9px 10px !important; }
  .category-ads .product-card .badge { top: 7px; right: 7px; padding: 4px 7px; font-size: 9.5px; line-height: 1.2; }
  .category-ads .product-card .badge.verified { left: 7px; right: auto; }
  .category-ads .product-card .product-title { font-size: 13.5px; line-height: 1.38; margin: 0 0 4px; min-height: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .category-ads .product-card .price { font-size: 16.5px; line-height: 1.25; margin: 0 0 6px; }
  .category-ads .product-card .details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0 0 6px; }
  .category-ads .product-card .detail { padding: 5px 6px; font-size: 10px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .category-ads .product-card .seller { padding-top: 6px; }
  .category-ads .product-card .seller-info { font-size: 11px; }
  .category-ads .product-card .card-actions { grid-template-columns: 1fr 74px; }
  .category-ads .product-card .card-actions .btn { min-height: 32px; padding: 7px 8px; font-size: 11px; border-radius: 11px; }
  .category-ads .content-head h2,
  .category-ads .section-title h2 { font-size: 20px; }
}
