/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* ==========================================================================
   1. СТИЛИ ПО УМОЛЧАНИЮ (Стандартные карточки каталога)
   Светлый бежевый фон #EAE7E1, темно-зеленый текст, ховер рамки на palette-color-1
   ========================================================================== */

/* 1.1. Базовая flex-структура карточки, фон, рамка, скругление и паддинги */
ul.products li.product {
  --theme-card-background: #EAE7E1;
  background-color: #EAE7E1 !important;
  border: 2px solid #EAE7E1 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  padding: 0 16px 22px 16px !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease !important;
}

ul.products li.product:hover {
  border-color: var(--wp--preset--color--palette-color-1, var(--theme-palette-color-1, #f4a157)) !important;
}

/* 1.2. Картинка вплотную к верхнему и боковым краям */
ul.products li.product figure {
  margin: 0 -16px 14px -16px !important;
  padding: 0 !important;
  width: calc(100% + 32px) !important;
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
  overflow: hidden !important;
}

ul.products li.product figure img {
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
  display: block !important;
  width: 100% !important;
}

/* 1.3. Заголовок товара */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .woocommerce-loop-product__title a {
  color: var(--wp--preset--color--palette-color-3, #1A3D2D) !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-bottom: 0px !important;
}

ul.products li.product .woocommerce-loop-product__title a:hover {
  color: var(--wp--preset--color--palette-color-4, #0A1F16) !important;
}

/* 1.4. Контейнер цены и кнопки: центрированная колонка */
ul.products li.product .ct-woo-card-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-grow: 1 !important;
  width: 100% !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  border: none !important;
}

/* 1.5. Цены: по центру, серая зачеркнутая линия со строгим центрированием */
ul.products li.product .price {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  text-align: center !important;
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
  border: none !important;
  border-right: none !important;
  padding-right: 0 !important;
}

/* Сброс разделителей темы Blocksy */
ul.products li.product .price::before,
ul.products li.product .price::after,
ul.products li.product .ct-woo-card-actions::before,
ul.products li.product .ct-woo-card-actions::after {
  display: none !important;
  content: none !important;
  border: none !important;
}

ul.products li.product .price,
ul.products li.product .price ins,
ul.products li.product .price ins .amount {
  color: var(--wp--preset--color--palette-color-1, #f4a157) !important;
  font-weight: 700 !important;
  font-size: 1.15rem !important;
}

ul.products li.product .price del {
  color: #8c9b93 !important;
  font-size: 0.92rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  margin-right: 8px !important;
  text-decoration: line-through !important;
  text-decoration-color: #8c9b93 !important;
}

ul.products li.product .price del .amount {
  color: #8c9b93 !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  opacity: 0.75 !important;
  margin-right: 0 !important;
}

/* 1.6. Кнопка «В корзину»: иконка с вылетом (зеленый -> palette-color-1) */
ul.products li.product .ct-woo-card-actions .button.add_to_cart_button {
  --cart-color-default: var(--wp--preset--color--palette-color-3, #1A3D2D);
  --cart-color-hover: var(--wp--preset--color--palette-color-1, var(--theme-palette-color-1, #f4a157));

  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 0 !important;

  /* Скрытие исходного текста */
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;

  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;

  transform: none !important;
  transition: none !important;
  vertical-align: middle !important;
}

ul.products li.product .ct-woo-card-actions .button.add_to_cart_button::after {
  content: "" !important;
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  background-color: var(--cart-color-default);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath fill='black' d='M25.5 1.5a7 7 0 1 0 0 14 7 7 0 0 0 0-14zm-1.2 3.2h2.4v2.6h2.6v2.4h-2.6v2.6h-2.4V9.7h-2.6V7.3h2.6V4.7z'/%3E%3Ccircle cx='9.5' cy='31' r='2' fill='black'/%3E%3Ccircle cx='21.5' cy='31' r='2' fill='black'/%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M1.5 7h4.5l3 15.5a2.2 2.2 0 0 0 2.2 1.8h11.2a2.2 2.2 0 0 0 2.1-1.7l1.7-8.6H8'/%3E%3C/svg%3E") no-repeat center / contain !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath fill='black' d='M25.5 1.5a7 7 0 1 0 0 14 7 7 0 0 0 0-14zm-1.2 3.2h2.4v2.6h2.6v2.4h-2.6v2.6h-2.4V9.7h-2.6V7.3h2.6V4.7z'/%3E%3Ccircle cx='9.5' cy='31' r='2' fill='black'/%3E%3Ccircle cx='21.5' cy='31' r='2' fill='black'/%3E%3Cpath fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M1.5 7h4.5l3 15.5a2.2 2.2 0 0 0 2.2 1.8h11.2a2.2 2.2 0 0 0 2.1-1.7l1.7-8.6H8'/%3E%3C/svg%3E") no-repeat center / contain !important;
  pointer-events: none !important;
}

@keyframes cartFlyThroughDefault {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  45% {
    transform: translateX(150%);
    opacity: 0;
  }
  50% {
    transform: translateX(-150%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

ul.products li.product .ct-woo-card-actions .button.add_to_cart_button:hover {
  background: transparent !important;
  transform: none !important;
}

ul.products li.product .ct-woo-card-actions .button.add_to_cart_button:hover::after {
  background-color: var(--cart-color-hover) !important;
  animation: cartFlyThroughDefault 0.38s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* 1.7. Кнопка «Lasīt vairāk»: зеленый текст, ховер на palette-color-1 */
ul.products li.product .ct-woo-card-actions .button:not(.add_to_cart_button) {
  font-size: 0.95rem !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
  color: var(--wp--preset--color--palette-color-3, #1A3D2D) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 6px !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: auto !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}

ul.products li.product .ct-woo-card-actions .button:not(.add_to_cart_button)::after {
  display: none !important;
}

ul.products li.product .ct-woo-card-actions .button:not(.add_to_cart_button):hover {
  color: var(--wp--preset--color--palette-color-1, #f4a157) !important;
  text-decoration: none !important;
  background: transparent !important;
  transform: none !important;
}

/* 1.8. Wishlist бейдж */
ul.products li.product .ct-wishlist-button-archive {
  background: rgba(10, 31, 22, 0.8) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
}


/* ==========================================================================
   2. АЛЬТЕРНАТИВНЫЙ ДИЗАЙН КАРТОЧЕК (.alt-product-grid)
   Фон palette-color-3, скругление 15px, ховер рамки на palette-color-7
   ========================================================================== */

/* 2.1. Фон --theme-palette-color-3, скругление 15px, ховер на palette-color-7 */
.alt-product-grid ul.products li.product {
  --theme-card-background: var(--wp--preset--color--palette-color-3, #1A3D2D);
  background-color: var(--wp--preset--color--palette-color-3, #1A3D2D) !important;
  border: 2px solid var(--wp--preset--color--palette-color-3, #1A3D2D) !important;
  border-radius: 15px !important;
  overflow: hidden !important;
  padding: 0 16px 22px 16px !important;
  transition: border-color 0.2s ease !important;
}

.alt-product-grid ul.products li.product:hover {
  border-color: var(--wp--preset--color--palette-color-7, var(--theme-palette-color-7, #66ffcc)) !important;
}

/* 2.2. Картинка в альтернативном блоке вплотную к краям */
.alt-product-grid ul.products li.product figure {
  margin: 0 -16px 14px -16px !important;
  padding: 0 !important;
  width: calc(100% + 32px) !important;
  border-top-left-radius: 13px !important;
  border-top-right-radius: 13px !important;
  overflow: hidden !important;
}

.alt-product-grid ul.products li.product figure img {
  border-top-left-radius: 13px !important;
  border-top-right-radius: 13px !important;
  display: block !important;
  width: 100% !important;
}

/* 2.3. Заголовок товара в альтернативном блоке */
.alt-product-grid ul.products li.product .woocommerce-loop-product__title,
.alt-product-grid ul.products li.product .woocommerce-loop-product__title a {
  color: var(--wp--preset--color--palette-color-8, #ffffff) !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-bottom: 0px !important;
}

.alt-product-grid ul.products li.product .woocommerce-loop-product__title a:hover {
  color: var(--wp--preset--color--palette-color-7, #66ffcc) !important;
}

/* 2.4. Цены в альтернативном блоке */
.alt-product-grid ul.products li.product .price,
.alt-product-grid ul.products li.product .price ins,
.alt-product-grid ul.products li.product .price ins .amount {
  color: var(--wp--preset--color--palette-color-5, #EAE7E1) !important;
  font-weight: 700 !important;
  font-size: 1.15rem !important;
}

.alt-product-grid ul.products li.product .price del {
  color: rgba(234, 231, 225, 0.6) !important;
  font-size: 0.92rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  margin-right: 8px !important;
  text-decoration: line-through !important;
  text-decoration-color: rgba(234, 231, 225, 0.6) !important;
}

.alt-product-grid ul.products li.product .price del .amount {
  color: rgba(234, 231, 225, 0.6) !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  opacity: 0.75 !important;
  margin-right: 0 !important;
}

/* 2.5. Цветовые переменные альтернативного блока: palette-color-5 -> palette-color-7 */
.alt-product-grid ul.products li.product .ct-woo-card-actions .button.add_to_cart_button {
  --cart-color-default: var(--wp--preset--color--palette-color-5, var(--theme-palette-color-5, #EAE7E1));
  --cart-color-hover: var(--wp--preset--color--palette-color-7, var(--theme-palette-color-7, #66ffcc));
}

/* 2.6. Кнопка «Lasīt vairāk» в альтернативном блоке */
.alt-product-grid ul.products li.product .ct-woo-card-actions .button:not(.add_to_cart_button) {
  color: var(--wp--preset--color--palette-color-5, var(--theme-palette-color-5, #EAE7E1)) !important;
}

.alt-product-grid ul.products li.product .ct-woo-card-actions .button:not(.add_to_cart_button):hover {
  color: var(--wp--preset--color--palette-color-7, var(--theme-palette-color-7, #66ffcc)) !important;
}

/* 2.7. Скрытие кнопки Wishlist в альтернативном блоке */
.alt-product-grid ul.products li.product .ct-wishlist-button-archive {
  display: none !important;
}


/**
 * Коррекция положения мицелия: строго на нижней границе пункта меню
 */

/* 1. Делаем пункт меню относительным контейнером для псевдоэлемента */
.header-menu-1 ul.menu > li > a,
.mobile-menu ul > li > a {
  position: relative !important;
  overflow: hidden !important; /* Убирает выползание свечения за пределы ссылки */
}

/* 2. Полоса мицелия строго по нижней границе текста/блока */
.header-menu-1 ul.menu > li > a::after,
.mobile-menu ul > li > a::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important; /* Строго на нижнем крае рамки ссылки */
  width: 100% !important;
  height: 2.5px !important; /* Тонкая органическая нить */
  
  /* Био-градиент с эффектом свечения мицелия */
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    var(--wp--preset--color--palette-color-1, #f4a157) 20%, 
    var(--wp--preset--color--palette-color-7, #66ffcc) 50%, 
    var(--wp--preset--color--palette-color-1, #f4a157) 80%, 
    transparent 100%
  ) !important;
  
  background-size: 200% 100% !important;
  
  /* Исходное состояние: сжато в точку по центру */
  transform: scaleX(0) !important;
  transform-origin: center !important;
  opacity: 0 !important;
  
  box-shadow: 0 0 6px rgba(102, 255, 204, 0.5) !important;
  
  /* Органический рост */
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.25s ease, 
              background-position 0.5s ease !important;
}

/* Активный пункт меню */
.header-menu-1 ul.menu > li.current-menu-item > a::after,
.mobile-menu ul > li.current-menu-item > a::after {
  transform: scaleX(1) !important;
  opacity: 0.85 !important;
}

/* Эффект роста мицелия при наведении */
.header-menu-1 ul.menu > li > a:hover::after,
.mobile-menu ul > li > a:hover::after {
  transform: scaleX(1) !important;
  opacity: 1 !important;
  background-position: 100% 0 !important;
}