/* ==========================================================================
   CATEGORY, SEARCH AND MODAL STABILITY — 2026-07
   ========================================================================== */

/* Social sharing is intentionally absent from category and brand listings. */
body.catalog-category-view .social-section,
body.catalog-category-view .social-addthis,
body.catalog-category-view .addthis_toolbox,
body.catalog-category-view .rewardssocial-buttons,
body.catalog-category-view [class*="social-share"],
body.catalog-category-view [class*="share-buttons"] {
  display: none !important;
}

/* Keep the availability-dialog close control inside its scrollable box. */
html body #div_sms_notice > .close.close {
  right: 8px !important;
  top: 8px !important;
}

/* Autocomplete must remain legible even when a legacy header sets line-height:0. */
.page-header #search_autocomplete.search-autocomplete {
  background: #fff !important;
  border: 1px solid rgba(34, 31, 28, .14) !important;
  border-radius: 0 0 12px 12px !important;
  box-shadow: 0 16px 36px rgba(34, 31, 28, .18) !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  z-index: 1300 !important;
}
.page-header #search_autocomplete.search-autocomplete ul {
  line-height: 1.35 !important;
  margin: 0 !important;
  padding: 6px !important;
}
.page-header #search_autocomplete.search-autocomplete li {
  box-sizing: border-box !important;
  display: block !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  min-height: 40px !important;
  padding: 9px 10px !important;
  white-space: normal !important;
}
.page-header #search_autocomplete.search-autocomplete li + li {
  border-top: 1px solid #eee !important;
}
.page-header #search_autocomplete.search-autocomplete li a {
  align-items: center !important;
  display: flex !important;
  gap: 10px !important;
  justify-content: space-between !important;
  line-height: 1.35 !important;
  white-space: normal !important;
}
.page-header #search_autocomplete.search-autocomplete li .amount {
  flex: 0 0 auto !important;
}

@media only screen and (max-width: 991px) {
  .page-header .search-wrapper.saida-search-open,
  .page-header .search-wrapper.saida-search-open .search-form-container,
  .page-header .search-wrapper.saida-search-open #search_mini_form {
    overflow: visible !important;
  }
  .page-header #search_autocomplete.search-autocomplete {
    left: 0 !important;
    max-height: 60vh !important;
    max-height: min(60dvh, 420px) !important;
    right: 0 !important;
    top: calc(100% + 5px) !important;
    width: 100% !important;
  }

  /* MageWorx results use floated columns; clear them on narrow viewports. */
  .page-header .searchsuite-autocomplete {
    box-sizing: border-box !important;
    left: 0 !important;
    max-height: 60vh !important;
    max-height: min(60dvh, 480px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1300 !important;
  }
  .page-header .searchsuite-autocomplete .suggest,
  .page-header .searchsuite-autocomplete .product,
  .page-header .searchsuite-autocomplete li {
    box-sizing: border-box !important;
    clear: both !important;
    line-height: 1.35 !important;
    max-width: 100% !important;
  }
}

/* Newsletter/modal stack and geometry apply on every page, not only home. */
html .modals-overlay {
  z-index: 2147483000 !important;
}
body .cdz-popup-wrapper,
body .cdz-popup-wrapper .modal-popup,
body .cdz-popup-wrapper .modal-popup._show,
body .modal-popup.cdz-newsletter-popup,
body .modal-popup.cdz-newsletter-popup._show {
  z-index: 2147483100 !important;
}
/* The startup newsletter uses Magento's block modal by default, which pins
   the panel to the top edge. Centre this modal only, without altering login,
   cart or confirmation dialogs. */
body .cdz-popup-wrapper .modal-popup.cdz-newsletter-popup,
body .cdz-popup-wrapper .modal-popup.cdz-newsletter-popup._show,
body .modal-popup.cdz-newsletter-popup._show {
  align-items: center !important;
  box-sizing: border-box !important;
  display: flex !important;
  justify-content: center !important;
  padding: 16px !important;
}
body .cdz-popup-wrapper .modal-popup .modal-inner-wrap,
body .modal-popup.cdz-newsletter-popup .modal-inner-wrap {
  box-sizing: border-box !important;
  margin: 0 auto !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  max-width: 1000px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  position: relative !important;
  width: calc(100vw - 32px) !important;
  z-index: 2147483101 !important;
}
body .cdz-popup-wrapper .modal-popup .action-close,
body .modal-popup.cdz-newsletter-popup .action-close {
  box-sizing: border-box !important;
  right: 8px !important;
  top: 8px !important;
  z-index: 2147483102 !important;
}
body .cdz-popup-wrapper .modal-content,
body .modal-popup.cdz-newsletter-popup .modal-content,
body .cdz-popup-wrapper .cdz-popup-newsletter,
body .modal-popup.cdz-newsletter-popup .cdz-popup-newsletter {
  box-sizing: border-box !important;
  max-width: 100% !important;
}
body .cdz-popup-wrapper img,
body .modal-popup.cdz-newsletter-popup img {
  height: auto !important;
  max-width: 100% !important;
}

/* The WhatsApp channel promotion uses the same compact treatment everywhere
   it is rendered: categories, product pages, cart and checkout. */
html body .saida-whatsapp-promo-banner {
  background: #f4fff7 !important;
  border: 1px solid #bee5c9 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  margin: 12px auto 20px !important;
  max-width: 1320px !important;
  overflow: hidden !important;
  padding: 14px 18px !important;
  width: 100% !important;
}
html body .saida-whatsapp-promo-banner .promo-content {
  align-items: center !important;
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  text-align: left !important;
  width: 100% !important;
}
html body .saida-whatsapp-promo-banner .promo-icon i {
  color: #1b9b4b !important;
  font-size: 32px !important;
}
html body .saida-whatsapp-promo-banner .promo-text,
html body .saida-whatsapp-promo-banner .promo-action,
html body .saida-whatsapp-promo-banner .promo-description {
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}
html body .saida-whatsapp-promo-banner .promo-title {
  color: #1f3326 !important;
  font-size: 17px !important;
  line-height: 1.2 !important;
  margin: 0 0 2px !important;
}
html body .saida-whatsapp-promo-banner .promo-description {
  color: #405147 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}
html body .saida-whatsapp-promo-banner .whatsapp-btn {
  align-items: center !important;
  animation: none !important;
  background: #1b9b4b !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  color: #fff !important;
  display: inline-flex !important;
  gap: 7px !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 10px 14px !important;
  text-decoration: none !important;
  transform: none !important;
  white-space: nowrap !important;
}
html body .saida-whatsapp-promo-banner .whatsapp-btn:hover,
html body .saida-whatsapp-promo-banner .whatsapp-btn:focus {
  background: #147a3a !important;
}

@media only screen and (max-width: 767px) {
  body .cdz-popup-wrapper .modal-popup,
  body .modal-popup.cdz-newsletter-popup {
    box-sizing: border-box !important;
    padding: 8px !important;
  }
  body .cdz-popup-wrapper .modal-popup .modal-inner-wrap,
  body .modal-popup.cdz-newsletter-popup .modal-inner-wrap {
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    width: calc(100vw - 16px) !important;
  }
  html body .saida-whatsapp-promo-banner {
    padding: 12px !important;
  }
  html body .saida-whatsapp-promo-banner .promo-content {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
  html body .saida-whatsapp-promo-banner .promo-action {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
  html body .saida-whatsapp-promo-banner .whatsapp-btn {
    width: 100% !important;
  }
}
