/**
 * Единый вид action-кнопок (#2563eb) — везде, кроме хедера/футера (кроме попапа мини-корзины).
 */
:root {
  --esm-action-btn-bg: #2563eb;
  --esm-action-btn-bg-hover: #1d4ed8;
  --esm-action-btn-color: #fff;
  --esm-action-btn-radius: 4px;
  --esm-action-btn-min-height: 42px;
  --esm-action-btn-font-size: 14px;
  --esm-action-btn-weight: 700;
}

.esm-cart-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Основной контент + страницы WooCommerce */
#main .woocommerce a.button,
#main .woocommerce button.button,
#main .woocommerce input.button,
#main .woocommerce #respond input#submit,
#main .woocommerce a.button.alt,
#main .woocommerce button.button.alt,
#main .woocommerce input.button.alt,
.woocommerce-cart #main a.button,
.woocommerce-cart #main button.button,
.woocommerce-cart #main input.button,
.woocommerce-checkout #main a.button,
.woocommerce-checkout #main button.button,
.woocommerce-checkout #main input.button,
.woocommerce-account #main a.button,
.woocommerce-account #main button.button,
.woocommerce-account #main input.button,
#mini-cart .cart-popup .buttons a.button,
#mini-cart .cart-popup .buttons a.checkout,
.widget_shopping_cart .buttons a.button,
.widget_shopping_cart .buttons a.checkout,
.wc-proceed-to-checkout a.checkout-button,
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order,
.esm-loop-cart-btn,
.euro-home-product__cart,
.esm-cookie__accept {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  min-height: var(--esm-action-btn-min-height) !important;
  height: auto !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: var(--esm-action-btn-radius) !important;
  background: var(--esm-action-btn-bg) !important;
  background-color: var(--esm-action-btn-bg) !important;
  background-image: none !important;
  color: var(--esm-action-btn-color) !important;
  font-family: "Manrope", "Segoe UI", sans-serif !important;
  font-size: var(--esm-action-btn-font-size) !important;
  font-weight: var(--esm-action-btn-weight) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12) !important;
  transition: background 0.15s ease, color 0.15s ease;
}

#main .woocommerce a.button:hover,
#main .woocommerce button.button:hover,
#main .woocommerce input.button:hover,
#main .woocommerce #respond input#submit:hover,
#main .woocommerce a.button.alt:hover,
#main .woocommerce button.button.alt:hover,
#main .woocommerce input.button.alt:hover,
.woocommerce-cart #main a.button:hover,
.woocommerce-cart #main button.button:hover,
.woocommerce-cart #main input.button:hover,
.woocommerce-checkout #main a.button:hover,
.woocommerce-checkout #main button.button:hover,
.woocommerce-checkout #main input.button:hover,
.woocommerce-account #main a.button:hover,
.woocommerce-account #main button.button:hover,
.woocommerce-account #main input.button:hover,
#mini-cart .cart-popup .buttons a.button:hover,
#mini-cart .cart-popup .buttons a.checkout:hover,
.widget_shopping_cart .buttons a.button:hover,
.widget_shopping_cart .buttons a.checkout:hover,
.wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce #payment #place_order:hover,
.woocommerce-page #payment #place_order:hover,
.esm-loop-cart-btn:hover,
.euro-home-product__cart:hover,
.esm-cookie__accept:hover {
  background: var(--esm-action-btn-bg-hover) !important;
  background-color: var(--esm-action-btn-bg-hover) !important;
  color: var(--esm-action-btn-color) !important;
}

/* Убираем иконки Porto/FA на action-кнопках */
#main .woocommerce .add_to_cart_button:before,
#main .woocommerce .add_to_cart_button:after,
.single-product .single_add_to_cart_button:before,
.single-product .single_add_to_cart_button:after {
  display: none !important;
  content: none !important;
}

/* Иконка корзины на «В корзину» без разметки */
.single-product form.cart .single_add_to_cart_button:not(:has(.esm-cart-icon))::before,
.single-product .product-summary-wrap .single_add_to_cart_button:not(:has(.esm-cart-icon))::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Мини-корзина: обе кнопки на всю ширину */
#mini-cart .cart-popup .buttons,
.widget_shopping_cart .buttons {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  margin: 0 !important;
}

#mini-cart .cart-popup .buttons a.button,
#mini-cart .cart-popup .buttons a.checkout,
.widget_shopping_cart .buttons a.button,
.widget_shopping_cart .buttons a.checkout {
  width: 100% !important;
  float: none !important;
  display: flex !important;
  box-sizing: border-box;
  text-align: center !important;
  white-space: normal !important;
}

.wc-proceed-to-checkout a.checkout-button {
  width: 100% !important;
  text-align: center !important;
}

.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order {
  width: 100% !important;
}
