/* NeXt Chapter Recovery v2.2.1 — live-site final containment */

/* Internal templates must own their horizontal geometry. Old WordPress/theme
   width and float declarations are not allowed to push an internal main area
   outside the production shell. */
body.ncr-layout-v221.ncr-internal-surface main#primary.site-main:not(.ncr-woo-wrap) {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  float: none !important;
}

body.ncr-layout-v221 .ncr-shell-hero-inner,
body.ncr-layout-v221 .ncr-shell-container {
  max-width: 1240px;
  margin-inline: auto;
}

body.ncr-layout-v221 .ncr-shell-grid,
body.ncr-layout-v221 .ncr-tool-card,
body.ncr-layout-v221 .ncr-content-card,
body.ncr-layout-v221 .entry-content,
body.ncr-layout-v221 .woocommerce {
  min-width: 0;
}

body.ncr-layout-v221 .ncr-tool-card,
body.ncr-layout-v221 .ncr-content-card {
  overflow-wrap: anywhere;
}

body.ncr-layout-v221 .ncr-tool-card iframe,
body.ncr-layout-v221 .ncr-content-card iframe,
body.ncr-layout-v221 .entry-content iframe,
body.ncr-layout-v221 .entry-content video,
body.ncr-layout-v221 .entry-content img {
  max-width: 100%;
}

body.ncr-layout-v221 .entry-content table,
body.ncr-layout-v221 .ncr-tool-card table {
  max-width: 100%;
}

/* Keep the repeated brand artwork on tool-page heroes compact. */
body.ncr-layout-v221 .ncr-page-hero-visual img[src*="/assets/img/logo.png"] {
  width: auto !important;
  max-width: min(270px, 72%) !important;
  max-height: 210px !important;
  object-fit: contain !important;
}

/* Blog: stable card geometry even when titles/excerpts differ substantially. */
body.ncr-layout-v221.ncr-blog-surface .ncr-blog-card,
body.ncr-layout-v221.ncr-blog-surface .ncr-archive-clean__card {
  height: 100%;
}

body.ncr-layout-v221.ncr-blog-surface .ncr-blog-card__title,
body.ncr-layout-v221.ncr-blog-surface .ncr-archive-clean__card h2 {
  overflow-wrap: anywhere;
}

body.ncr-layout-v221.ncr-article-surface .ncr-entry-content > :first-child {
  margin-top: 0;
}

body.ncr-layout-v221.ncr-article-surface .ncr-entry-content > :last-child {
  margin-bottom: 0;
}

/* WooCommerce archive: v2.2.1 PHP removes the duplicate Shop page description;
   these rules ensure the remaining single loop has a clean toolbar and grid. */
body.ncr-layout-v221.ncr-store-surface .woocommerce::after {
  display: block;
  clear: both;
  content: "";
}

body.ncr-layout-v221.ncr-store-surface .woocommerce .woocommerce-result-count {
  float: left !important;
  line-height: 44px;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce .woocommerce-ordering {
  float: right !important;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce .woocommerce-ordering select {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid var(--ncr-v220-border);
  border-radius: .8rem;
  background: #fff;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce ul.products {
  clear: both !important;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce ul.products li.product {
  height: 100%;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce ul.products li.product .button,
body.ncr-layout-v221.ncr-store-surface .woocommerce ul.products li.product .added_to_cart {
  min-height: 44px;
  justify-content: center;
  text-align: center;
}

/* Single product: normalize variation tables and add-to-cart controls so long
   labels do not collapse the summary column. */
body.ncr-layout-v221.ncr-store-surface .woocommerce div.product form.cart,
body.ncr-layout-v221.ncr-store-surface .woocommerce div.product form.variations_form,
body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations {
  width: 100%;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations {
  margin: 1rem 0 !important;
  border: 0 !important;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations tr {
  display: grid;
  grid-template-columns: minmax(90px, .32fr) minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  margin-bottom: .75rem;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations th,
body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations td {
  display: block;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  text-align: left;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations select {
  width: 100%;
  min-height: 46px;
  margin: 0 !important;
  border: 1px solid var(--ncr-v220-border);
  border-radius: .75rem;
  background: #fff;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product .reset_variations {
  display: inline-block;
  margin-top: .4rem;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product .woocommerce-variation-add-to-cart,
body.ncr-layout-v221.ncr-store-surface .woocommerce div.product form.cart:not(.variations_form) {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: stretch;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce .quantity .qty {
  min-width: 76px;
  min-height: 46px;
  border: 1px solid var(--ncr-v220-border);
  border-radius: .75rem;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce div.product form.cart .button {
  min-height: 46px;
  margin: 0 !important;
}

/* Cart / checkout / account tables and forms stay inside the card on phones. */
body.ncr-layout-v221.ncr-store-surface .woocommerce-cart-form,
body.ncr-layout-v221.ncr-store-surface .woocommerce-checkout-review-order,
body.ncr-layout-v221.ncr-store-surface .woocommerce .shop_table {
  max-width: 100%;
}

body.ncr-layout-v221.ncr-store-surface .woocommerce form .form-row input.input-text,
body.ncr-layout-v221.ncr-store-surface .woocommerce form .form-row textarea,
body.ncr-layout-v221.ncr-store-surface .woocommerce form .form-row select,
body.ncr-layout-v221.ncr-store-surface .select2-container {
  max-width: 100% !important;
}

@media (max-width: 780px) {
  body.ncr-layout-v221.ncr-store-surface .woocommerce .woocommerce-result-count,
  body.ncr-layout-v221.ncr-store-surface .woocommerce .woocommerce-ordering {
    float: none !important;
    width: 100%;
    margin-bottom: .75rem !important;
  }

  body.ncr-layout-v221.ncr-store-surface .woocommerce .woocommerce-ordering select {
    width: 100%;
  }

  body.ncr-layout-v221.ncr-store-surface .woocommerce div.product table.variations tr {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  body.ncr-layout-v221 .ncr-shell-hero-inner,
  body.ncr-layout-v221 .ncr-shell-container,
  body.ncr-layout-v221 .ncr-blog-container,
  body.ncr-layout-v221 .ncr-archive-clean__container,
  body.ncr-layout-v221 .ncr-search-clean__container {
    width: min(100% - 1rem, 1240px) !important;
  }
}

@media (max-width: 520px) {
  body.ncr-layout-v221.ncr-store-surface .ncr-woo-card {
    padding: .8rem;
    border-radius: 1rem;
  }

  body.ncr-layout-v221.ncr-store-surface .woocommerce div.product {
    padding: .65rem !important;
  }

  body.ncr-layout-v221.ncr-store-surface .woocommerce div.product .woocommerce-variation-add-to-cart,
  body.ncr-layout-v221.ncr-store-surface .woocommerce div.product form.cart:not(.variations_form) {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.ncr-layout-v221.ncr-store-surface .woocommerce .quantity,
  body.ncr-layout-v221.ncr-store-surface .woocommerce .quantity .qty,
  body.ncr-layout-v221.ncr-store-surface .woocommerce div.product form.cart .button {
    width: 100%;
  }
}
