/* Arabz archive category rail, sponsored ads and mobile taxonomy repair */

/* Compact sponsored rail on desktop/tablet. */
body.tax-listing_category .arabz-archive-sponsored,
body.tax-location .arabz-archive-sponsored {
  display: none;
}

body.tax-listing_category .arabz-archive-sponsored__inner,
body.tax-location .arabz-archive-sponsored__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-width: 0;
}

body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system,
body.tax-location .arabz-archive-sponsored .arabz-ad-system {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 1px 2px 10px !important;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #aeb5bd #eceff2;
  -webkit-overflow-scrolling: touch;
}

body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar,
body.tax-location .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar {
  height: 6px;
}

body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-track,
body.tax-location .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-track {
  background: #eceff2;
  border-radius: 999px;
}

body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-thumb,
body.tax-location .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-thumb {
  background: #aeb5bd;
  border-radius: 999px;
}

body.tax-listing_category .arabz-archive-sponsored .arabz-ad-card,
body.tax-location .arabz-archive-sponsored .arabz-ad-card {
  flex: 0 0 340px !important;
  width: 340px !important;
  max-width: 340px !important;
  min-width: 340px !important;
  scroll-snap-align: start;
  border-radius: 13px !important;
}

/* Desktop taxonomy archives: keep all three columns in normal document flow so the footer can never overlap the final listing row. */
@media (min-width: 981px) {
  body.tax-listing_category #main-content .et_pb_row_0_tb_body.et_flex_row,
  body.tax-location #main-content .et_pb_row_0_tb_body.et_flex_row {
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr) minmax(220px, 1fr) !important;
    align-items: start !important;
    gap: 28px !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.tax-listing_category #main-content .et_pb_row_0_tb_body > .et_pb_column,
  body.tax-location #main-content .et_pb_row_0_tb_body > .et_pb_column {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    position: relative !important;
  }

  body.tax-listing_category #main-content .et_pb_section_0_tb_body,
  body.tax-listing_category #main-content .et_builder_inner_content,
  body.tax-listing_category #main-content .et-l--body,
  body.tax-location #main-content .et_pb_section_0_tb_body,
  body.tax-location #main-content .et_builder_inner_content,
  body.tax-location #main-content .et-l--body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.tax-listing_category .arabz-discovery-footer,
  body.tax-location .arabz-discovery-footer {
    clear: both !important;
    position: relative !important;
    z-index: 1;
  }
}

/* Numbered archive pagination. */
#load-more-container {
  width: 100%;
  margin: 30px 0 8px;
}

.arabz-archive-pagination ul.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: none;
  list-style: none;
}

.arabz-archive-pagination li {
  margin: 0;
}

.arabz-archive-pagination a.page-numbers,
.arabz-archive-pagination span.page-numbers {
  display: inline-flex;
  width: auto;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 13px;
  text-decoration: none;
}

.arabz-archive-pagination span.page-numbers.current {
  border-color: #e5b91f;
  background: #f7c928;
  color: #111;
  font-weight: 800;
}


