.cars-grid{
max-width:1360px;
margin:auto;
display:grid;
grid-template-columns:repeat(3,1fr);
gap:30px;
}

.cars-pagination {
    justify-content:center;
}

body #carsPagination .load-more-btn{
    border-radius: 300px;
    text-transform: none;
    background: linear-gradient(270deg, #6CB243 -2.56%, #247C3F 100%);
    padding: 12px 20px;
    color: #ffffff;
    font-weight: 500;
    border: none;
}
.car-title h3{
margin:0;
font-size:20px;
}

.subtitle{
font-size:14px;
color:#000000;
}

.brand{
display:flex;
align-items:center;
gap:8px;
font-weight:600;
font-size:14px;
}

.brand img{
width:22px;
height:22px;
}

.footer-col{
display:flex;
flex-direction:column;
gap:12px;
width:45%;
}

.footer-row{
display:flex;
justify-content:space-between;
align-items:center;
font-size:14px;
}

.value{
font-weight:700;
font-size:16px;
}

.footer-divider{
width:1px;
height:50px;
background:#e5e5e5;
}

@media (max-width:1024px){
.cars-grid{
grid-template-columns:repeat(2,1fr);
}
}

@media (max-width:640px){
.cars-grid{
grid-template-columns:1fr;
}
}

.car-card {
  background: #fff;
  border-radius: 20px;
  padding: 0px !important;
  box-shadow: 0px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(109, 179, 68, 1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px !important;
  height: 60px !important;
  background: rgba(109, 179, 68, 0.2);
  padding: 20px;
}

.card-image img {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.badge {
  position: absolute;
  display: flex;
  flex-direction:row;
  gap: 4px;
  top: 12px;
  right: 0 !important;
  background: linear-gradient(270deg, #6CB243 -2.56%, #247C3F 100%);
  color: #fff;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 0 !important;
  font-weight: 500;
  /* скос */
clip-path: polygon(10px 0,100% 0,100% 100%,0 100%);
  z-index: 5;
}


.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 0px !important;
  padding: 20px;
}

.card-image {
  position: relative;
  text-align: center;
  margin-top: 0px;
}

/* блок кнопок */

.card-actions {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  gap: 10px;
  z-index: 5;
}

/* круг */

/* SVG меньше круга */

.icon-btn img{

width:18px;
height:18px;

opacity:.8;

transition:all .25s ease;

}

/* hover */

.icon-btn:hover{
border-color:#27b33e;
}

/* active */

.icon-btn.active{

background:#27b33e;
border-color:#27b33e;

}

/* SVG становится белым */

.icon-btn.active img{

filter:brightness(0) invert(1);
opacity:1;

}

.card-actions button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #D8D8D8;
  background: white;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.compare-btn img {
  width: 26px;
}

.icon-btn.like-btn img {
  width: 26px !important;
}

.label {
  color: #777;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== TOP SORT BAR ===== */

.cars-toolbar{
max-width:1360px;
margin:0 auto 20px auto;
display:flex;
justify-content:space-between;
align-items:center;
}

.cars-sort select{
border:1px solid #D8D8D8;
background:#fff;
padding:8px 12px;
font-size:14px;
cursor:pointer;
}

.cars-results{
display:flex;
align-items:center;
gap:16px;
font-size:14px;
}

/* LIST VIEW */

.cars-grid.list-view .card-image{
width:320px;
flex-shrink:0;
}

/* GRID LIST BUTTONS */

.cars-view {
  display: flex;
  gap: 4px;
}

.cars-view button {
  width: 34px;
  height: 34px;
  border: 1px solid #D8D8D8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
}

.cars-view svg {
  width: 16px;
  height: 16px;
  fill: #777;
}

.cars-view button.active {
  background: #27b33e;
  border-color: #27b33e;
}

.cars-view button.active svg {
  filter: brightness(0) invert(1);
  fill: #fff;
}

/* GRID LIST SWITCH */

.cars-toolbar .cars-view{
display:flex;
gap:6px;
}

.cars-toolbar .cars-view button{

width:32px !important;
height:32px !important;

border:1px solid #D8D8D8 !important;
background:#fff !important;

display:flex;
align-items:center;
justify-content:center;

cursor:pointer;

padding:0;

}

.cars-toolbar .cars-view svg{

width:16px;
height:16px;
fill:#777;

}

.cars-toolbar .cars-view button.active{

background:#27b33e !important;
border-color:#27b33e !important;

}

.cars-toolbar .cars-view button.active svg{

fill:#fff;

}

.cars-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #D6D6D6;
  padding: 3px 12px;
  border-radius: 0px;
  width: max-content;
}

/* текст Sort by */
.cars-sort > span{
white-space:nowrap;
font-size:14px;
color:#333;
}

/* select2 контейнер */
.cars-sort .select2-container{
width:auto !important;
}

/* сам селект */
.cars-sort .select2-selection--single{
display:flex;
align-items:center;
flex-direction:row-reverse; /* ВАЖНО — разворачивает стрелку влево */
border:none !important;
height:auto !important;
padding:0;
}

/* текст внутри */
.cars-sort .select2-selection__rendered{
padding:0 !important;
line-height:normal !important;
}

/* стрелка */
.cars-sort .select2-selection__arrow{
position:static !important;
margin-right:6px;
}

/* фикс чтобы не ломалось */
.cars-sort .select2-selection{
height:auto !important;
}

.select2-dropdown.select2-dropdown--below {
  min-width: 200px;
}

/* HEADER */

/* LIST ROW hidden in grid */

/* LIST MODE CARD */

/* ПОЛНОСТЬЮ УБИРАЕМ СТАРУЮ КАРТОЧКУ */
.cars-grid.list-view .card-header,
.cars-grid.list-view .card-footer,
.cars-grid.list-view .card-image,
.cars-grid.list-view .badge,
.cars-grid.list-view .card-actions{
    display: none !important;
}

/* Показываем строку */

/* Зебра */
/*
.cars-grid.list-view .car-card:nth-child(even){
    background: #efefef;
}
*/

.cars-grid.list-view .car-card:nth-of-type(odd){
  background: #efefef;
}

.car-card .list-row .lr-col {
  text-align: center;
}

.cars-grid.grid-view {
  gap: 30px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #e1e1e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .25s ease;
  padding: 0;
  border-color: #D8D8D8 !important;
}

.lr-col.make img {
  height: 38px;
  width: 38px;
}

.table {
  padding: 8px;
}

.list_btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 5px;
}

.list-header > div, .list-row > div {
  background: unset !important;
  padding: 0px 0px !important;
}

.lr-col.table {
  padding: 13px 0px !important;
}
.lr-col.make {
  justify-content: center;
  align-items: center;
  display: flex;
  padding: 5px 0px !important;
}

#listHeader div {
  text-align: center;
  font-size: 18px !important;
  font-weight: 600;
}

