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

/* Shared page palette. Specificity also covers legacy cart/checkout overrides. */
:root {
    --saida-page-background: #faf2e4;
    --saida-card-background: #eee1cc;
}

:root body[class] {
    background-color: var(--saida-page-background) !important;
    color: #222;
}

:root body[class] :is(
    .page-wrapper,
    .page-main,
    .page-main > .columns,
    .page-main > .columns > .column.main,
    .full-slideshow-wrapper p,
    .product-main-content,
    .saida-estimated-delivery,
    .saida-product-tabs,
    .related-upsell-crossell,
    .saida-filter-bar,
    .login-container .block-content,
    .cart-empty,
    .opc-wrapper,
    .checkout-shipping-address,
    .checkout-shipping-method,
    .checkout-payment-method,
    .payment-method-content,
    footer.page-footer
) {
    background: var(--saida-page-background) !important;
}

/* The old boxed-page shadow leaves a pale seam above the full-width footer. */
:root body.box-layout .page-wrapper {
    box-shadow: none !important;
}

/* Product tab content keeps a white reading surface. */
:root body.catalog-product-view .product.info.detailed .data.item.content,
:root body.catalog-product-view .product.info.detailed .product.attribute.description {
    background: #fff !important;
}

:root body.catalog-product-view .product.info.detailed .product.attribute.description {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Breadcrumbs share the underlying page background on every route. */
:root body[class] :is(.wrapper-breadcrums, .breadcrumbs, .breadcrumbs .items) {
    background: transparent !important;
    border-bottom: 0 !important;
    color: #222 !important;
}

:root body[class] .breadcrumbs :is(.item, a, strong),
:root body[class] .breadcrumbs .item::after {
    color: #222 !important;
}

:root body[class] :is(.sg-card__front, .sg-card__back) {
    background: var(--saida-card-background) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .65) inset,
                0 6px 16px -8px rgba(32, 19, 15, .2);
}

/* Leave room for card shadows inside the horizontal scrolling area. */
:root body[class] .sg-product-carousel__viewport {
    overflow: visible;
}

:root body[class] .sg-product-carousel .sg-product-list .sg-product-grid {
    padding: 12px 16px 32px !important;
    scroll-padding-inline: 16px;
}

:root body[class] :is(.page-wrapper, .page-main, .block_info) {
    color: #222;
}

/* Home services retain their white cards; discovery links need dark text. */
:root body.cms-index-index #block_info_home .block_info {
    background: #fff;
    color: #222;
}

:root body[class] .page-main a.view-all {
    color: #222;
}

:root body.cms-index-index .page-main a.view-all:hover,
:root body.cms-index-index .page-main a.view-all:focus-visible {
    color: #fff;
}

/* Use the same charcoal header across every storefront page and sticky state. */
:root body[class] header.page-header,
:root body[class] header.page-header :is(
    .header-wrapper-content,
    .header-wrapper-content.sticky-menu.active,
    .header.content,
    .saida-header-bar,
    .header-wrapper-center
) {
    background: var(--saida-footer-dark, #242423) !important;
    border-color: var(--saida-footer-dark, #242423) !important;
    color: #fff;
}

/* A pressed or previously clicked menu link must not retain a grey fill. */
:root body[class] header.page-header a.menu-link:active,
:root body[class] header.page-header a.menu-link:focus:not(:hover),
:root body[class] header.page-header .cdz-horizontal-menu > .groupmenu > li.level0 > a.menu-link:active,
:root body[class] header.page-header .cdz-horizontal-menu > .groupmenu > li.level0 > a.menu-link:focus:not(:hover) {
    background: transparent !important;
    box-shadow: none !important;
}

:root body[class] header.page-header a.menu-link:focus-visible {
    outline: 2px solid #f58026;
    outline-offset: 2px;
}

/* Keep the cart summary and product table on white surfaces. */
:root body.checkout-cart-index :is(
    .cart-summary,
    .cart-summary .block,
    .cart-summary .block > .title,
    .cart-summary .block > .content,
    .cart-summary .cart-totals,
    .cart-summary .reward-message .success.message,
    .cart-summary .sparsh-free-shipping-bar-goal-message,
    .form-cart,
    .cart.table-wrapper,
    .cart.items,
    .cart.items thead,
    .cart.items tbody,
    .cart.items tr,
    .cart.items th,
    .cart.items td
) {
    background: #fff !important;
}

:root body.checkout-cart-index .cart-summary #block-discount {
    background: #fff !important;
}

/* White surfaces for the order sidebar and its individual blocks. */
:root body.checkout-index-index :is(
    .opc-sidebar.opc-summary-wrapper,
    .opc-sidebar .opc-block-summary,
    .opc-sidebar .opc-block-shipping-information,
    .opc-sidebar .discount-code,
    .opc-sidebar .reward-message .success.message,
    .opc-sidebar .sparsh-free-shipping-bar-goal-message,
    .saida-checkout-sidebar-promos > *
) {
    background: #fff !important;
}

/* 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;
  }
}

/* Theme-owned password control; existing checkout/native controls are untouched. */
.saida-password-control {
  position: relative;
}

.saida-password-control > input.saida-password-input {
  padding-right: 46px;
}

/* The account dropdown sets its input padding with !important. */
.page-header #cdz-login-form-dropdown input.input-text.saida-password-input {
  padding-right: 46px !important;
}

