/* shop page */

.woocommerce .products ul::after,
.woocommerce .products ul::before,
.woocommerce ul.products::after,
.woocommerce ul.products::before {
  display: none !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  width: unset;
  margin: unset;
}

form.woocommerce-ordering {
  display: none;
}

h1.page-title,
.cart-title,
.checkout-title {
  color: var(--color-primary);
  text-align: center;
  margin-top: 8%;
  margin-bottom: 5%;
}

/* одинаковая зона под фото в карточках каталога */
.woocommerce ul.products li.product .foh-card__media {
  display: block;
  position: relative;
  background: #fff;
  overflow: hidden;
  /* выбери один вариант:
     1) aspect-ratio — самый чистый
  */
  aspect-ratio: 3 / 4; /* или 4/5, если надо выше */
}

/* картинка всегда заполняет зону */
.woocommerce ul.products li.product .foh-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* ровняем размеры */
  object-position: center;
}

/* hover-картинка поверх основной */
.woocommerce ul.products li.product .foh-card__img--hover {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.woocommerce
  ul.products
  li.product
  .foh-card__media:hover
  .foh-card__img--hover {
  opacity: 1;
}

/* скидка не “уплывает” */
.woocommerce ul.products li.product .foh-card__discount {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
}

.shop-content .products {
  padding-top: var(--space-lg) !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 44px;
  column-gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.products .product {
  position: relative;
}

.container .woocommerce {
  padding-top: var(--space-lg);
}

/* select option */
.choices__inner,
.choices.is-focused.is-open,
.choices__inner {
  background: var(--color-gray);
  border: 1px solid var(--color-primary);
  border-radius: var(--border-sm);
}

.choices__inner {
  border-radius: var(--border-sm) !important;
}

.choices__list.choices__list--dropdown {
  border: 1px solid var(--color-primary);
  border-radius: var(--border-sm);
}

.choices__item.choices__item--choice.is-selected.choices__item--selectable.is-highlighted {
  background: var(--color-primary);
  color: var(--color-white);
}

.choices__item.choices__item--choice.choices__item--selectable.is-highlighted {
  background: var(--color-primary) !important;
  color: var(--color-white) !important;
}

.choices__item.choices__item--choice.is-selected.choices__item--selectable.is-highlighted:hover {
  background: var(--color-primary) !important;
  color: var(--color-white) !important;
}

.woocommerce-ordering {
  padding-top: var(--space-md);
}

.products.columns-4 {
  margin-bottom: 60px;
}

.woocommerce-pagination {
  margin-bottom: var(--space-xl);
}

.shop-topbar {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: space-between;
  gap: var(--space-lg);
}

ul.page-numbers {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
}

.page-title {
  margin-bottom: var(--mb-h2);
}

.page-numbers li {
  background: transparent;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100%;
  transition: all 0.5s ease;
  cursor: pointer;
}

.page-numbers li:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* кнопка */
.filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border-radius: var(--border-sm);
  border: 1px solid var(--color-primary);
  transition: all 0.5s ease;
  color: var(--color-primary);
}

.filters-toggle:hover {
  color: var(--color-white);
  background: var(--color-primary);
}

/* overlay */
.filters-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
}

.shop-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(360px, 88vw);
  background: #fff;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow: auto;
  padding: 48px var(--space-lg);
}

.shop-sidebar.is-open {
  transform: translateX(0);
}

.filters-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  border-radius: 100%;
}

.wc-block-product-filter-removable-chips__item {
  border-radius: var(--border-sm) !important;
}

