/* Existing ZPB tokens, corners and spacing. Presentation only. */
.page-id-22 .zpb-delivery-attention__head { display: none !important; }
body.woocommerce-cart .zpb-cart-trust {
  margin: 20px 0 0 !important;
  padding: 16px 0 0 !important;
  list-style: none !important;
}
body.woocommerce-cart .zpb-delivery-form label {
  display: block;
  margin-bottom: 8px !important;
}
body.woocommerce-cart #zpb-delivery-address,
body:is(.woocommerce-cart,.zpb-account-page,.tax-product_cat,.zpb-product-search) :is(input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="password"],input[type="search"],input[type="date"],textarea,select):not(.qty):not(#zpb-live-points),
.site-header input[type="search"] {
  border-radius: 12px !important;
}
body.single-post .comment-form :is(textarea,input[type="text"],input[type="email"],input[type="url"]) {
  border-radius: 12px !important;
}
body.single-post .comment-form :is(.comment-form-author,.comment-form-email,.comment-form-url,.comment-form-comment) > label {
  display: block;
  margin-bottom: 8px;
}
body.woocommerce-cart .zpb-cart-addon {
  grid-template-columns: 120px minmax(0,1fr) 40px;
  padding: 0 20px 0 0;
  gap: 20px;
  border-radius: var(--zpb-radius-card);
  overflow: hidden;
}
body.woocommerce-cart .zpb-cart-addon__image {
  width: 120px;
  height: 136px;
  margin: 0;
  border-radius: 0;
  background: var(--zpb-white);
}
body.woocommerce-cart .zpb-cart-addon__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
}
.zpb-global-footer__contacts { font-style: normal; }
.zpb-global-footer__store { margin-bottom: 20px; }
.zpb-global-footer__store > a:first-child { margin-bottom: 8px; }
.zpb-legal-page__content p:empty,
.zpb-legal-page__content p:has(>br:only-child) { display: none; }
@media(max-width:921px) {
  body.woocommerce-cart :is(.entry-content,.wp-block-shortcode) > .woocommerce {
    display: flex !important;
    flex-direction: column;
  }
  body.woocommerce-cart .zpb-cart-main { display: contents !important; }
  body.woocommerce-cart .zpb-cart-schedule { order: 0; }
  body.woocommerce-cart .woocommerce-notices-wrapper { order: 1; }
  body.woocommerce-cart .zpb-cart-main > .woocommerce-cart-form { order: 2; }
  body.woocommerce-cart .cart-collaterals { order: 3; }
  body.woocommerce-cart .zpb-cart-main > .zpb-cart-recommendations { order: 4; }
}
@media(max-width:600px) {
  body.woocommerce-cart .zpb-cart-addon { grid-template-columns: 96px minmax(0,1fr) 40px; padding-right: 16px; gap: 12px; }
  body.woocommerce-cart .zpb-cart-addon__image { width: 96px; height: 120px; }
}

/* A colspan address cell is not a responsive amount cell: Woo's generated colon
   must not precede the actual field label. */
body.woocommerce-cart .cart_totals tr.zpb-delivery-address-row > td::before {
  content: none !important;
  display: none !important;
}
body.woocommerce-cart .cart_totals tr.zpb-delivery-address-row > td,
body.woocommerce-cart .zpb-delivery-form label {
  text-align: left !important;
}
.zpb-catalog-tools { display: contents; }

/* Wrapped footer links follow their first line, rather than the theme's
   mobile footer centre alignment. Keep the existing heading alignment. */
@media(max-width:768px) {
  .zpb-global-footer nav.zpb-global-footer__col li,
  .zpb-global-footer nav.zpb-global-footer__col li > a {
    text-align: left !important;
  }
}

@media(max-width:768px) {
  body:is(.page-id-3,.page-id-13,.page-id-2266,.page-id-2269) .site-content > .ast-container {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body .zpb-legal-page { padding: 28px 12px 48px; }
  body .zpb-legal-page__inner { width: 100%; max-width: none; margin: 0; }
  body .zpb-legal-page__title {
    margin: 0 0 22px;
    font-size: clamp(20px,5.64vw,24px);
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }
  body .zpb-legal-page__content { padding: 22px 18px; }
  body .zpb-legal-page__content h2 {
    margin-top: 24px;
    font-size: clamp(19px,5.13vw,22px);
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }
  body .zpb-legal-page__content h2:first-of-type { margin-top: 0; }
}
@media(max-width:600px) {
  body:is(.tax-product_cat,.tax-product_tag,.post-type-archive-product,.zpb-product-search) .zpb-catalog-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    clear: both;
    margin-bottom: 20px;
  }
  body:is(.tax-product_cat,.tax-product_tag,.post-type-archive-product,.zpb-product-search) .zpb-catalog-tools .woocommerce-result-count {
    float: none !important;
    flex: 0 0 auto;
    width: auto !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    white-space: nowrap;
  }
  body:is(.tax-product_cat,.tax-product_tag,.post-type-archive-product,.zpb-product-search) .zpb-catalog-tools .woocommerce-ordering {
    float: none !important;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }
  body:is(.tax-product_cat,.tax-product_tag,.post-type-archive-product,.zpb-product-search) .zpb-catalog-tools .woocommerce-ordering::before {
    content: 'Сортировка:';
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
  }
  body:is(.tax-product_cat,.tax-product_tag,.post-type-archive-product,.zpb-product-search) .zpb-catalog-tools select.orderby {
    width: 155px !important;
    max-width: 100%;
    min-width: 0 !important;
    height: 42px;
    margin: 0 !important;
    padding: 0 24px 0 10px !important;
    background-position: right 8px center !important;
    background-size: 11px 11px !important;
    font-size: 12px !important;
    line-height: normal;
    border-radius: 12px !important;
  }
}