@media (max-width: 980px) {
  /* Compact the global Arabz header. Keep the search icon; hide the oversized search field. */
  header.et-l--header .et_pb_section_0_tb_header,
  header.et-l--header .et_pb_row_0_tb_header,
  header.et-l--header .et_pb_row_1_tb_header,
  header.et-l--header .et_pb_row_2_tb_header {
    min-height: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  header.et-l--header .et_pb_section_0_tb_header {
    padding: 0 !important;
  }

  header.et-l--header .et_pb_row_0_tb_header {
    width: 100% !important;
    max-width: none !important;
    padding: 10px 18px !important;
  }

  header.et-l--header .et_pb_menu_0_tb_header,
  header.et-l--header .et_pb_menu_0_tb_header .et_pb_menu_inner_container {
    margin: 0 !important;
    min-height: 58px !important;
  }

  header.et-l--header .et_pb_menu__logo img {
    max-height: 48px !important;
    width: auto !important;
  }

  header.et-l--header .et_pb_code_0_tb_header,
  header.et-l--header .et_pb_row_1_tb_header {
    display: none !important;
  }

  /* Horizontal swipe rail directly below the header. */
  header.et-l--header .et_pb_row_2_tb_header {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #d9d9d9;
    background: #fff;
    overflow: hidden !important;
  }

  header.et-l--header .et_pb_row_2_tb_header .et_pb_column,
  header.et-l--header .et_pb_code_1_tb_header,
  header.et-l--header .et_pb_code_1_tb_header .et_pb_code_inner {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  header.et-l--header ul.categories {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 7px 4px 5px !important;
    list-style: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b9b9b9 transparent;
    direction: rtl;
  }

  header.et-l--header ul.categories::-webkit-scrollbar {
    height: 4px;
  }

  header.et-l--header ul.categories::-webkit-scrollbar-track {
    background: transparent;
  }

  header.et-l--header ul.categories::-webkit-scrollbar-thumb {
    background: #b9b9b9;
    border-radius: 999px;
  }

  header.et-l--header ul.categories > li.menu-item {
    flex: 0 0 78px !important;
    width: 78px !important;
    min-width: 78px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    scroll-snap-align: start;
    border-bottom: 3px solid transparent;
  }

  header.et-l--header ul.categories > li.menu-item.is-current {
    border-bottom-color: #bdbdbd;
  }

  header.et-l--header ul.categories > li.menu-item > a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    min-height: 68px !important;
    padding: 7px 4px 5px !important;
    color: #383838 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
    text-decoration: none !important;
  }

  header.et-l--header ul.categories > li.menu-item > a i {
    display: block !important;
    margin: 0 0 2px !important;
    color: #666 !important;
    font-size: 23px !important;
    line-height: 1 !important;
  }

  /* Taxonomy archive: prevent the old side widget column from overtaking the mobile layout. */
  body.tax-listing_category .et_pb_row_0_tb_body.et_flex_row,
  body.tax-location .et_pb_row_0_tb_body.et_flex_row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  body.tax-listing_category .et_pb_column_1_tb_body,
  body.tax-location .et_pb_column_1_tb_body {
    order: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 12px 14px 0 !important;
  }

  body.tax-listing_category .sidebar.et_pb_column_5_tb_body,
  body.tax-location .sidebar.et_pb_column_5_tb_body {
    display: none !important;
  }

  /* The old archive ad/sidebar column is replaced on mobile by the top sponsored rail. */
  body.tax-listing_category .ads-sidebar,
  body.tax-location .ads-sidebar {
    display: none !important;
  }

  body.tax-listing_category .arabz-archive-sponsored,
  body.tax-location .arabz-archive-sponsored {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 0 3px !important;
    overflow: hidden !important;
    background: #f7f8fa;
  }

  body.tax-listing_category .arabz-archive-sponsored__inner,
  body.tax-location .arabz-archive-sponsored__inner {
    width: calc(100% - 20px);
    margin: 0 auto;
    min-width: 0;
  }

  body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system,
  body.tax-location .arabz-archive-sponsored .arabz-ad-system {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 9px !important;
    width: 100% !important;
    padding: 1px 2px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #aeb5bd #eceff2;
    -webkit-overflow-scrolling: touch;
  }

  body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar,
  body.tax-location .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar {
    height: 6px;
  }

  body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-track,
  body.tax-location .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-track {
    background: #eceff2;
    border-radius: 999px;
  }

  body.tax-listing_category .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-thumb,
  body.tax-location .arabz-archive-sponsored .arabz-ad-system::-webkit-scrollbar-thumb {
    background: #aeb5bd;
    border-radius: 999px;
  }

  body.tax-listing_category .arabz-archive-sponsored .arabz-ad-card,
  body.tax-location .arabz-archive-sponsored .arabz-ad-card {
    flex: 0 0 clamp(245px, 72vw, 300px) !important;
    width: clamp(245px, 72vw, 300px) !important;
    min-width: clamp(245px, 72vw, 300px) !important;
    max-width: 300px !important;
    scroll-snap-align: start;
    border-radius: 13px !important;
  }

  body.tax-listing_category .arabz-archive-sponsored .arabz-ad-media,
  body.tax-location .arabz-archive-sponsored .arabz-ad-media {
    width: 100% !important;
    aspect-ratio: 2 / 1 !important;
  }

  body.tax-listing_category .arabz-tax-hero-slot,
  body.tax-location .arabz-tax-hero-slot {
    width: 100% !important;
    margin: 0 0 14px !important;
  }

  body.tax-listing_category .archive-filter-form,
  body.tax-location .archive-filter-form {
    margin: 0 0 14px !important;
    padding: 0 !important;
  }

  body.tax-listing_category .archive-filter-form select,
  body.tax-location .archive-filter-form select {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 150px;
  }

  body.tax-listing_category .list-listing-view,
  body.tax-location .list-listing-view {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
  }

  body.tax-listing_category .list-listing-view article,
  body.tax-location .list-listing-view article {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 !important;
  }

  body.tax-listing_category .listing-view,
  body.tax-location .listing-view {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.tax-listing_category .featured-banner,
  body.tax-location .featured-banner {
    height: 112px !important;
  }

  body.tax-listing_category .listing-logo-container img,
  body.tax-location .listing-logo-container img {
    width: 58px !important;
    height: 58px !important;
  }

  body.tax-listing_category .heading-content,
  body.tax-location .heading-content {
    padding: 0 10px !important;
  }

  body.tax-listing_category .listing-details-container,
  body.tax-location .listing-details-container {
    display: block !important;
    padding: 0 10px 12px !important;
  }

  body.tax-listing_category .entry-title.main_title,
  body.tax-location .entry-title.main_title {
    font-size: 15px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
  }

  body.tax-listing_category .listing-description,
  body.tax-location .listing-description {
    font-size: 12px !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  body.tax-listing_category .list-listing-view,
  body.tax-location .list-listing-view {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