.wp-block-button__link.has-text-align-center.wp-element-button {
  background: var(--color-primary);
  border-radius: var(--border-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.wc-block-product-filter-price-slider__range {
  --range-color: var(--color-primary);
}

.wc-block-product-filter-price-slider__content input {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-primary);
  border-radius: var(--border-sm);
  color: var(--color-primary);
  padding: var(--space-xs);
}

.wc-block-product-filter-price-slider .text input[type="text"] {
  border-radius: var(--border-sm);
}

.wc-block-product-filter-checkbox-list__input-wrapper:before {
  background: var(--color-primary);
}

.product-swiper {
  width: 50%;
}

.product-main {
  display: flex;
  align-items: flex-start;
  margin-bottom: 72px;
  padding-top: 72px;
  gap: var(--space-lg);
}

.shop-content {
  position: relative;
}

.woocommerce-notices-wrapper {
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 50;
}

.woocommerce-message {
  border-radius: var(--border-sm);
  border: 0;
  color: var(--color-white);
  background: var(--color-primary);
}

.product-swiper
  .swiper.product-swiper-main.swiper-initialized.swiper-horizontal.swiper-backface-hidden {
  margin-bottom: var(--space-md);
}

.product-swiper .swiper-slide {
  border-radius: var(--border-sm);
  overflow: hidden;
}

.onsale {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  color: var(--color-white);
  background: var(--color-primary);
  border-radius: var(--space-md);
  padding: var(--space-sm);
}

.product-info.summary.entry-summary {
  width: 100%;
}

.product_title.entry-title {
  margin-bottom: var(--mb-h2);
}

.product-info .price {
  font-size: 20px;
  margin-bottom: var(--space-md);
}

.woocommerce-product-details__short-description {
  display: none;
}

.variations tbody tr {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.reset_variations {
  position: absolute;
  background: var(--color-primary);
  border-radius: var(--border-sm);
  bottom: 0;
  display: inline-block;
  text-align: center;
  color: var(--color-white);
  padding: 2px 12px;
}

.woocommerce:where(body:not(.woocommerce-uses-block-theme)) div.product p.price,
.woocommerce:where(body:not(.woocommerce-uses-block-theme))
  div.product
  span.price {
  color: var(--color-primary);
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  #respond
  input#submit.alt,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  a.button.alt,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  button.button.alt,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  input.button.alt,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  #respond
  input#submit.alt,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  a.button.alt,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  button.button.alt,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  input.button.alt {
  background-color: var(--color-primary);
  transition: all 0.5s ease;
}

.woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-enabled {
  display: flex;
  align-items: center;
}

.woocommerce-message:focus-visible {
  outline: none;
}

.woocommerce div.product .product_title {
  color: var(--color-primary);
}

.variations tbody {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.variations select {
  background: var(--color-white);
  border: 1px solid var(--color-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-sm);
}

.variations select {
  background: var(--color-white);
  border: 1px solid var(--color-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-sm);

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.variations select option {
  background: var(--color-white);
  color: #000;
}

.variations select option:checked {
  background: var(--color-primary) !important;
  color: #fff !important;
}

td:focus-visible {
  outline: none;
}

.input-text.qty.text {
  width: 100%;
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
}

button.single_add_to_cart_button.button.alt.disabled.wc-variation-selection-needed,
.single_add_to_cart_button.button.alt {
  background: var(--color-primary);
  width: 100%;
  padding: var(--space-sm);
  border-radius: var(--border-sm);
  color: #ffffff;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-sm);
}

.product_meta {
  font-size: var(--fs-sm);
}

ul.tabs.wc-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: var(--space-lg);
  text-align: center;
}

.wc-tabs li {
  background: transparent;
  border-radius: var(--border-sm);
  padding: var(--space-sm) var(--space-md);
  transition: all 0.5s ease;
}

.wc-tabs li.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.wc-tabs li:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.woocommerce-tabs.wc-tabs-wrapper {
  margin-bottom: var(--space-xl);
}

.woocommerce-variation.single_variation {
  margin-bottom: var(--space-lg);
}

.woocommerce-product-attributes.shop_attributes tbody {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.woocommerce-product-attributes-item__label {
  color: var(--color-primary);
  margin-right: var(--space-md);
  display: inline-block;
}

p.comment-form-comment {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

textarea#comment {
  border: 1px solid var(--color-primary);
  border-radius: var(--border-md);
  padding: var(--space-md);
}

#commentform .form-submit input {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
}

.commentlist {
  margin-bottom: var(--space-lg);
}

.comment_container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.comment-reply-title {
  font-family: var(--text-accent);
  margin-bottom: var(--space-sm);
  font-size: var(--fs-h3);
}

ul.tabs.wc-tabs li {
  width: 100%;
}

.related {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
}

.related .products {
  grid-template-columns: repeat(4, 1fr) !important;
}

section.related.products {
  display: unset !important;
}

/* product page slider */

.swiper.product-swiper-main.swiper-initialized.swiper-horizontal.swiper-backface-hidden {
  height: 80vh;
}

.product-swiper-main .swiper-slide.swiper-slide-active {
  height: 80vh;
}

.product-swiper-main .swiper-slide.swiper-slide-active img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

section.up-sells.upsells.products {
  display: block !important;
}

/* cart */

.cart-title {
  padding-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.wp-block-woocommerce-cart.alignwide {
  padding-top: var(--space-lg);
  position: relative;
  z-index: 0;
}

.wc-block-components-totals-item__value {
  color: var(--color-primary);
}

#wc-block-components-totals-coupon__input-coupon {
  border: 1px solid var(--color-primary);
  border-radius: var(--border-sm);
}

.wc-block-components-button.wp-element-button.wc-block-components-totals-coupon__button.contained {
  color: var(--color-primary);
}

.wc-block-components-product-price__value.is-discounted,
.wc-block-formatted-money-amount.wc-block-components-formatted-money-amount.wc-block-components-product-price__value {
  font-size: 20px;
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

.wp-block-woocommerce-cart-order-summary-block {
  background: var(--color-gray);
  padding: var(--space-md);
  border-radius: var(--border-md);
}

.wc-block-cart__submit.wp-block-woocommerce-proceed-to-checkout-block {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--border-sm);
}

td.wc-block-cart-item__image {
  width: 30%;
}

.wc-block-cart-item__image a img {
  border-radius: var(--border-sm);
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  #respond
  input#submit.alt:hover,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  a.button.alt:hover,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  button.button.alt:hover,
.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles))
  input.button.alt:hover,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  #respond
  input#submit.alt:hover,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  a.button.alt:hover,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  button.button.alt:hover,
:where(body:not(.woocommerce-block-theme-has-button-styles)):where(
    :not(.edit-post-visual-editor)
  )
  .woocommerce
  input.button.alt:hover {
  background: rgba(127, 181, 181, 0.95);
}

/* chekout  */

.wp-block-woocommerce-checkout-order-summary-block
  .wc-block-components-product-price__value.is-discounted.wc-block-components-order-summary-item__individual-price,
.wp-block-woocommerce-checkout-order-summary-block
  .wc-block-formatted-money-amount.wc-block-components-formatted-money-amount.wc-block-components-product-price__value.wc-block-components-order-summary-item__individual-price {
  font-size: unset;
}

.wp-block-woocommerce-checkout-order-summary-block {
  border-radius: var(--border-sm);
}

.wc-block-components-address-form__country.wc-block-components-country-input {
  margin-top: 12px !important;
}

.wc-block-components-form.wc-block-checkout__form input,
.wc-blocks-components-select .wc-blocks-components-select__select {
  background: var(--color-gray) !important;
  border-bottom: 1px solid var(--color-primary) !important;
  border-radius: var(--border-sm) !important;
  color: var(--color-black) !important;
  padding: 12px !important;
}

.wc-block-components-form
  .wc-block-components-text-input
  input:-webkit-autofill
  + label,
.wc-block-components-form .wc-block-components-text-input.is-active label,
.wc-block-components-text-input input:-webkit-autofill + label,
.wc-block-components-text-input.is-active label {
  top: 4px;
  transform: scale(0.5);
}

.wc-block-components-form.wc-block-checkout__form
  #checkbox-control-0.wc-block-components-checkbox__input {
  border-radius: 0 !important;
}

.wc-block-components-checkbox label {
  display: flex;
  align-items: center;
}

.wp-block-woocommerce-checkout.alignwide.wc-block-checkout {
  margin-bottom: var(--space-xl);
}

.wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button.contained {
  background: var(--color-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-sm);
  color: var(--color-white);
}

.categories-menu {
  padding: var(--space-lg);
}

.categories-menu__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.img_wrapper {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 100%;
}

.img_wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.categories-menu__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

@media screen and (max-width: 768px) {
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .products.columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-main {
    flex-direction: column;
  }
  .product-swiper {
    width: 100%;
  }
  .related .products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  ul.tabs.wc-tabs {
    flex-direction: column;
    width: 100%;
  }
  .woocommerce ul.products[class*="columns-"] li.product,
  .woocommerce-page ul.products[class*="columns-"] li.product {
    width: unset;
  }
}

@media screen and (max-width: 745px) {
  .wc-block-cart-items__row {
    display: flex !important;
    justify-content: space-between;
    gap: 8px;
  }
  .wc-block-cart-item__image {
    flex: 3;
  }
  .wc-block-cart-item__product {
    flex: 5;
  }
  .wc-block-cart-item__total {
    flex: 2;
  }
  .wc-block-cart-items.wp-block-woocommerce-cart-line-items-block tbody {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }
}

@media screen and (max-width: 540px) {
  .woocommerce-result-count {
    display: none;
  }
  .shop-topbar {
    flex-direction: row;
  }
  .swiper.product-swiper-thumbs.swiper-initialized.swiper-horizontal.swiper-free-mode.swiper-watch-progress.swiper-backface-hidden.swiper-thumbs
    .swiper-slide {
    height: unset !important;
  }
  .reset_variations {
    position: unset;
    margin-top: var(--space-md);
  }
  .shop-content .products {
    row-gap: 0;
  }
}
