/* All styles are opt-in, scoped to WooCommerce pages only. Colors from CorsoSnacks identity. */
body.cs-shop {
  --cs-accent: #ad8753;
  --cs-dark: #182420;
  --cs-cream: #f8f6f1;
  --cs-line: #e9e6df;
  --cs-radius: 16px;
  --cs-focus: 0 0 0 3px rgba(173,135,83,.28);
}
body.cs-shop :where(.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce button.single_add_to_cart_button, .wc-block-components-button) {
  min-height: 44px;
  border-radius: 10px;
  transition: background-color .17s ease, box-shadow .17s ease, transform .17s ease;
  font-weight: 650;
}
body.cs-shop :where(.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .wc-block-components-button):focus-visible,
body.cs-shop :where(input, textarea, select, button, a):focus-visible {
  outline: 2px solid var(--cs-accent);
  outline-offset: 3px;
}
body.cs-shop .woocommerce a.button.alt,
body.cs-shop .woocommerce button.button.alt,
body.cs-shop .woocommerce input.button.alt,
body.cs-shop .wc-block-components-button:not(.is-link) {
  background-color: var(--cs-dark);
  border-color: var(--cs-dark);
  color: #fff;
}
body.cs-shop .woocommerce a.button.alt:not(:disabled):hover,
body.cs-shop .woocommerce button.button.alt:not(:disabled):hover,
body.cs-shop .woocommerce input.button.alt:not(:disabled):hover,
body.cs-shop .wc-block-components-button:not(.is-link):not(:disabled):hover {
  background-color: #273a32;
  border-color: #273a32;
  color: #fff;
}
body.cs-shop .woocommerce :where(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  border-radius: 10px;
  border-top-color: var(--cs-accent);
  background: var(--cs-cream);
  padding: 16px 18px 16px 50px;
  color: var(--cs-dark);
}
body.cs-shop .woocommerce :where(.woocommerce-message, .woocommerce-info)::before {
  color: var(--cs-accent);
}
/* WooCommerce product archive uses native Woo markup; do not replace the theme templates. */
body.cs-shop-catalog .woocommerce ul.products li.product {
  box-sizing: border-box;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  padding: 14px;
  background: #fff;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
body.cs-shop-catalog .woocommerce ul.products li.product:hover {
  border-color: #d6c8ad;
  box-shadow: 0 14px 28px rgba(24,36,32,.07);
}
body.cs-shop-catalog .woocommerce ul.products li.product a img {
  border-radius: 11px;
  object-fit: contain;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #faf9f6;
  margin-bottom: 12px;
}
body.cs-shop-catalog .woocommerce ul.products li.product .woocommerce-loop-product__title,
body.cs-shop-catalog .woocommerce ul.products li.product h2.woocommerce-loop-product__title {
  color: var(--cs-dark);
  line-height: 1.42;
  font-weight: 650;
  font-size: clamp(15px, 1.15vw, 18px);
  padding: 0;
  margin: 4px 0 9px;
}
body.cs-shop-catalog .woocommerce ul.products li.product .price {
  color: var(--cs-dark);
  font-weight: 720;
  margin: 0 0 12px;
}
body.cs-shop-catalog .woocommerce ul.products li.product .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 10px 16px;
  text-decoration: none;
}
/* Single product: retain Woo variation form and all attributes, avoiding checkout changes. */
body.cs-shop-single.cs-shop-product .woocommerce div.product div.images img {
  border-radius: var(--cs-radius);
  background: #faf9f6;
}
body.cs-shop-single.cs-shop-product .woocommerce div.product .product_title {
  color: var(--cs-dark);
  font-weight: 730;
  letter-spacing: -.025em;
  line-height: 1.16;
}
body.cs-shop-single.cs-shop-product .woocommerce div.product p.price,
body.cs-shop-single.cs-shop-product .woocommerce div.product span.price {
  color: var(--cs-dark);
  font-weight: 750;
}
body.cs-shop-single.cs-shop-product .woocommerce div.product form.cart :where(input.qty, select) {
  min-height: 44px;
  background: #fff;
  border: 1px solid #d6d5cf;
  border-radius: 9px;
  color: var(--cs-dark);
}
body.cs-shop-single.cs-shop-product .woocommerce div.product form.cart .single_add_to_cart_button {
  padding: 12px 22px;
}
body.cs-shop-single.cs-shop-product .woocommerce div.product .woocommerce-tabs {
  margin-top: 30px;
}
body.cs-shop-single.cs-shop-product .woocommerce div.product .woocommerce-tabs .panel {
  line-height: 1.65;
}
/* Both classic WooCommerce and supported block-level public component surfaces. */
body.cs-shop-order .woocommerce :where(input.input-text, textarea, select),
body.cs-shop-order :where(.wc-block-components-text-input input, .wc-block-components-combobox input) {
  box-sizing: border-box;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid #d2d4ce;
  background: #fff;
  color: var(--cs-dark);
}
body.cs-shop-order .woocommerce textarea { padding: 12px; }
body.cs-shop-order .woocommerce .form-row label {
  color: var(--cs-dark);
  font-weight: 600;
}
body.cs-shop-order .woocommerce .form-row .required { color: #a33d36; }
body.cs-shop-order .woocommerce :where(.cart_totals, .woocommerce-checkout-review-order, .woocommerce-order) {
  border-radius: 12px;
}
body.cs-shop-order .woocommerce table.shop_table {
  border-color: var(--cs-line);
  border-radius: 10px;
  overflow: hidden;
}
body.cs-shop-order .woocommerce table.shop_table th,
body.cs-shop-order .woocommerce table.shop_table td {
  padding: 12px;
}
body.cs-shop-order .wc-block-components-button { border-radius: 10px; }
body.cs-shop-order .wc-block-components-button:not(.is-link) { min-height: 48px; }
body.cs-shop-order .wc-block-cart__submit-container { background: var(--cs-cream); }
@media (max-width: 767px) {
  body.cs-shop-catalog .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-left: 0;
    margin-right: 0;
  }
  body.cs-shop-catalog .woocommerce ul.products::before,
  body.cs-shop-catalog .woocommerce ul.products::after { content: none; }
  body.cs-shop-catalog .woocommerce ul.products li.product {
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    min-width: 0;
    padding: 10px;
  }
  body.cs-shop-catalog .woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.cs-shop-catalog .woocommerce ul.products li.product h2.woocommerce-loop-product__title {
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  body.cs-shop-catalog .woocommerce ul.products li.product .button {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 10px 5px;
    white-space: normal;
    line-height: 1.35;
  }
  body.cs-shop-catalog .woocommerce ul.products li.product .price {
    font-size: 15px;
  }
  body.cs-shop-single.cs-shop-product .woocommerce div.product div.images,
  body.cs-shop-single.cs-shop-product .woocommerce div.product div.summary {
    float: none;
    width: 100%;
    margin-right: 0;
  }
  body.cs-shop-single.cs-shop-product .woocommerce div.product .product_title {
    font-size: clamp(24px, 6.2vw, 32px);
  }
  body.cs-shop-single.cs-shop-product .woocommerce div.product form.cart .single_add_to_cart_button {
    min-height: 48px;
  }
  body.cs-shop-order .woocommerce table.shop_table th,
  body.cs-shop-order .woocommerce table.shop_table td { padding: 10px 8px; }
  body.cs-shop-order .woocommerce form .form-row {
    float: none;
    width: 100%;
  }
  body.cs-shop-order .woocommerce form .form-row input.input-text,
  body.cs-shop-order .woocommerce form .form-row select { width: 100%; }
}
@media (max-width: 359px) {
  body.cs-shop-catalog .woocommerce ul.products { gap: 8px; }
  body.cs-shop-catalog .woocommerce ul.products li.product { padding: 8px; }
  body.cs-shop-catalog .woocommerce ul.products li.product .button { font-size: 12px; }
}
/* Optional accessible mobile shortcut, placed above the Live Chat bubble. */
.cs-shop-mobile-purchase {
  position: fixed;
  z-index: 1000;
  left: max(12px, env(safe-area-inset-left));
  bottom: calc(88px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 124px);
  padding: 12px 16px;
  border: 1px solid #dbc8a7;
  border-radius: 999px;
  color: #fff;
  background: var(--cs-dark, #182420);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  font: 650 13px/1.3 system-ui, sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  cursor: pointer;
}
.cs-shop-mobile-purchase.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.cs-shop-mobile-purchase:focus-visible { outline: 3px solid var(--cs-accent, #ad8753); outline-offset: 3px; }
@media (min-width: 768px) { .cs-shop-mobile-purchase { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .cs-shop-mobile-purchase { transition: none; }
  body.cs-shop * { scroll-behavior: auto !important; }
}

/* Единая витрина CorsoSnacks: убираем лишь представление категорий в основном каталоге. */
body.cs-shop-unified.woocommerce-shop .woocommerce ul.products li.product-category,
body.cs-shop-unified.woocommerce-shop .woocommerce .product-category,
body.cs-shop-unified.woocommerce-shop .wc-block-product-categories,
body.cs-shop-unified.woocommerce-shop .wp-block-woocommerce-product-categories,
body.cs-shop-unified.woocommerce-shop .wp-block-woocommerce-product-categories-list,
body.cs-shop-unified.woocommerce-shop .widget_product_categories {
    display: none !important;
}

/* Все товары CorsoSnacks также на главной: фирменная сетка, без категорий. */
body.cs-shop-home .cs-home-catalog {
  width: 100%; max-width: 1250px; margin: 40px auto 60px;
  padding: 0 20px; box-sizing: border-box;
}
body.cs-shop-home .cs-home-catalog > h2 {
  color: var(--cs-dark); font-size: clamp(26px,3vw,38px);
  line-height: 1.2; letter-spacing: -.02em; margin: 0 0 25px;
}
body.cs-shop-home .cs-home-catalog .woocommerce { max-width: 100%; }
body.cs-shop-home .cs-home-catalog .woocommerce ul.products li.product-category,
body.cs-shop-home .woocommerce .wc-block-product-categories,
body.cs-shop-home .woocommerce .wp-block-woocommerce-product-categories,
body.cs-shop-home .woocommerce .widget_product_categories { display: none !important; }
@media (max-width:767px) {
  body.cs-shop-home .cs-home-catalog { margin: 28px auto 40px; padding: 0 12px; }
  body.cs-shop-home .cs-home-catalog > h2 { margin-bottom: 16px; }
}


/* CorsoSnacks 1.0.4 — mobile-first cart and checkout. Only presentation.
 * Do not hide required checkout fields, change amounts, gateways, shipping,
 * checkout submission or WooCommerce block internal structures.
 */
body.cs-shop-order {
  --cs-ux-border: #e8e6de;
  --cs-ux-muted: #66716d;
  --cs-ux-focus: #ad8753;
}
/* Focus and touch targets: classic checkout and WC block components. */
body.cs-shop-order .woocommerce :where(input.input-text, textarea, select, button.button, a.button),
body.cs-shop-order :where(.wc-block-components-button, .wc-block-components-text-input input, .wc-block-components-combobox input) {
  font-size: 16px; /* prevent focus-zoom on iPhone */
}
body.cs-shop-order .woocommerce :where(input.input-text, textarea, select):focus-visible,
body.cs-shop-order :where(.wc-block-components-button, .wc-block-components-text-input input, .wc-block-components-combobox input):focus-visible {
  outline: 2px solid var(--cs-ux-focus);
  outline-offset: 2px;
}
body.cs-shop-order .woocommerce :where(input.input-text, textarea, select) {
  min-height: 48px; padding: 10px 12px; max-width: 100%;
}
body.cs-shop-order .woocommerce textarea { min-height: 96px; resize: vertical; }
body.cs-shop-order .woocommerce :where(.select2-container .select2-selection--single) {
  min-height: 48px; border: 1px solid #d2d4ce; border-radius: 9px;
}
body.cs-shop-order .woocommerce .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 46px; padding-inline-start: 12px;
}
body.cs-shop-order .woocommerce .select2-container .select2-selection--single .select2-selection__arrow {
  height: 46px;
}
/* Keep quantities editable and order prices legible in a narrow cart. */
body.cs-shop-cart .woocommerce .woocommerce-cart-form {
  width: 100%; min-width: 0;
}
body.cs-shop-cart .woocommerce .cart_item .product-name {
  font-weight: 630; line-height: 1.45; overflow-wrap: anywhere;
}
body.cs-shop-cart .woocommerce .cart_item .product-thumbnail img {
  width: 72px; max-width: 100%; height: auto; border-radius: 9px;
}
body.cs-shop-cart .woocommerce .cart_item .quantity input.qty {
  min-height: 44px; min-width: 56px; max-width: 100%;
  border: 1px solid #d2d4ce; border-radius: 8px;
  padding: 8px 4px;
}
body.cs-shop-cart .woocommerce .cart-collaterals .cart_totals {
  float: none; border-radius: 14px;
}
body.cs-shop-cart .woocommerce .cart-collaterals .cart_totals h2 {
  font-size: clamp(20px, 4.5vw, 25px); color: var(--cs-dark);
}
body.cs-shop-cart .woocommerce .wc-proceed-to-checkout a.checkout-button {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; white-space: normal; text-align: center;
}
/* Classic checkout: retain WooCommerce two-column layout on large screens. */
body.cs-shop-checkout .woocommerce-checkout :where(h3, #order_review_heading) {
  color: var(--cs-dark); line-height: 1.25; letter-spacing: -.01em;
}
body.cs-shop-checkout .woocommerce-checkout :where(#customer_details, #order_review) {
  min-width: 0;
}
body.cs-shop-checkout .woocommerce-checkout #payment {
  border: 1px solid var(--cs-ux-border); border-radius: 12px;
}
body.cs-shop-checkout .woocommerce-checkout #payment .place-order {
  padding: 15px;
}
body.cs-shop-checkout .woocommerce-checkout #place_order {
  min-height: 52px; padding: 12px 22px; white-space: normal;
  text-align: center; overflow-wrap: anywhere;
}
body.cs-shop-checkout .woocommerce-checkout :where(.woocommerce-privacy-policy-text, .woocommerce-terms-and-conditions-wrapper) {
  line-height: 1.55; color: #46544e;
}
/* WC Cart and Checkout blocks: use documented public block component classes. */
body.cs-shop-order .wc-block-components-button {
  min-height: 50px; padding: 12px 16px; font-weight: 650;
}
body.cs-shop-order .wc-block-components-button:not(.is-link) {
  background: var(--cs-dark); color: white; border: 1px solid var(--cs-dark);
}
body.cs-shop-order .wc-block-components-button:not(.is-link):focus-visible {
  outline: 2px solid var(--cs-ux-focus); outline-offset: 3px;
}
body.cs-shop-order .wc-block-components-order-summary-item__quantity {
  background: var(--cs-cream); border-color: var(--cs-dark);
  color: var(--cs-dark); box-shadow: 0 0 0 2px var(--cs-cream);
}
body.cs-shop-order .wc-block-cart__submit-container {
  background-color: #fff;
}
body.cs-shop-order .wc-block-cart__submit-container::before {
  color: rgba(24, 36, 32, .14);
}
@media (max-width: 767px) {
  /* Keep purchase controls full-width; don't duplicate sticky block buttons. */
  body.cs-shop-checkout .woocommerce-checkout .col2-set .col-1,
  body.cs-shop-checkout .woocommerce-checkout .col2-set .col-2 {
    width: 100% !important; float: none !important; margin-right: 0 !important;
  }
  body.cs-shop-order .woocommerce form .form-row {
    margin-bottom: 14px; min-width: 0;
  }
  body.cs-shop-checkout .woocommerce-checkout #place_order {
    width: 100%; float: none;
  }
  body.cs-shop-cart .woocommerce .cart-collaterals,
  body.cs-shop-cart .woocommerce .cart-collaterals .cart_totals {
    width: 100%; max-width: 100%; box-sizing: border-box;
  }
  body.cs-shop-cart .woocommerce .woocommerce-cart-form .actions :where(input, button) {
    max-width: 100%;
  }
  body.cs-shop-cart .woocommerce .woocommerce-cart-form .coupon {
    display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px;
    max-width: 100%;
  }
  body.cs-shop-cart .woocommerce .woocommerce-cart-form .coupon #coupon_code {
    float: none; flex: 1 1 140px; width: 100%; min-width: 0; margin: 0;
  }
  body.cs-shop-cart .woocommerce .woocommerce-cart-form .coupon button {
    float: none; flex: 1 1 140px; margin: 0; min-height: 48px;
  }
  body.cs-shop-cart .woocommerce .woocommerce-cart-form .actions > button[name="update_cart"] {
    width: 100%; margin: 10px 0 0; min-height: 48px;
  }
  body.cs-shop-order .woocommerce .woocommerce-notices-wrapper {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 359px) {
  body.cs-shop-cart .woocommerce .cart_item .product-thumbnail img { width: 58px; }
  body.cs-shop-order .wc-block-components-button { font-size: 15px; padding: 10px; }
}

