/**
 * Product archive: category filter sidebar + results grid.
 *
 * Uses the theme's core custom properties so it follows the customizer's
 * primary colour automatically.
 *
 * @package themegenix
 */

@media (min-width: 992px) {
  .col-lg-9 {
    width: 75%;
  }
}

@media (min-width: 1200px) {
  .col-xl-8,
  .col-xl-9 {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
  }

  .col-xl-9 {
    width: 75%;
  }
}

@media (min-width: 1400px) {
  .col-xxl-4 {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 33.3333333333%;
  }
}

/* -------------------------------------------------- *
 * Sidebar
 * -------------------------------------------------- */

.product-filter-sidebar {
  position: sticky;
  top: 30px;
}

.product-filter-widget {
  background: var(--tg-color-white-default);
  border: 1px solid var(--tg-border-2);
  border-radius: 16px;
  padding: 26px 24px 28px;
}

.product-filter-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--tg-border-2);
}

.product-filter-widget__title {
  font-size: 20px;
  font-weight: var(--tg-fw-semi-bold);
  margin: 0;
  line-height: 1.2;
}

.product-filter-clear {
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  font-weight: var(--tg-fw-medium);
  color: var(--tg-theme-primary);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.product-filter-clear:hover {
  opacity: 0.7;
}

.product-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-filter-list > li + li {
  margin-top: 2px;
}

/* -------------------------------------------------- *
 * Filter option rows
 * -------------------------------------------------- */

.product-filter-option {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.product-filter-option:hover {
  background: var(--tg-color-smoke-1);
}

/* The native control stays focusable but visually replaced by the box. */
.product-filter-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.product-filter-option__box {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--tg-border-2);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-color-white-default);
  background: var(--tg-color-white-default);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.product-filter-option__box svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.product-filter-option--all .product-filter-option__box {
  border-radius: 50%;
}

.product-filter-option--all .product-filter-option__box::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tg-color-white-default);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.product-filter-option input:checked ~ .product-filter-option__box {
  background: var(--tg-theme-primary);
  border-color: var(--tg-theme-primary);
}

.product-filter-option input:checked ~ .product-filter-option__box svg {
  opacity: 1;
  transform: scale(1);
}

.product-filter-option--all input:checked ~ .product-filter-option__box::after {
  transform: scale(1);
}

.product-filter-option input:focus-visible ~ .product-filter-option__box {
  outline: 2px solid var(--tg-theme-primary);
  outline-offset: 2px;
}

.product-filter-option__label {
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: var(--tg-fw-medium);
  color: var(--tg-heading-color);
  line-height: 1.4;
}

.product-filter-option__count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: var(--tg-fw-medium);
  color: var(--tg-color-light-2);
  background: var(--tg-color-smoke-1);
  border-radius: 20px;
  padding: 2px 10px;
}

.product-filter-option input:checked ~ .product-filter-option__label {
  color: var(--tg-theme-primary);
}

.product-filter-empty {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--tg-color-light-2);
}

/* -------------------------------------------------- *
 * Nested sub categories
 * -------------------------------------------------- */

/* Children are always visible — the indent and rule line carry the hierarchy. */
.product-filter-sublist {
    list-style: none;
    margin: 0 0 0 20px;
    padding: 0 0 0 8px;
    border-left: 1px solid var(--tg-border-2);
}

.product-filter-sublist .product-filter-option__label {
  font-size: 15px;
  font-weight: var(--tg-fw-regular);
}

.product-filter-sublist .product-filter-option {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* -------------------------------------------------- *
 * Promo widget
 * -------------------------------------------------- */

.product-promo {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: 28px 24px 26px;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--tg-theme-primary) 0%, var(--tg-theme-secondary) 100%);
  color: var(--tg-color-white-default);
}

/* Soft light bloom in the top corner. */
.product-promo__glow {
  position: absolute;
  top: -70px;
  right: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(6px);
  pointer-events: none;
}

.product-promo__body {
  position: relative;
}

.product-promo__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: var(--tg-fw-medium);
  letter-spacing: 0.02em;
}

.product-promo__discount {
  margin: 10px 0 6px;
  font-size: 38px;
  line-height: 1;
  font-weight: var(--tg-fw-extra-bold);
  color: var(--tg-color-white-default);
}

.product-promo__title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: var(--tg-fw-semi-bold);
  color: var(--tg-color-white-default);
}

