/* catalog.css - базовий стиль для каталогу, адаптивний і сучасний */

:root {
  --bg: #ffffff;
  --muted: #6b6b6b;
  --accent: #d81b60;
  --border: #e6e6e6;
  --card-shadow: 0 6px 20px rgba(15, 15, 15, 0.06);
  --radius: 12px;
}

.filter-more-btn {
  border-bottom: 1px solid rgba(38, 38, 38, 1);
  font-size: 16px;
  font-weight: 500;
  margin-top: 8px;
  cursor: pointer;
  transition: 0.1s ease;
}

.filter-more-btn:hover {
  border-bottom: 1px solid rgba(38, 38, 38, 0);
}

.s-catalog {
  padding: 60px 0 80px;
}

.s-catalog .wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  margin: 0 auto;
}

.s-catalog .title {
  display: block;
  text-align: center;
  margin-bottom: 24px;
}

/* SIDEBAR */
.catalog-sidebar {
  border: 1px solid rgba(38, 38, 38, 1);
  padding: 24px;
  height: fit-content;
  /* position: sticky; */
  /* top: 130px; */
}

.filters-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.filters-toggle {
  background: transparent;
  border: 1px solid rgba(38, 38, 38, 1);
  height: 36px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  display: none;
}

/* Filter blocks */
.filter-block {
  margin-bottom: 32px;
}

.fl-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 17px;
}

.filter-block input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
}

.filter-list {
  overflow: auto;
  position: relative;
  display: grid;
  gap: 8px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 5px;
}

.filter-checkbox input {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(38, 38, 38, 1);
  position: relative;
  border-radius: 0px;
  transition: 0.3s ease;
}

.filter-checkbox span{
  transition: 0.3s ease;
}

.filter-checkbox input:before {
  content: "";
  position: absolute;
  width: 9px;
  height: 5px;
  border-top: 2px solid rgba(38, 38, 38, 1);
  border-right: 2px solid rgba(38, 38, 38, 1);
  left: 5px;
  top: 5px;
  transform: rotate(135deg);
  display: none;
}

.filter-checkbox:hover span {
  color: rgba(160, 150, 185, 1);
}

.filter-checkbox:hover input {
  border: 1px solid rgba(160, 150, 185, 1);
}

.filter-price {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.filter-price input {
  border: 1px solid rgba(38, 38, 38, 1);
  height: 40px;
  width: 100%;
  text-align: center;
  background-color: transparent;
  font-size: 16px;
  font-weight: 500;
  font-family: "Montserrat", sans-serif;
  color: rgba(38, 38, 38, 1);
}

.filter-price input:placeholder {
  color: rgba(38, 38, 38, 1);
}

.price-range-slider {
  position: relative;
  margin-top: 24px;
  width: calc(100% - 16px);
}

.price-range-slider .noUi-handle {
  width: 16px !important;
  height: 16px !important;
  border-radius: 100%;
  border: 1.5px solid rgba(38, 38, 38, 1);
  background: rgba(212, 199, 250, 1);
  box-shadow: none;
  top: -7px !important;
}

.price-range-slider .noUi-handle::before,
.price-range-slider .noUi-handle::after {
  display: none !important;
}

/* .price-range-slider .noUi-handle.noUi-handle-upper{
  right: 0 !important;
} */

/* .price-range-slider .noUi-handle.noUi-handle-lower{
  right: -16px !important;
} */

.price-range-slider.noUi-target {
  height: 1px !important;
  box-shadow: none !important;
  border: 1px solid rgba(112, 102, 137, 1);
  border: none;
  background: rgba(112, 102, 137, 1);
}

.price-range-slider .noUi-connect {
  background: rgba(38, 38, 38, 1);
}

#filter-orderby {
  height: 36px;
  /* background-color: transparent; */
  font-size: 16px;
  font-weight: 500;
  border-radius: 0;
  font-family: "Montserrat", sans-serif;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 30px 0 12px;
  background: url("../images/CaretDown.svg") no-repeat right 12px center; /* додаємо власну стрілку */
  background-size: 16px;
  width: 220px;
  border: 1px solid rgba(38, 38, 38, 1);
}

