/* =========================
   BASE
   ========================= */
*,*::before,*::after{ box-sizing:border-box }
html,body{ margin:0; padding:0 }
img{ max-width:100%; height:auto; display:block }


:root{
  --brand:#1c9675;
  --brand-dark:#0d7258;
  --brand-cta:#1a9675;
  --accent:#FF6163;
  --text:#232323;
  --muted:#999;
  --ui:#e2e6ea;
  --line:#b8c7cc;
  --white:#fff;
  --shadow:0 1px 4px rgba(0,0,0,.08);
}

body{
  font-family:"GTEestiPro","Arial",sans-serif;
  color:var(--text);
  background:#F5F5F5;
  overflow-x:hidden;
}

a{ text-decoration:none; color:inherit }
a.outline{ text-decoration:underline }

h4{ color:#009CF0 }
h4:hover{ color:var(--accent) }

/* Защита от горизонтального скролла */
html, body{ max-width:100%; overflow-x:hidden }


/* =========================
   HEADER (desktop / base)
   ========================= */
.container{
  position:fixed; top:0; left:0; right:0;
  display:flex; align-items:center; justify-content:center;
  height:40px; width:calc(100% - 14px);
  margin:8px auto 0;
  padding:0 7px;
  background:var(--brand);
  border-radius:5px;
  font-family:"Roboto","Arial",sans-serif;
  font-size:16px;
  z-index:1000; transition:.3s;
  box-shadow:var(--shadow);
}

.container a{ color:var(--white) }

/* Логотип AGRO + SHOP (без правок HTML) */
.agro{ width:135px; flex-shrink:0; font-weight:800 }
.agro > a{
  display:inline-flex; align-items:center; gap:2px;
  padding:0; margin:0; font-size:0; white-space:nowrap;
}
.agro > a::before,
.agro > a::after{
  font-size:16px; font-weight:800; line-height:1; letter-spacing:.04em;
}
.agro > a::before{
  content:"AGRO";
  background:var(--white); color:var(--brand);
  padding:1px 6px; border-radius:4px;
}
.agro > a::after{ content:"SHOP"; color:var(--white) }
.agro a .agro_title_very_span{ display:none !important }

/* Навигация (десктоп): только цвет/ховер (без логики auth) */
.cont_center{ margin:0 4px; color:var(--white) }
.cont_center:hover{ color:var(--accent) }
.cont_left{ color:var(--white) }
.cont_left:hover{ color:var(--accent) }
.cont_right{ color:var(--white) }

/* Поиск в шапке (база) */
.search{ text-align:center; margin:0 30px; position:relative }
.search input[type=text]{
  width:400px; height:27px; border-radius:5px; border:1px solid var(--line); padding:0 12px;
}
.search input[type=submit]{
  height:30px; cursor:pointer; border-radius:999px; border:1px solid var(--brand-cta);
  color:#e2e6ea; background:var(--brand); font-weight:bold; padding:0 16px;
}
.search input[type=submit]:hover{ transform:scale(1.025) }

/* Выпадашка поиска (якорится под .search) */
.search_result{
  position:absolute; top:calc(100% + 6px); left:0; right:0;
  width:auto; max-height:320px; overflow:auto;
  padding:8px 0; border:1px solid #cfe7e3; border-radius:8px;
  background:#fff; box-shadow:0 8px 24px rgba(0,0,0,.12);
  z-index:50; display:none; opacity:0; transform:translateY(-4px);
  transition:opacity .15s ease, transform .15s ease;
}
.search_result--open{ display:block; opacity:1; transform:translateY(0) }
.search_result:empty{ display:none !important; }
.search_result a, .search_result .item{ display:block; padding:8px 12px; color:#232323 }
.search_result a:hover, .search_result .item:hover{ background:#f2f6f5 }

/* "Главная" скрыта всегда */
.cont_left{ display:none !important; }

/* =========================
   LAYOUT (общий)
   ========================= */
.content{ padding-top:50px; min-height:calc(100vh - 182px) }

/* Левая колонка категорий (десктоп) */
.flex_container{ display:flex }
.wrapper{
  display:grid; grid-template-columns:repeat(4,1fr);
  width:95%; margin-left:auto; margin-right:auto;
}
.wrapper a{ color:#333; word-wrap:break-word }

.flex_container .wrapper > .wrapper_category{ margin-bottom:10px }

/* Новое объявление */
.new_tovar{
  display:flex; align-items:center; justify-content:center;
  background:var(--ui); margin-top:20px; border-radius:5px;
  width:calc(100% - 16px);
}
.new_tovar_title{ color:var(--brand) }
.black-text{ color:#000 }


/* =========================
   GRID карточек (десктоп)
   ========================= */
.product_table{
  display:grid; 
  grid-template-columns:repeat(5,20%);
  width:96%; 
  margin:0 auto; 
  padding-top:15px;
}
.product{ margin-top:20px; color:var(--muted) }

.product_card{
  margin:5px; cursor:pointer; border-radius:5px; transition:.3s; background:var(--white);
  padding:5px; position:relative;
}

/* Картинка оплачена */

.product_card.hover:hover {
  transform: scale(1.01);
}

.product_card.pay {
  box-shadow:
    0 0 0 1px #009CF0,
    0 10px 20px rgba(0, 156, 240),
    inset 0 0 0 1px rgba(0, 156, 240);
}

.product_card.pay.hover:hover {
  box-shadow:
    0 0 0 2px #009CF0,
    0 12px 25px rgba(0, 156, 240);
  transform: scale(1.015);
}

.product_pictures_box {
  position: relative;
}

.badge-star {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;

  transform-origin: 40% 90%;
  animation: fire-flicker 7s ease-in-out infinite;
}


@keyframes fire-flicker {
  0% {
    transform: rotate(-3deg) scale(1);
  }
  25% {
    transform: rotate(2deg) scale(1.05);
  }
  50% {
    transform: rotate(-2deg) scale(0.97);
  }
  75% {
    transform: rotate(3deg) scale(1.07);
  }
  100% {
    transform: rotate(-3deg) scale(1);
  }
}

/* Картинка в карточке (десктоп) */
.product_pictures_box{
  position:relative; overflow:hidden; width:100%; height:200px;
  border-radius:5px; margin-right:5px; display:flex; justify-content:center;
}
.product_pictures{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:220px; height:220px; object-fit:cover; margin:0; border-radius:5px;
}
.product_text_box{ width:100%; text-align:center; padding:0 5px 8px }


/* =========================
   FOOTER
   ========================= */
.footer{
  display:flex; flex-flow:row wrap; justify-content:space-around;
  height:76px; margin-top:50px; background:var(--brand); border-radius:5px; text-align:center;
  width:calc(100% - 20px); margin-left:auto; margin-right:auto; padding:0 10px;
}
.footer_one,.footer_zero{ display:flex; justify-content:center; align-items:center }
.footer_zero{ color:var(--white) }
.footer div div{ margin:5px 0 }
.foot{ cursor:pointer; color:var(--white) }
.foot:hover{ color:var(--accent) }

.footer_one img{
    transition: transform 0.2s ease;
}

.footer_one img:hover{
    transform: scale(1.03);
}

/* =========================
   Профиль — боковые отступы у сетки на мобиле
   ========================= */
@media (max-width:480px){
  body[data-page="profile"] .product_table{
    padding-left:12px !important; padding-right:12px !important; gap:10px !important;
  }
}


/* =========================
   BUTTONS (ЛК/Подать) — общий вид кнопок
   ========================= */
.cont_left,.cont_right{
  align-items:center; justify-content:center;
  height:34px; padding:0 14px; border-radius:999px;
  font-weight:600; cursor:pointer; transition:.2s;
}
.cont_right{ background:var(--brand-cta); color:var(--white); border:1px solid #178f71 }
.cont_right:hover{ background:var(--brand-dark) }
.cont_left{ background:transparent; color:var(--white); border:1px solid rgba(255,255,255,.5) }
.cont_left:hover{ background:rgba(255,255,255,.15) }


/* =========================
   HEADER: AUTH POLICY (единый стандарт)
   Гость: показываем "Подать объявление" (.cont_right), скрываем "Личный кабинет" (.cont_left)
   Авторизован: наоборот
   ========================= */
.cont_left{ display:none; }
.cont_right{ display:inline-flex; }

body[data-auth="1"] .cont_left{ display:inline-flex; }
body[data-auth="1"] .cont_right{ display:none; }


/* =========================
   CARD PAGE: отступы текста
   ========================= */
.bottom_product_title, .bottom_product_card{
  margin-left:12px !important; 
  margin-right:10px !important;
}


/* =========================
   MEDIA QUERIES (desktop→tablet)
   ========================= */
@media (max-width:1475px){
  .product_table{ grid-template-columns:repeat(4,25%) }
}

@media (max-width:991px){
  .flex_container{ flex-direction:column }
  .request_table.category{ width:90% }
  .wrapper{ padding:0; grid-template-columns:50% 50%; width:100%; margin-left:0 }
  .wrapper_category{
    margin:0 !important;
    padding:4px 6px;
    box-sizing:border-box;
  }

  .agro{ margin-right:0 }

  .new_tovar{ width:100% }
  .new_tovar_title{ margin-right:0 }

  .product_table{ width:100%; grid-template-columns:repeat(2,50%) }

  .footer div{ width:100% }
  .footer{
    display:grid; grid-template-columns:repeat(2,50%);
    height:auto; padding:10px; width:95%;
  }

  .product_card{ flex-direction:column }
  .product_card.category{ margin:0 }

  .product_pictures_box{ margin-left:auto; margin-right:auto }

  .content{ min-height:max(500px,calc(100vh - 220px)); padding-top:50px }
}



@media (max-width:600px){
  .product_table{ gap:8px; padding-left:8px; padding-right:8px }
  .home_switch_button{ padding:6px 8px }
}
@media (max-width:420px){
  .container{ gap:6px; padding:6px 6px }
  .search input[type="text"]{ height:34px; padding:0 78px 0 10px }
  .search input[type="submit"]{ height:28px; padding:0 10px }
  .home_switch{ gap:6px }
  .home_switch_button{ padding:6px 6px }
}
@media (max-width:360px){
  .container{ padding:5px 6px; gap:6px; border-radius:10px }
  .home_switch_button{ padding:5px 6px }
  .product_table{ gap:6px; padding-left:6px; padding-right:6px }
  .product_card{ border-radius:5px }
  .product_pictures_box{ border-radius:6px }
}


/* =========================
   AUTH PAGE (мобайл)
   ========================= */
@media (max-width:991px){
  .auth-page .content, body.auth-page .content{
    padding-top:15px !important;
  }
}


/* =========================
   CATEGORY TITLE ICON
   ========================= */
.cont_grup_icon{ display:inline-flex; align-items:center; gap:6px; }
.grup_icon{
  width:20px; height:20px; display:inline-block !important;
  object-fit:contain; margin-right:6px; flex-shrink:0; vertical-align:middle;
}
@media (max-width:420px){ .grup_icon{ width:18px; height:18px; } }



/* Самые маленькие экраны: компактная шапка */
@media (max-width: 380px){
  .container{ font-size:14px; }

  .agro > a::before,
  .agro > a::after{ font-size:14px; }

  .cont_left,
  .cont_right{
    height:30px;
    padding:0 10px;
    font-size:13px;
  }
}

/* Фикс перекрытия категорий на мобильной версии */
@media (max-width: 480px){
  .cat_cols{
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .cat_col{
    width: 100% !important;
    margin-bottom: 20px;
  }
  .cat_col h3{
    font-size: 16px;
    line-height: 1.2;
    word-break: break-word;
  }
}

/* NEWS (desktop) */
@media (min-width: 992px){
  .information_page_text{
    width:calc(100% - 40px); margin:0 auto; padding-left:20px; padding-right:20px;
    line-height:1.65; font-size:17px;
  }
  .information_title, .information_title h1{
    width:calc(100% - 40px); margin:16px auto 20px; padding:0 20px; text-align:left;
  }
  .information_page_img:first-of-type img,
  .information_page_text img:first-of-type{
    display:block; margin:20px auto; border-radius:10px; max-width:100%; height:auto;
  }
  .information_page_text_img img,
  .information_page_text img:not(:first-of-type){
    display:block; margin:16px auto 16px 10px; border-radius:8px; max-width:calc(100% - 20px); height:auto;
  }
  .information_page_text h2, .information_page_text h3{ margin:22px 0 12px; line-height:1.3; }
  .information_page_text ul, .information_page_text ol{ padding-left:22px; margin:10px 0 14px; }
}

/* ПОЛИТИКА КОНФИДЕНЦИАЛЬНОСТИ */
.page_container { max-width:1180px; margin:0 auto; padding:20px 12px 60px; }
.page_title { margin:0 0 8px; font-size:22px; font-weight:700; }
.page_citydate { margin:0 0 20px; color:#666; }
.policy_text { font-size:15px; line-height:1.6; text-align:justify; color:#232323; }
.legal_text { font-size:15px; line-height:1.7; color:#232323; }
.legal_text h3 { margin:24px 0 10px; font-size:18px; }
.legal_text ol { padding-left:20px; margin:0 0 8px; }
.legal_text ol > li { margin:6px 0; }
@media print {
  header, footer, .site-footer, .site-header, .no-print { display:none !important; }
  .page_container { max-width:none; padding:0; }
  .legal_text { font-size:12pt; line-height:1.6; }
}

/* ссылки в карточках запросов (вкладка "Спрос") */
.request_table a { color:#0066ff;
  text-decoration:none;
  display:block;
  margin:2px 4px 6px 2px;
  line-height:1.4;
  border-radius:4px;
  transition:
    color .18s ease,
    transform .18s ease,
    background-color .18s ease;
}

.request_table a:hover {
  color:#004ecc;
  background-color: rgba(0, 102, 255, 0.06);
  transform: scale(1.01);
}


/* === MB ONLY (≤767px): сообщения — карточная вёрстка === */
@media (max-width: 767px){
  .message_inner { width:100%; border-collapse:separate; border-spacing:0; }
  .message_inner .table_header { display:none !important; }
  .message_inner .card_message_line {
    display:block; margin:12px 0; padding:12px 14px;
    border:1px solid #eaecee; border-radius:12px; background:#fff;
    box-shadow:0 1px 2px rgba(17,24,39,.04);
  }
  .message_inner .card_message_line > td { display:block; width:100%; padding:6px 0; border:0; }
  .message_date_card { font-size:13px; line-height:1.3; color:#6b7280; margin-bottom:2px; text-align:left; }
  .td_text_pre_profile .message_text_card a {
    display:block; font-size:15px; line-height:1.45; color:#111827; text-decoration:none; word-wrap:break-word;
  }
  td[data-label="Отправитель"] { font-size:13.5px; color:#374151; }
  .message_is_reading_card, .message_reply_card {
    display:inline-block; font-size:12.5px; color:#6b7280; margin-right:12px;
  }
  .msg-row .msg-snippet { margin:4px 0 2px; }
  .msg-row .message_reply_card { margin-top:2px; }
}

/* === Подсветка непрочитанного (десктоп + мобайл) === */
/* базовое (прочитано) */
.msg-row .msg-status,
.msg-row .msg-snippet a{ color:#222; font-weight:400; text-decoration:none; }
/* непрочитано — жирный заголовок + красная точка слева */
.msg-row.unread .msg-snippet a{ font-weight:700; }
.msg-row.unread .msg-snippet a::before{
  content:""; display:inline-block; width:8px; height:8px; margin-right:8px;
  border-radius:50%; background:#ef4444; vertical-align:middle;
}
.msg-row.unread .msg-status{ color:#222; font-weight:600; }

/* ==== MB: правки сообщений — видимость текста и компактность ==== */
@media (max-width: 767px){
  .message_inner .card_message_line{ margin:10px 0; padding:10px 12px; }
  .message_inner .card_message_line > td{ padding:4px 0; }
  .message_inner .card_message_line .right{ text-align:left !important; }

  .td_text_pre_profile .message_text_card a{
    white-space:normal !important;
    overflow:visible !important;
    word-break:break-word;
    hyphens:auto;
    line-height:1.45;
    display:block;
  }

  .msg-row .msg-snippet{ margin:2px 0 0; }
  .message_is_reading_card,
  .message_reply_card{ font-size:12px; margin-right:10px; }
}

/* текст в сообщениях не обрезаем */
.msg-text a,
.msg-snippet a{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:break-word;
}

/* не прячем лишнее у всей карточки */
.message_inner .card_message_line{ overflow:visible; }

/* INVEST PROJECT: форма сообщения автору */
.card_message_container{
  max-width:720px;
  margin:18px auto;
  padding:12px;
  background:#fff;
  border:1px solid #eaecee;
  border-radius:12px;
  box-shadow:0 1px 2px rgba(17,24,39,.04);
}
.card_message_container .card_message_label{
  display:block;
  margin:6px 0 8px;
  font-weight:600;
}
.card_message_container textarea{
  width:100%;
  min-height:140px;
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius:10px;
  resize:vertical;
}
.card_message_container button{
  margin-top:10px;
  padding:10px 16px;
  border:0;
  border-radius:10px;
  background:#1f8c68;
  color:#fff;
  cursor:pointer;
}
.card_message_container button:hover{ filter:brightness(.96); }

/* --- Планшеты (iPad, 768–1199 px) --- */
@media (min-width: 768px) and (max-width: 1199.98px){

  /* Шапка на планшете — обычная (не fixed) */
  .container{
    position:static;
    top:auto; left:auto; right:auto;
    width:calc(100% - 20px);
    margin:10px auto 0;
    height:auto;
    border-radius:10px;
    padding:10px 14px;
  }

  /* Кнопка "Подать объявление" на планшете — без рамки и мягче по шрифту */
  .cont_right{
    border:none;
    font-weight:500;
    background:var(--brand);
  }

  /* Контент без лишнего зазора под fixed-шапку */
  .content{ padding-top:24px; }

  .flex_container{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch;
    gap:12px;
  }

  .flex_container .wrapper{
    width:100% !important;
    padding-left:0 !important;
    grid-template-columns:repeat(2, 1fr) !important;
    row-gap:10px !important;
    column-gap:16px !important;
  }

  #home-cats-products{ display:block; }

  .wrapper_category{ margin:0 0 12px 0; }

  .cont_grup_icon{
    display:flex;
    align-items:center;
    padding:10px 12px;
    border-radius:8px;
  }

  .cont_grup_icon .grup_icon{
    width:28px;
    height:28px;
    margin-right:8px;
    flex-shrink:0;
  }

  .cont_grup_icon h4{
    font-size:14px;
    line-height:1.3;
    margin:0;
  }

  .home_screen_title,
  .home_screen_header{ margin-bottom:12px; }
}


/* =========================
   PREMIUM LIST CARD (all_product + category)
   ========================= */

/* Контейнер списка товаров: делаем колонки как у Авито */
.product_table--list{
  display:flex;
  flex-direction:column;
  gap:12px;
  width:90%;
  margin:0 auto;
}

/* Отключаем старую GRID-логіку */
.product_table--list.product_table{ grid-template-columns:none; }

/* Карточка в режиме списка */
.product_card--list{
  display:flex;
  align-items:stretch;
  gap:16px;
  margin:0;
  padding:10px 14px;
  border-radius:10px;
  background:#ffffff;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}

/* Псевдо-авитовская «подложка» при ховере */
.product_card--list.hover:hover{
  transform:none;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}

/* Левая колонка с фото */
.product_card--list .product_pictures_box{
  flex:0 0 260px;
  max-width:260px;
  height:180px;
  margin:0;
  border-radius:10px;
}

/* Правая колонка с текстом */
.product_card--list .product_text_box{
  flex:1 1 auto;
  width:auto;
  padding:4px 0 0 0;
  text-align:left;
}

/* Название + цена — плотнее друг к другу */
.product_card--list .product_text_box a,
.product_card--list .product_text_box b,
.product_card--list .product_text_box .product{ display:block; }

/* Цена отдельной строкой, как у Авито */
.product_card--list .product_text_box .product{
  font-weight:600;
  font-size:16px;
  color:#000 !important;
  margin-bottom:4px;
}

/* Описание — более спокойное */
.product_card--list .product_text_box div,
.product_card--list .product_text_box span{
  font-size:13px;
  line-height:1.35;
}

/* Убираем слишком синий цвет описания в списке */
.product_card--list .product_text_box div:not(.product){ color:#6b7280; }

/* =========================
   ГАЛЕРЕЯ ВНУТРИ КАРТОЧКИ
   ========================= */
.product-gallery{
  display:flex;
  flex-direction:column;
  height:100%;
}

.product-gallery__main{
  position:relative;
  flex:1 1 auto;
  border-radius:10px;
  overflow:hidden;
}

.product-gallery__main img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

.product-gallery__thumbs{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  margin-top:6px;
}

.product-gallery__thumbs img{
  width:40px;
  height:40px;
  border-radius:6px;
  object-fit:cover;
  opacity:.6;
  cursor:pointer;
  border:1px solid transparent;
  transition:opacity .15s ease, border-color .15s ease, transform .15s ease;
}

.product-gallery__thumbs img.is-active{
  opacity:1;
  border-color:#1c9675;
  transform:translateY(-1px);
}

/* =========================
   Адаптив
   ========================= */
@media (max-width:1199px){
  .product_card--list .product_pictures_box{
    flex-basis:220px;
    max-width:220px;
    height:160px;
  }
}

@media (max-width:991px){
  .product_table--list{ width:100%; }
  .product_card--list{ padding:10px; }
}

@media (max-width:991px){
  .flex_container .wrapper{ min-width:0 !important; }
  .wrapper_category{ min-width:0; }
}



@media (max-width:600px){
  .product_card--list{
    border-radius:0;
    box-shadow:none;
    border-bottom:1px solid #eceff1;
  }
  .product_card--list .product_pictures_box{
    flex-basis:140px;
    max-width:140px;
    height:120px;
  }
}

@media (max-width:420px){
  .product_card--list{
    gap:8px;
    padding:8px 6px;
  }
  .product_card--list .product_pictures_box{
    flex-basis:120px;
    max-width:120px;
    height:110px;
  }
  .product-gallery__thumbs img{
    width:34px;
    height:34px;
  }
}

/* === Премиальный список: "Все товары" и категории === */

/* Карточка-строка: фото слева, текст справа */
.product_table.category{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:2px 8px;
  width:100%;
  margin:0;
}

/* Основная карточка */
.product_card.category{
  padding:0 !important;
  display:flex;
  align-items:stretch;               /* важно: чтобы фото тянулось по высоте */
  border-radius:15px;
  overflow:hidden;                   /* фото будет скругляться краем карточки */
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,0.04);
  margin:0;
}

/* Ссылка-обёртка (левая зона) */
.product_card.category > a{
  display:flex;
  align-items:stretch;
  width:100%;
  gap:0;                             /* никаких микро-щелей */
  text-decoration:none;
}

.product_card.category .pl-card_media{
  width:240px;
  height:200px;
  border-radius:0;      /* если нужно “до края” */
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Блок с фото */
.product_card.category .product_pictures_box.category{
  width:220px !important;
  max-width:220px;
  height:180px;
  margin:0 !important;
  overflow:hidden;
  background:transparent;
}

/* Сами изображения */
.product_card.category .product_pictures_box.category img.product_pictures{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Текстовая часть справа */
.product_card.category .product_text_box.category{
  flex:1 1 auto;
  text-align:left;
  padding:16px 18px;                 /* переносим отступы сюда */
}

/* ===== Премиальный список: стили pl-card__* ТОЛЬКО внутри category ===== */
.product_card.category .pl-card__title{
  font-weight:600;
  font-size:16px;
  color:#0D47A1;
  margin-bottom:4px;
}

/* Цена */
.product_card.category .pl-card__price{
  font-size:15px;
  margin-bottom:6px;
}
.product_card.category .pl-card__price-label{ color:#717375; }
.product_card.category .pl-card__price-value{
  color:#111827;
  font-weight:600;
}

/* Описание */
.product_card.category .pl-card__descr{
  margin-top:4px;
  font-size:14px;
  color:#4b5563;
  line-height:1.35;
}

/* Точки-индикаторы слайдера */
.pl-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:rgba(255,255,255,0.6);
  border:1px solid rgba(0,0,0,0.2);
}
.pl-dot.active{ background:#ffffff; }

/* Контейнер картинки в списках (аналог Avito) */
.pl-card_media{
  width:240px;
  height:200px;
  border-radius:5px;
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* первая картинка показана по умолчанию */
.pl-card_media .product_pictures:first-child{ display:block; }

.pl-card_media .product_pictures_box.home{
  width:100%;
  height:220px;
  position:relative;
  overflow:hidden;
  border-radius:10px;
}

.pl-card_media .product_pictures_active{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Контейнер точек внутри картинки */
.pl-dots{
  position:absolute;
  bottom:8px;
  right:8px;
  display:flex;
  gap:4px;
  z-index:5;
}


/* ===== Mobile: карточки — описание 1–2 строки ===== */
@media (max-width: 767.98px){

  /* Заголовок — 1 строка */
  .product_card .product_text_box .pl-card__title,
  .product_card .product_text_box .pl-card__title a,
  .product_card .product_text_box .product_title,
  .product_card .product_text_box .product_title a{
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:1;
    overflow:hidden;
    word-break:break-word;
  }

  /* Цена — не режем */
  .product_card .product_text_box .pl-card__price,
  .product_card .product_text_box .pl-card__price-value,
  .product_card .product_text_box .product,
  .product_card .product_text_box .product_price{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  /* Описание — 2 строки */
  .product_card .product_text_box .pl-card__descr,
  .product_card .product_text_box .product.pl-card__descr,
  .product_card .product_text_box .product_desc,
  .product_card .product_text_box .product_description,
  .product_card .product_text_box .product_text,
  .product_card .product_text_box p{
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:5;
    overflow:hidden;
    word-break:break-word;
    margin-bottom: 20px;
  }
}


/* =========================================================
   KartColorContractFinal — единая типографика карточек
   ========================================================= */

/* TITLE */
.product_card .pl-card__title,
.product_card .pl-card__title a,
.product_card .product_text_box .pl-card__title,
.product_card .product_text_box .pl-card__title a,
.product_card .product_text_box a,
.product_card .product_text_box .product_title,
.product_card .product_text_box .product_title a{
  color:#0D47A1 !important;
  font-weight:600 !important;
}

/* PRICE */
.product_card .pl-card__price-value,
.product_card .product_text_box .pl-card__price-value,
.product_card .product_text_box .product_price{
  color:#10c44c !important;
  font-weight:700 !important;
  font-size:20px !important;
}

/* SECONDARY */
.product_card .pl-card__price-label,
.product_card .pl-card__descr,
.product_card .product.pl-card__descr,
.product_card .product_text_box .pl-card__price-label,
.product_card .product_text_box .pl-card__descr,
.product_card .product_text_box .product.pl-card__descr,
.product_card .product_text_box .product_desc,
.product_card .product_text_box .product_description,
.product_card .product_text_box .product_text,
.product_card .product_text_box p{
  color:#6B7280 !important;
  font-weight:400 !important;
}


/* =========================================================
   AUTH FIX — НЕ УДАЛЯЕМ СТАРОЕ, А ПЕРЕКРЫВАЕМ НИЖЕ
   В main.html:
   cont_left = "Главная"
   cont_center = "Личный кабинет"
   cont_right = "Подать объявление"
   ========================================================= */

/* База (все экраны): гость — ЛК скрыт, "Подать" видно */
.cont_center{ display:none; }
.cont_right{ display:inline-flex; }

/* База (все экраны): авторизован — ЛК видно, "Подать" скрыто */
body[data-auth="1"] .cont_center{ display:inline-flex; }
body[data-auth="1"] .cont_right{ display:none; }



/* =========================================================
   HEADER (MOBILE) — стабильно в один ряд + поиск вниз
   ========================================================= */
@media (max-width: 420px){

  /* ВАЖНО: работаем с .container (и так есть class="container"), чтобы
     перекрывать базовую мобильную шапку на 768px */
  .container{
    display:flex !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    gap:8px !important;
    justify-content:flex-start !important; /* ключ: убираем space-between */
  }

  /* "Главная" и "Новости" на мобилке скрыты */
  .cont_left{ display:none !important; }
  .header-link--news, .header-link.header-link--news{ display:none !important; }

  /* Сброс: именно это чаще всего ломает ряд (ЛК уезжает вправо и давит лого) */
  body[data-auth="1"] .cont_center{
    margin-left:0 !important;
    flex:0 0 auto !important;
    white-space:nowrap;
  }

  /* Гость: ЛК/Вход скрыт, "Подать" показано */
  body:not([data-auth="1"]) .cont_center{ display:none !important; }
  body:not([data-auth="1"]) .cont_right{
    display:inline-flex !important;
    order:1 !important;
    margin:0 !important;
    flex:0 0 auto !important;
    white-space:nowrap;
  }

  /* Авторизован: "Подать" скрыто (как у тебя по политике), ЛК показан */
  body[data-auth="1"] .cont_right{ display:none !important; }
  body[data-auth="1"] .cont_center{
    display:inline-flex !important;
    order:1 !important;
  }

  /* Иконки: не растягиваем строку */
  .header_actions{
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
    order:2 !important;
    flex:0 0 auto !important;
  }
  body:not([data-auth="1"]) .header_actions{ display:none !important; }

  /* Лого строго вправо */
  .agro{
    order:3 !important;
    margin-left:auto !important;
    flex:0 0 auto !important;
  }

  /* Поиск всегда второй строкой */
  .search, form.search{
    order:4 !important;
    width:100% !important;
    margin-top:6px !important;
  }
}



/* Иконки — нормальные размеры */
.header_actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:20px;
}

.header_icon{
  position:relative;
  width:36px;
  height:36px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  background: rgba(0,0,0,.04);
}

.header_icon img{
  width:20px;
  height:20px;
  display:block;
}

.header_badge{
  position:absolute;
  top:4px;
  right:4px;
  min-width:18px;
  height:18px;
  padding:0 2px;
  border-radius:999px;
  background:#ff3b30;
  color:#fff;
  font-size:12px;
  line-height:18px;
  text-align:center;
  font-weight:700;
}

/* 3) Extra small: ещё компактнее по бокам */
@media (max-width: 420px){
  .product_table.category{
    padding:2px 8px !important;
    gap:6px !important;
  }
  .product_card.category .product_text_box.category{
    padding:9px 10px !important;
  }
}


/* Мобильная политика (≤768px): "Главная" всегда скрыта.
   Гость: только "Подать"
   Авторизован: только "Личный кабинет" */
@media (max-width: 768px){
  .cont_left{ display:none !important; }

  body:not([data-auth="1"]) .cont_center{ display:none !important; }
  body:not([data-auth="1"]) .cont_right{ display:inline-flex !important; }

  body[data-auth="1"] .cont_center{ display:inline-flex !important; }
  body[data-auth="1"] .cont_right{ display:none !important; }
}

/* 2) Mobile: карточка компактнее, фото без внутренних отступов */
@media (max-width: 768px){

  /* Сетка/лист: меньше боковых полей */
  .product_table.category{
    padding:2px; !important;   /* 4px слева/справа/сверху/снизу */
    gap:6px !important;       /* компактнее между карточками */
  }

  /* Карточка: без внутренних паддингов, чтобы фото было «до края» */
  .product_card.category{
    padding:0 !important;     /* важно: убираем твои 12px 14px */
    border-radius:12px;       /* чуть компактнее */
    overflow:hidden;
  }

  /* Фото-зона: занимает всю ширину, без “дырок” */
  .product_card.category .pl-card_media{
    width:100% !important;
    height:auto !important;
    border-radius:0 !important;
    overflow:hidden;
    margin:0 !important;
  }

  .product_card.category .product_pictures_box.category{
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    aspect-ratio: 1 / 1;     /* можно 1/1 если хочешь квадрат */
    margin:0 !important;
    border-radius:0 !important;
    overflow:hidden;
  }

  /* Картинка: впритык, без лишних скруглений внутри */
  .product_card.category .product_pictures_box.category img.product_pictures{
    width:100% !important;
    height:100% !important;
    object-fit:cover !important;
    border-radius:0 !important;
    margin:0 !important;
    display:block;
  }

  /* Текст: только здесь оставляем “воздух” */
  .product_card.category .product_text_box.category{
    padding:10px 12px !important;   /* компактнее, чем 16/18 */
  }

  /* Сердце/иконки: чтобы не отъезжали из-за padding */
  .product_card.category .favorite,
  .product_card.category .favorite_icon,
  .product_card.category .heart{
    margin:0 !important;
  }
}


/* CHANGE PRODUCT (мобайл) */
@media (max-width: 768px){
  .container_pr{
    width:calc(100% - 2px) !important;
    margin:12px auto 0 !important;
    padding:4px !important;
    background:var(--white);
    border-radius:10px;
    box-shadow:0 2px 6px rgba(0,0,0,0.08);
  }

  .container_pr input[type="text"],
  .container_pr input[type="number"],
  .container_pr input[type="email"],
  .container_pr textarea,
  .container_pr select{
    width:100%;
    border-radius:8px;
    border:1px solid var(--line);
    padding:8px 10px;
    font-size:15px;
    box-sizing:border-box;
    margin-bottom:10px;
  }

  .go_product{
    display:block;
    width:100%;
    background:var(--brand);
    color:var(--white);
    border:none;
    border-radius:999px;
    padding:10px 0;
    font-weight:600;
    font-size:16px;
    text-align:center;
    margin-top:10px;
  }

  .go_product:hover{ background:var(--brand-dark); }

  .container_pr img{
    display:block;
    width:100%;
    border-radius:10px;
    margin:10px auto;
  }
  .agro{
    width:auto !important;        /* убираем фикс 135px */
    flex:0 1 auto !important;     /* разрешаем сжиматься */
    min-width:0 !important;
  }
}
/* ЛК (мобайл): поля и Новости */
@media (max-width: 768px){
  .profile_screen_container{ padding-left:12px !important; padding-right:12px !important; }
  .profile_screen_inner{ gap:12px; }
  .profile_screen{ padding-left:4px !important; padding-right:4px !important; }
  body[data-page="profile"] .product_table, .profile_ads_grid{
    padding-left:12px !important; padding-right:12px !important; gap:10px !important; }
  .information_page_text{ padding-left:14px !important; padding-right:14px !important; }
  .information_title{ padding-left:12px !important; padding-right:12px !important; text-align:left !important; }
  .information_page_text img{
    border-radius:8px; display:block; margin:10px auto; max-width:calc(100% - 10px); height:auto;
  }
}

/* =========================
   MOBILE (≤768px) — ПРАВИЛЬНЫЙ (без перекрытий паддингов)
   ========================= */
@media (max-width: 768px){

  .container{
    position:static;
    top:auto; left:auto; right:auto;
    display:flex; align-items:center; justify-content:space-between;
    flex-wrap:wrap; gap:8px;
    padding:8px 10px;
    height:auto;
    border-radius:12px;
    background:var(--brand);
    width:calc(100% - 16px);
    margin:4px auto 0;
  }

  .agro{ order:1; margin:0 }
  .cont_left,.cont_right{ order:3 }

  .search{
    order:4; width:100%; margin:6px 0 0; position:relative; text-align:initial;
  }
  .search input[type="text"]{
    width:100%; height:36px; border-radius:999px;
    padding:0 86px 0 12px; border:1px solid var(--line); background:var(--white);
  }
  .search input[type="submit"]{
    position:absolute; top:3px; right:3px; height:30px; padding:0 12px; border-radius:999px;
    border:1px solid #178f71; background:var(--brand); color:var(--white); font-weight:700;
  }

  .hero-banner{
    width:calc(100% - 16px);
  }

  /* GRID-карточки (обычная сетка товаров) */
  .product_card{ margin:0; border-radius:8px; }

  .product_pictures_box{
    position:relative !important;
    display:block !important;
    width:100% !important;
    height:auto !important;
    aspect-ratio:1 / 1 !important;
    border-radius:8px;
    overflow:hidden;
    margin:0 0 6px 0 !important;
  }
  .product_pictures{
    position:absolute !important; 
    inset:0 !important;
    width:100% !important; 
    height:100% !important; 
    object-fit:cover !important;
    border-radius:0 !important; 
    margin:0 !important; 
    transform:none !important; 
    left:0 !important; 
    top:0 !important;
  }
  .product_text_box{ padding:0 2px 2px }

  /* Категории на главной / списки */
  .wrapper_category ul,
  .wrapper .wrapper_category > ul,
  .wrapper .category_list,
  #home-cats-products ul,
  #home-cats-requests ul,
  .request_table.category ul{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    column-gap:14px; row-gap:6px !important;
    padding-left:0; margin:8px 0 0 0; list-style:disc inside;
  }
  .wrapper_category ul[hidden]{ display:none !important }
  .wrapper_category ul > li,
  .request_table.category li{ min-width:0; overflow-wrap:anywhere }

  /* Контент под обычную (не фикс) шапку */
  .content{ padding-top:18px; }

  /* Кнопка "Подать объявление" на мобилке — без рамки и мягче */
  .cont_right{
    border:none;
    font-weight:500;
    background:var(--brand);
    padding:8px 14px;
  }

  /* 1) "Главная" на мобилке не показываем никогда */
  .cont_left{ display:none !important; }
  body:not([data-auth="1"]) .cont_center{ display:none !important; }

  #container{ gap:8px; }
  .agro{ order:1; }
  .cont_right{ order:2; }

  /* ===== ПРЕМИУМ-СПИСОК В КАТЕГОРИЯХ (category) — ТОЛЬКО РАСКЛАДКА, БЕЗ padding ===== */
  .product_table.category{
    padding:2px;
    gap:6px;
  }

  .product_card.category{
    flex-direction:column;
    padding:0;              /* важно: не ставим 12/14, чтобы не было конфликта */
    border-radius:12px;
    overflow:hidden;
  }

  .product_card.category > div:first-child{ justify-content:center; }

  /* Фото до края */
  .product_card.category .pl-card_media{
    width:100%;
    height:auto;
    border-radius:0;
    overflow:hidden;
    margin:0;
  }

  .product_card.category .product_pictures_box.category{
    width:100%;
    max-width:100%;
    height:auto;
    aspect-ratio:1 / 1;
    margin:0;
    border-radius:0;
    overflow:hidden;
  }

  .product_card.category .product_pictures_box.category img.product_pictures{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:0;
    margin:0;
    display:block;
  }

  /* Отступы только у текста */
  .product_card.category .product_text_box.category{
    width:100%;
    padding:10px 12px;
  }

  /* LIST-карточки (product_card--list) */
  .product_card--list{ gap:10px; }
  .product_card--list .product_pictures_box{
    flex-basis:160px;
    max-width:160px;
    height:140px;
  }
  .product-gallery__thumbs{ justify-content:flex-start; }
  .header_actions{ margin-left:0px; }
}