.product-promo__text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.product-promo__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 34px;
    font-weight: var(--tg-fw-bold);
    color: var(--tg-color-white-default);
    line-height: 1.1;
}

.product-promo__price del {
  font-size: 24px;
  font-weight: var(--tg-fw-regular);
  color: rgba(255, 255, 255, 0.6);
}

/* Inverted button: white on the gradient. */
.product-promo__btn,
.product-promo__btn:hover,
.product-promo__btn:focus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--tg-color-white-default);
  border-color: var(--tg-color-white-default);
  color: var(--tg-theme-primary);
    min-height: 45px;
}
.product-promo__btn::before {
    display: none;
}
.product-promo__btn:hover {
  opacity: 0.9;
}

.product-promo__note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

/* -------------------------------------------------- *
 * Mobile filter toggle
 * -------------------------------------------------- */

.product-filter-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--tg-color-white-default);
  border: 1px solid var(--tg-border-2);
  border-radius: 12px;
  font-size: 16px;
  font-weight: var(--tg-fw-medium);
  color: var(--tg-heading-color);
  cursor: pointer;
}

.product-filter-toggle__count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tg-theme-primary);
  color: var(--tg-color-white-default);
  font-size: 13px;
}

/* -------------------------------------------------- *
 * Results
 * -------------------------------------------------- */

.product-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.product-results-count {
  margin: 0;
  font-size: 16px;
  color: var(--tg-color-light-2);
}

/* Sort control, right of the result count. */
.product-sort {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.product-sort__label {
  margin: 0;
  font-size: 15px;
  color: var(--tg-color-light-2);
  white-space: nowrap;
}

.product-sort__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 11px 40px 11px 16px;
  border: 1px solid var(--tg-border-2);
  border-radius: 10px;
  background: var(--tg-color-white-default);
  font-size: 15px;
  font-weight: var(--tg-fw-medium);
  color: var(--tg-heading-color);
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease;
  height: auto;
}

.product-sort__select:hover,
.product-sort__select:focus {
  border-color: var(--tg-theme-primary);
  outline: none;
}

/* Custom caret; the native one is hidden by appearance: none. */
.product-sort__arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tg-color-light-2);
  pointer-events: none;
}

.product-results {
  position: relative;
  min-height: 200px;
}

.product-results__grid {
  transition: opacity 0.2s ease;
}

.product-results.is-loading .product-results__grid {
  opacity: 0.35;
  pointer-events: none;
}

/* Spinner overlay, only visible while a request is in flight. */
.product-results__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.product-results.is-loading .product-results__loader {
  opacity: 1;
  visibility: visible;
}

.product-results__loader span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--tg-border-2);
  border-top-color: var(--tg-theme-primary);
  animation: themegenix-product-spin 0.8s linear infinite;
}

@keyframes themegenix-product-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-results__loader span {
    animation-duration: 2s;
  }
}

.product-pagination {
  margin-top: 50px;
}

.product-pagination:empty {
  margin-top: 0;
}

/* -------------------------------------------------- *
 * Empty state
 * -------------------------------------------------- */

.product-empty {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--tg-border-2);
  border-radius: 16px;
  color: var(--tg-color-light-2);
}

.product-empty svg {
  color: var(--tg-color-light-1);
  margin-bottom: 18px;
}

.product-empty__title {
  font-size: 22px;
  font-weight: var(--tg-fw-semi-bold);
  margin: 0 0 8px;
}

.product-empty__text {
  margin: 0 0 22px;
}
.product-archive-card .product-content {
    padding: 12px;
    padding-top: 15px;
}
.product-archive-card .product-title {
    font-size: 15px;
    letter-spacing: -0.01em;
}
.product-archive-card .product-category {
    font-size: 13px;
}
.product-archive-card .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}
.product-pagination ul {
    justify-content: center;
}
/* -------------------------------------------------- *
 * Responsive
 * -------------------------------------------------- */

@media (max-width: 991px) {
  .product-filter-sidebar {
    position: static;
    display: none;
  }

  .product-filter-sidebar.is-open {
    display: block;
  }

  .product-filter-toggle {
    display: flex;
  }
}

@media (max-width: 575px) {
  .product-results-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .product-sort {
    width: 100%;
  }

  .product-sort__select {
    flex: 1 1 auto;
    width: 100%;
  }
}