#listHeader {
  display: none !important;
}

.cars-grid.list-view #listHeader{
  display: flex !important; /* или flex — как у тебя */
}

/* ================================
   LIST VIEW = TABLE
================================ */

/* 1. Убираем gap */
.cars-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0;
}

/* 2. Скрываем всё лишнее в карточке */
.cars-grid.list-view .card-header,
.cars-grid.list-view .card-image,
.cars-grid.list-view .card-footer{
  display: none;
}

/* 3. Убираем внешние отступы карточек */
.cars-grid.list-view .car-card {
  display: flex;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  border: none;
}

/* 4. Одинаковая сетка для header и строк */
.list-header,
.list-row{
  display: grid;
  grid-template-columns: 90px 140px 120px 120px 120px 1fr 1fr 100px;
  align-items: center;
}

/* 5. Header всегда видим только в list */
.list-header {
  display: none;
  grid-template-columns: repeat(9, 1fr);
  padding: 14px 20px;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

.cars-grid.list-view .list-header{
  display: grid;
}

/* 6. Строка видна только в list */
.list-row {
  display: none;
}

.cars-grid.list-view .list-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0px;
  align-items: center;
  font-size: 14px;
  color: #000;
  font-weight: 500;
}

/* 7. Табличные бордеры */
.list-header > div,
.list-row > div{
  padding: 14px 16px;
  border-right: 1px solid #dcdcdc;
  border-bottom: 1px solid #dcdcdc;
  background: #fff;
  box-sizing: border-box;
}