.filter-checkbox span {
  text-transform: capitalize;
}

.filter-checkbox.active input {
  background: rgba(212, 199, 250, 1);
}

.filter-checkbox.active input:before {
  display: block;
}

/* Actions */
.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: white;
}

.btn--muted {
  background: transparent;
  border: 1px solid var(--border);
  color: #333;
}

/* MAIN */
.catalog-main {
  min-height: 400px;
  flex: 3;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.catalog-count {
  font-weight: 600;
  min-width: 332px;
}

.catalog-toolbar .filter-block {
  margin-bottom: 0;
}

.catalog-toolbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.catalog-toolbar__block {
  display: flex;
  align-items: center;
  gap: 22px;
}

.selected-categories__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
}

.selected-categories__item-remove {
  display: flex;
  cursor: pointer;
}

.clean-btn {
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: none;
}

.selected-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.catalog-loader {
  font-size: 14px;
  color: var(--muted);
}

/* Grid of products */
.products-grid,
.catalog-results .products-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(1, 1fr);
}

.products-grid > .products {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 767px) {
  .products-grid > .products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

.products-grid > .products:before {
  display: none !important;
}

/* Product card tweaks rely on WC default, but we add small card polish */
.products-grid .product {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

/* Ensure image wrap fits nicely */
.products-grid .product .woocommerce-LoopProduct-link img {
  border-radius: 10px;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* Product meta */
.products-grid .product .price {
  margin-top: auto;
  font-weight: 700;
  color: #111;
}

/* Pagination style */
.catalog-pagination {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}
.catalog-pagination ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 8px;
}
.catalog-pagination li {
}

.catalog-pagination a,
.catalog-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid rgba(38, 38, 38, 1);
  transition: 0.3s ease;
}

.catalog-pagination li .next,
.catalog-pagination li .prev {
  width: auto;
  padding: 0 8px;
  min-width: 36px;
}

.catalog-pagination .current {
  background: rgba(212, 199, 250, 1);
}

.catalog-pagination a:hover,
.catalog-pagination span:hover {
  background: rgba(245, 189, 252, 1);
}

.catalog-pagination .dots:hover {
  background-color: transparent;
}

/* Empty state*

/* Empty state */
.catalog-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-size: 16px;
}

body.filters-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}

/* --- Адаптивка --- */
@media (max-width: 1199px) {
  .novunku__item {
    width: 50%;
  }

  .filters-toggle {
    display: flex;
  }

  .catalog-inner {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding: 20px;
  }
  .catalog-sidebar.open {
    left: 0;
    z-index: 9999;
  }

  .s-catalog .wrap {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .catalog-toolbar__row {
    flex-direction: column;
    align-items: flex-start;
  }
  .catalog-toolbar__block {
    margin-bottom: 12px;
  }

  .fl-block {
    width: 100%;
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  #filter-orderby {
    width: 100%;
  }
}

/* Десктоп — фільтри завжди видимі */
.catalog-inner {
  display: flex;
  gap: 20px;
}

.catalog-sidebar {
  flex: 1;
  /*width: 250px;*/
}

/* Кнопка прихована на десктопі */

/* Мобільна версія */
@media (max-width: 768px) {
  .catalog-wrap {
    padding-left: 0;
    padding-right: 0;
  }
  .catalog-inner {
    flex-direction: column;
  }

  /* Сайдбар як виїжджаюче меню */
  .catalog-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100%;
    width: 80%;
    max-width: 300px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
  }
  .catalog-sidebar.active {
    left: 0;
  }

  body.filter-open {
    overflow: hidden;
  }
}

@media (max-width: 767px) {
  .catalog-wrap {
    margin-top: 100px;
  }
}
