/*
Theme Name: Neve Child
Template: neve
Version: 1.1.1
*/

/* ===== Woo Checkout мелочи ===== */
.woocommerce-checkout .wc_payment_methods label{font-weight:700!important;}
.woocommerce-checkout .payment_box{font-weight:400!important;}

/* =======================================================================
   ДЕСКТОП: узкий сайдбар и СТРОГО ОДИН столбец списков внутри него
   ======================================================================= */
@media (min-width: 992px){
  .nv-sidebar-wrap, #secondary, .shop-sidebar{
    flex: 0 0 255px !important;
    max-width: 255px !important;
  }
  .nv-content-wrap{
    flex: 1 1 auto !important;
    max-width: none !important;
    min-width: 0;
  }

  /* Перебиваем любые многоколоночные стили темы / виджета категорий */
  .nv-sidebar-wrap .widget,
  #secondary .widget,
  .shop-sidebar .widget{ width:100% !important; }

  /* Списки — всегда один столбец */
  .nv-sidebar-wrap .widget_nav_menu .menu,
  .nv-sidebar-wrap .widget ul,
  #secondary .widget_nav_menu .menu,
  #secondary .widget ul,
  .shop-sidebar .widget_nav_menu .menu,
  .shop-sidebar .widget ul,
  .widget_product_categories > ul,
  .widget_product_categories .product-categories{
    -moz-column-count: 1 !important;
    column-count: 1 !important;
    column-gap: 0 !important;
    columns: 1 !important;
  }

  .nv-sidebar-wrap .widget li,
  #secondary .widget li,
  .shop-sidebar .widget li{
    break-inside: avoid-column !important;
    white-space: nowrap;
  }
}

/* =======================================================================
   БАЗОВАЯ МОБИЛЬНАЯ СЕТКА: контент на всю ширину
   ======================================================================= */
@media (max-width: 991px){
  .woocommerce .nv-main{
    width:100%!important; max-width:100%!important; margin:0 auto!important;
  }
  .woocommerce .nv-content-wrap,
  .woocommerce .site-main,
  .woocommerce .content-area{
    width:100%!important; max-width:100%!important; margin:0 auto!important;
    padding:0 15px!important; box-sizing:border-box;
  }
  img{max-width:100%; height:auto;}
}

/* =======================================================================
   Наш фильтр: комфортный скролл без «прыжков»
   ======================================================================= */
#es-filters .esf-acc-panel{ scrollbar-gutter: stable both-edges; }

/* ================== ES Filters — визуал ================== */
#es-filters.esf-wrap {
  border: 1px solid #e8e8e8;
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px 10px;
  margin-bottom: 18px;
  color: #222;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
}

/* Заголовок */
#es-filters .esf-header {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  color: #222;
}

/* ================== Аккордеоны ================== */
#es-filters .esf-accordion { border-top: 1px solid #f2f2f2; }
#es-filters .esf-accordion:first-of-type { border-top: 0; }

#es-filters .esf-acc-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;

  padding: 10px;
  margin: 8px 0 6px;

  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;

  text-align: left;
  color: #222;
  cursor: pointer;

  transition: background .15s ease, border-color .15s ease;
}
#es-filters .esf-acc-btn:hover { background: #f6f6f6; border-color: #e6e6e6; }
#es-filters .esf-acc-btn[aria-expanded="true"] .esf-caret { transform: rotate(90deg); }

/* Контент секции */
#es-filters .esf-acc-panel {
  padding: 2px 2px 8px;
  background: #fff;
  max-height: 340px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}
#es-filters .esf-acc-panel[hidden] { display: none !important; }

/* ================== Элементы значений ================== */
#es-filters label.esf-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 6px 4px;
  color: #222;
  cursor: pointer;
}
#es-filters label.esf-item span {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================== Кастомные чекбоксы ================== */
#es-filters input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;

  width: 16px;
  height: 16px;

  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;

  position: relative;
  outline: none;
}
#es-filters input[type="checkbox"]:checked {
  border-color: #5a67d8;
  background: #5a67d8;
}
#es-filters input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ================== Кнопка «Скинути» по умолчанию ================== */
#es-filters .esf-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
#es-filters .esf-clear {
  padding: 6px 12px;
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #222;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
#es-filters .esf-clear:hover { background: #eee; border-color: #ccc; }