/* Левая граница таблицы */
.list-header > div:first-child,
.list-row > div:first-child{
  border-left: 1px solid #dcdcdc;
}

/* Верхняя граница таблицы + стиль header */
.list-header > div{
  border-top: 1px solid #dcdcdc;
  font-weight: 600;
  background: #f9f9f9;
}

/* ================================
   RESPONSIVE LIST TABLE ≤1100px
================================ */

@media (max-width:1100px){

  /* сетка становится гибкой */
  .list-header,
  .list-row{
    grid-template-columns:
      70px      /* actions */
      110px     /* price */
      90px      /* rating */
      90px      /* power */
      90px      /* range */
      minmax(140px,1fr)  /* submodel */
      minmax(140px,1fr)  /* model */
      70px;     /* make */
  }

  .list-header > div,
  .list-row > div{
    padding:10px 8px;
    font-size:13px;
  }

  .lr-col.make img{
    width:28px;
  }
}

/* ================================
   MOBILE TRANSFORM ≤768px
   из таблицы в карточки
================================ */

/* ================================
   MOBILE — HORIZONTAL SCROLL TABLE
================================ */

@media (max-width:768px) {
.card-actions{
top:10px;
left:10px;
}

.badge{
top:10px;
right:0;
}

.table-scroll{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
  }

  /* таблица не сжимается */
  .cars-grid.list-view{
    min-width:900px; /* ширина всей таблицы */
  }

  /* фиксируем нормальные колонки */
  .list-header,
  .list-row{
    grid-template-columns:
      90px
      140px
      120px
      120px
      120px
      200px
      200px
      100px;
  }
	.cars-toolbar {
		flex-direction: column-reverse;
		align-items: flex-start;
		gap: 10px;
	}
	.cars-results, .cars-sort {
		width: 100%;
		justify-content: space-between;
	}
	.car-title h3 {
		font-size: 16px;
	}
}

/* ===== PAGINATION (moved verbatim from inline <style> in footer.php) ===== */

#carsPagination {
  padding-top: 10px;
}

#carsPagination {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

#carsPagination .page-btn {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.2s ease;
}

#carsPagination .page-btn:hover {
  border-color: #999;
}

/* АКТИВНАЯ КНОПКА */
#carsPagination .page-btn.active {
  background: #22c55e;
  color: #fff !important;
  border-color: #1A9447;
}
/*pagination*/


/* =====================================================
 * Cars I liked (liked-cars.js + [gc_liked_cars])
 * ===================================================== */

/* Liked heart on a card: green circle, white heart */
.icon-btn.like-btn.active {
    background: #6CB243;
    border-color: #6CB243;
}
.icon-btn.like-btn.active img {
    filter: brightness(0) invert(1);
}

/* Header link: green heart + count once something is liked */
.header-liked-cars.has-liked i {
    color: #6CB243;
    font-weight: 900; /* solid heart glyph */
}
.header-liked-cars .gc-liked-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-inline-start: 4px;
    border-radius: 9px;
    background: #6CB243;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.header-liked-cars .gc-liked-count[hidden] {
    display: none;
}