.saida-password-control > .saida-theme-password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  margin: 0;
  min-width: 40px;
  padding: 0;
  position: absolute !important;
  right: 1px;
  top: 1px !important;
  width: 40px;
  z-index: 1;
}

.saida-theme-password-toggle::before {
  background: radial-gradient(circle, currentColor 0 3px, transparent 3.5px);
  border: 1.5px solid currentColor;
  border-radius: 70% 15%;
  box-sizing: border-box;
  content: '';
  height: 16px;
  transform: rotate(45deg);
  width: 16px;
}

/* Header action buttons are otherwise forced back into the normal flow. */
.page-header .header-wrapper-right .saida-password-control > button.saida-theme-password-toggle {
  position: absolute !important;
  top: 1px !important;
}

.saida-theme-password-toggle[aria-pressed='true']::after {
  background: currentColor;
  content: '';
  height: 2px;
  position: absolute;
  transform: rotate(45deg);
  width: 23px;
}

.saida-theme-password-toggle:focus-visible {
  outline: 2px solid #a64b19;
  outline-offset: -3px;
}

/* Product cutouts use the page surface, without a painted image box. */
:root body.catalog-product-view .product.media,
:root body.catalog-product-view .product.media :is(
    .single-product-image,
    .gallery-placeholder,
    .gallery-placeholder__image,
    .fotorama,
    .fotorama__wrap,
    .fotorama__stage,
    .fotorama__stage__shaft,
    .fotorama__stage__frame,
    .fotorama__img,
    .fotorama__nav-wrap,
    .fotorama__nav,
    .fotorama__thumb,
    .fotorama__thumb img
) {
    background: transparent !important;
}

/* Shared scrollbar appearance, matching saidabrand.com. */
@supports not selector(::-webkit-scrollbar) {
    html, * { scrollbar-color: #f58024 #130e09; scrollbar-width: auto; }
}
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner { background: #130e09; }
::-webkit-scrollbar-thumb {
    min-height: 44px;
    min-width: 44px;
    border: 3px solid #130e09;
    border-radius: 10px;
    background: #f58024;
}
::-webkit-scrollbar-thumb:hover { background: #ff983e; }
::-webkit-scrollbar-button:single-button {
    display: block;
    width: 14px;
    height: 18px;
    background: #130e09 center / 10px no-repeat;
}
::-webkit-scrollbar-button:single-button:hover { background-color: #302013; }
::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 7 3-3 3 3' fill='none' stroke='%23f58024' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 5 3 3 3-3' fill='none' stroke='%23f58024' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:horizontal:decrement {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m7 3-3 3 3 3' fill='none' stroke='%23f58024' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:horizontal:increment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m5 3 3 3-3 3' fill='none' stroke='%23f58024' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}