/* Mobile entry to the existing product search; same site tokens and typography. */
.zpb-mobile-menu-search { display: none !important; }
@media (max-width: 921px) {
  #ast-hf-mobile-menu .zpb-mobile-menu-search { display: block !important; padding: 14px 20px; }
  #ast-hf-mobile-menu .zpb-mobile-menu-search form { display: flex; align-items: center; gap: 8px; margin: 0; }
  #ast-hf-mobile-menu .zpb-mobile-menu-search label { display: block; flex: 1 1 auto; min-width: 0; margin: 0; }
  #ast-hf-mobile-menu .zpb-mobile-menu-search input[type="search"] {
    display: block; width: 100%; min-width: 0; height: 44px; margin: 0; padding: 10px 12px;
    border: 1px solid var(--zpb-border, #F0DDE5); border-radius: 12px;
    background: var(--zpb-white, #fff); color: var(--zpb-text, #2F2633); font: inherit; font-size: 14px;
  }
  #ast-hf-mobile-menu .zpb-mobile-menu-search button {
    flex: 0 0 auto; height: 44px; min-height: 44px; line-height: 20px !important; margin: 0; padding: 10px 14px; border: 0; border-radius: 12px;
    background: var(--zpb-accent, #B86F8D); color: #fff; font: inherit; font-size: 14px;
  }
  #ast-hf-mobile-menu .zpb-mobile-menu-search button:hover { background: var(--zpb-accent-hover, #9E5C78); }
}
/* Allow long availability text to wrap without squeezing either table cell. */
body.woocommerce-checkout .zpb-checkout-review__bonus {
  grid-template-columns: minmax(0, 1fr) !important; gap: 4px !important;
}
.zpb-checkout-summary table.woocommerce-checkout-review-order-table tfoot tr.zpb-checkout-review__bonus > :is(th,td) {
  width: 100% !important; min-width: 0 !important; max-width: 100% !important;
  justify-self: stretch; box-sizing: border-box;
  text-align: left !important; white-space: normal !important; overflow-wrap: anywhere;
}
body.woocommerce-checkout #zpb-projected-bonus { white-space: normal !important; }
.zpb-checkout-summary table.woocommerce-checkout-review-order-table tfoot tr.shipping {
  grid-template-columns: minmax(70px, 1fr) minmax(0, 2fr) !important;
}
.zpb-checkout-summary table.woocommerce-checkout-review-order-table tfoot tr.shipping > td {
  width: 100% !important; min-width: 0; max-width: 100%; overflow-wrap: anywhere;
}
.zpb-checkout-summary table.woocommerce-checkout-review-order-table tfoot tr.shipping label {
  display: block; max-width: 100%; white-space: normal !important; overflow-wrap: anywhere;
}
/* Reserve room for three separate 44px controls on narrow phones. */
@media (max-width: 360px) {
  #ast-mobile-header .ast-builder-grid-row-has-sides { grid-template-columns: minmax(0,1fr) auto; column-gap: 8px; }
  #ast-mobile-header .site-header-primary-section-left .site-logo-img { padding-right: 0; }
  #ast-mobile-header .custom-logo-link img { max-width: min(120px, calc(100vw - 195px)); width: 100%; height: auto; }
  #ast-mobile-header .site-header-primary-section-right { gap: 0; }
  #ast-mobile-header .zpb-mobile-actions { padding: 0; flex-shrink: 0; }
  #ast-mobile-header .site-header-primary-section-right > .ast-builder-layout-element { padding-left: 0; }
  #ast-mobile-header .menu-toggle { min-width: 44px; min-height: 44px; padding: 0; }
}

/* Catalog directory: the same existing background asset and tokens as other pages. */
body.page-id-9 #content {
  background-color: var(--zpb-page-bg);
  background-image: var(--zpb-pattern-image);
  background-repeat: repeat;
  background-position: left top;
  background-size: var(--zpb-pattern-size);
}

@media (max-width: 921px) {
  #ast-mobile-header .site-header-primary-section-right:has(> .zpb-mobile-actions) > .zpb-mobile-actions {
    padding-inline: 0;
  }
  #ast-mobile-header .site-header-primary-section-right:has(> .zpb-mobile-actions) > .ast-builder-layout-element:has(.menu-toggle) {
    padding-left: 0;
  }
  #ast-mobile-header .site-header-primary-section-right:has(> .zpb-mobile-actions) .menu-toggle {
    box-sizing: border-box;
    width: 44px;
    min-height: 44px;
    padding-inline: 0;
    justify-content: center;
  }
}