/* ================== Универсальный стиль ================== */
#es-filters, #es-filters * { box-sizing: border-box; color: inherit; }

/* =======================================================================
   МОБИЛКА: OFF-CANVAS панель фильтров — без зазора, липкий футер, большая кнопка
   ======================================================================= */
@media (max-width: 991px){
  body.lock-scroll { overflow: hidden; }

  /* Убираем из потока исходную колонку сайдбара (чтобы не было «дырки» сверху) */
  body.woocommerce .shop-container .nv-sidebar-wrap,
  body.woocommerce .shop-container .shop-sidebar {
    display: none !important;
  }

  /* Панель (#secondary), где лежит #es-filters — закрыто по умолчанию */
  body.woocommerce #secondary.es-offcanvas{
    position: fixed !important;
    inset: 0 auto 0 0 !important;       /* top:0; left:0; bottom:0 */
    width: 88vw !important;
    max-width: 420px !important;
    height: 100vh !important;

    background: #fff !important;
    z-index: 10001 !important;
    overflow: auto !important;
    padding: 12px 12px 16px !important;
    border-right: 1px solid #eee !important;
    box-shadow: 0 0 30px rgba(0,0,0,.18) !important;
    -webkit-overflow-scrolling: touch;

    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .25s ease, visibility 0s linear .25s;
  }

  /* Открыто */
  body.sidebar-opened.woocommerce #secondary.es-offcanvas{
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .25s ease;
  }

  /* Затемнение */
  .es-filter-overlay{
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 10000;
    display: none;
  }
  body.sidebar-opened .es-filter-overlay{ display: block; }

  /* Отступ под липкий футер действий */
  body.sidebar-opened.woocommerce #secondary.es-offcanvas #es-filters{
    padding-bottom: 76px !important;
  }

  /* Липкий «подвал» действий: Скинути + Застосувати */
  #es-filters .esf-actions{
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #fff;
    margin: 10px -4px -4px;
    padding: 10px 12px;
    border-top: 1px solid #eee;

    display: flex;
    gap: 10px;
    justify-content: space-between;
  }

  /* Кнопки внизу */
  #es-filters .esf-apply,
  #es-filters .esf-clear{
    flex: 1 1 auto;
    padding: 11px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.1;
    border: 1px solid #ddd;
  }
  #es-filters .esf-apply{
    border-color: #5a67d8;
    background: #5a67d8;
    color: #fff;
  }
  #es-filters .esf-apply:active{ transform: translateY(1px); }
  #es-filters .esf-clear{ background: #f6f6f6; }

  /* Мобильная: увеличить кнопку открытия фильтров (без подписи) */
  .nv-woo-filters { padding: 6px 12px; }
  .nv-woo-filters .nv-sidebar-toggle{
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    min-width: 44px;
    padding: 10px;
    border-radius: 12px;

    background: #5a67d8;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(90,103,216,.25);
    transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
  }
  .nv-woo-filters .nv-sidebar-toggle:hover{
    background: #4c51bf;
    box-shadow: 0 8px 18px rgba(90,103,216,.3);
  }
  .nv-woo-filters .nv-sidebar-toggle:active{ transform: translateY(1px); }
  .nv-woo-filters .nv-sidebar-toggle svg{ width:20px; height:20px; flex:0 0 20px; }
  .nv-woo-filters .nv-sidebar-toggle::after{ content: none !important; }
}
/* ===== Search: уменьшить картинки категорий (только десктоп) ===== */
@media (min-width: 992px){
  /* выравниваем содержимое плитки */
  .es-search-cats ul.products li.product-category a{
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* ограничиваем картинку по высоте, чтобы не «раздувалась» */
  .es-search-cats ul.products li.product-category img{
    max-height: 170px;          /* ← можешь поставить 150–200 по вкусу */
    width: auto;                /* сохраняем пропорции */
    max-width: 100%;
    object-fit: contain;        /* вписываем без обрезки */

    /* лёгкая рамка, чтобы выглядело аккуратно */
    padding: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
  }

  /* подписи компактнее */
  .es-search-cats .woocommerce-loop-category__title{
    font-size: 14px;
    line-height: 1.3;
    margin-top: 8px;
  }
}