/* Страховка для классической корзины на узких экранах: WooCommerce data-title. */
@media (max-width: 767px) {
  body.cs-shop-cart .woocommerce table.shop_table_responsive thead { display: none; }
  body.cs-shop-cart .woocommerce table.shop_table_responsive tr.cart_item {
    display: block; width: 100%; border-bottom: 1px solid var(--cs-ux-border); padding: 8px 0;
  }
  body.cs-shop-cart .woocommerce table.shop_table_responsive tr.cart_item > td {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; gap: 12px; text-align: right;
    padding: 9px 10px; border: 0; overflow-wrap: anywhere;
  }
  body.cs-shop-cart .woocommerce table.shop_table_responsive tr.cart_item > td[data-title]::before {
    content: attr(data-title); display: block; position: static;
    font-weight: 650; text-align: left; float: none; min-width: 0;
  }
  body.cs-shop-cart .woocommerce table.shop_table_responsive .cart_item .quantity { max-width: 100px; }
  body.cs-shop-cart .woocommerce table.shop_table_responsive td.actions {
    display: block; width: 100%; padding: 12px 8px;
  }
  body.cs-shop-cart .woocommerce table.shop_table_responsive tr:not(.cart_item) {
    display: block; width: 100%;
  }
}

/* Keep the primary button comfortably tappable when earlier WC styles set 48px. */
body.cs-shop-order .wc-block-components-button:not(.is-link) { min-height: 50px; }


/* 1.0.8: на главной каталог без сортировки и служебного счётчика.
 * Сортировка на странице /shop/ и фильтры в админке не затрагиваются. */
body.cs-shop-home .cs-home-catalog .woocommerce-result-count,
body.cs-shop-home .cs-home-catalog .woocommerce-ordering,
body.cs-shop-home .cs-home-catalog .wc-block-components-product-sort-select,
body.cs-shop-home .cs-home-catalog .wp-block-woocommerce-catalog-sorting {
  display: none !important;
}