/* The liked-cars page */
.gc-liked-page {
    margin: 30px 0 60px;
}
.gc-liked-page .gc-liked-toolbar {
    justify-content: flex-end;
}
.gc-liked-page.is-loading .cars-grid {
    min-height: 300px;
    opacity: 0.5;
}
.gc-liked-page .car-card[hidden] {
    display: none !important;
}
.gc-liked-pagination {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}
.gc-liked-more,
.gc-liked-back {
    display: inline-block;
    border: none;
    border-radius: 300px;
    background: linear-gradient(270deg, #6CB243 -2.56%, #247C3F 100%);
    color: #fff !important;
    padding: 12px 20px;
    font-weight: 500;
    text-transform: none;
    text-decoration: none;
    cursor: pointer;
}
.gc-liked-more[hidden],
.gc-liked-empty[hidden] {
    display: none;
}
.gc-liked-empty {
    text-align: center;
    padding: 60px 20px;
}
.gc-liked-empty p {
    font-size: 18px;
    margin-bottom: 20px;
}
.cars-results-liked { font-size: 14px; }
.gc-liked-page { min-height: 640px; }


/* ==========================================================
   Card header – "מותג ג'ילי" aligned with the car title line
   (header has fixed 60px height; with 20px padding + centered
   items the brand sat lower than the title)
   ========================================================== */
.car-card .card-header {
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
}
.car-card .card-header .brand {
    line-height: 16px;   /* same line box as the h3 title */
}

/* ==========================================================
   Card footer values in Hebrew – unit to the LEFT of the number
   ("204 כ״ס" read right-to-left). The footer is an LTR flex row,
   so the value itself is switched to RTL. (2026-10-13)
   ========================================================== */
html[dir="rtl"] .car-card .card-footer .footer-row .value {
    direction: rtl;
    unicode-bidi: isolate;
}

/* ==========================================================
   QA sheet BUG_12 / BUG_17 (2026-10-13)
   - long car names: the theme forces h3 line-height 16px !important,
     so 2-line titles overlapped. Give them normal spacing and let the
     header grow so the trim line under the title stays visible.
   - a bit more room between footer labels and their icons
   ========================================================== */
.car-card .card-header {
    height: auto !important;
    min-height: 60px;
}
.car-card .card-header h3 {
    line-height: 1.25 !important;
}
.car-card .card-header .brand {
    line-height: 25px;   /* = one title line */
}
.car-card .card-footer .footer-row .label {
    gap: 6px;
}

/* ==========================================================
   List view (QA BUG_01, 2026-10-13)
   The header row is a 9-column grid but the car rows were a flex
   row sized by their content, so the columns never lined up and
   long names overflowed. Give every row the same 9-column grid.
   ========================================================== */
@media (min-width: 768px) {
    .cars-grid.list-view .car-card .list-row {
        display: grid !important;
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
        align-items: center;
    }
    .cars-grid.list-view .car-card .list-row > .lr-col {
        width: auto !important;
        max-width: none !important;
        flex: none !important;
        min-width: 0;
    }
    .cars-grid.list-view .car-card .lr-col.model,
    .cars-grid.list-view .car-card .lr-col.submodel {
        white-space: normal !important;
        overflow-wrap: anywhere;
        line-height: 1.3;
        padding-inline: 6px;
    }
}

/* ==========================================================
   List view round 2 (2026-10-13)
   - every row the same height, every cell full height with the
     content centred, so the cell borders line up
   - "Load more" appended a second header row - show only the first
   ========================================================== */
@media (min-width: 768px) {
    .cars-grid.list-view .car-card .list-row {
        align-items: stretch !important;
        min-height: 64px;
    }
    .cars-grid.list-view .car-card .list-row > .lr-col {
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        height: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        box-sizing: border-box;
    }
}
.cars-grid .list-header-new ~ .list-header-new,
.cars-grid.list-view #listHeader ~ #listHeader {
    display: none !important;
}

/* Card footer: keep a clear gap between the label and the value
   (English "Price₪439,000" was touching) */
.car-card .card-footer .footer-row {
    column-gap: 10px;
}
.car-card .card-footer .footer-row .value {
    white-space: nowrap;
}

/* English pages: the footer is RTL in the theme, so "204 hp" showed as
   "hp 204" - keep values LTR when the page is LTR (2026-10-13) */
html:not([dir="rtl"]) .car-card .card-footer .footer-row .value {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Release v1 (2026-10-14): hide rating (דירוג) on car cards — grid + list view */
.car-card .card-footer .footer-row:has(.label img[src*="car_star"]){display:none !important;}
.car-card .card-footer .footer-col:has(.label img[src*="car_star"]){align-self:flex-start !important;} /* price stays on the top row */
.car-card .list-row > .lr-col:nth-child(3),
.cars-grid.list-view .car-card .list-row > .lr-col:nth-child(3){display:none !important;} /* rating column + its header */
@media (min-width:768px){
    .cars-grid.list-view .car-card .list-row{grid-template-columns:repeat(8, minmax(0, 1fr)) !important;}
}

/* Client batch 2026-10-15 — 2. hide badges (new arrival / hot deal…) on car cards, grid + list */
.car-card .card-image .badge,
.car-card img.car_badge{display:none !important;}
