/* CHB frontend fixes — mixed content leftovers, mobile, product cards, popup vs chat */

html {
  overflow-x: clip;
}
body {
  overflow-x: hidden;
}

/* Hide shipping weight on catalog cards (e.g. "950 g" on liquid colloids). */
ul.products .product-unit,
ul.products .product-weight,
ul.products .product .weight,
.products .product-footer .product-weight,
.klb-product .product-weight,
.product-wrapper .product-weight,
.product-wrapper .product-unit,
.product-content .product-weight,
.product-type-variable .product-weight,
.woocommerce ul.products li.product .product-weight,
.woocommerce ul.products li.product .product-unit,
.product-unit {
  display: none !important;
}

/* Empty / broken social icons (Twitter href was blank). */
footer a[href=""],
footer a[href="#"],
.site-footer a[href=""],
.klb-social a[href=""],
.elementor-social-icon-twitter:not([href]),
.elementor-social-icon-twitter[href=""],
.elementor-social-icon-twitter[href="#"] {
  display: none !important;
}

/* Newsletter popup above LiveChat; chat sits below while popup is open. */
#chb-popup-root.is-open,
#chb-popup-root.is-open .chb-popup-backdrop,
#chb-popup-root.is-open .chb-popup-card {
  z-index: 2147483600 !important;
}
html.chb-popup-open #chat-widget-container,
html.chb-popup-open iframe[src*="livechat"],
html.chb-popup-open [id^="chat-widget"],
html.chb-mnav-open #chat-widget-container,
html.chb-mnav-open iframe[src*="livechat"],
html.chb-mnav-open iframe[title="LiveChat chat widget"],
html.chb-mnav-open #livechat-eye-catcher,
html.chb-mnav-open [id^="chat-widget"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Hero slides off-canvas must not widen the page. */
#chb-temp-hero-root,
#chb-temp-hero-root .hero,
body.home .hero-slide {
  max-width: 100vw;
  overflow: hidden;
}

/* Mobile tap targets + readable type. */
@media (max-width: 767px) {
  .header-buttons a,
  .header-cart,
  .header-login,
  .header-search,
  button.menu-toggle,
  .mobile-nav-button,
  .elementor-menu-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  #chb-popup-root .chb-popup-card {
    max-width: calc(100vw - 24px);
    margin: 12px auto;
  }

  #chb-popup-root .chb-popup-media {
    display: none;
  }
}

/* Prevent iOS from zooming only on focus while still allowing pinch-zoom. */
input, select, textarea {
  font-size: 16px;
}

@media (max-width: 900px) {
  #chat-widget-container,
  iframe[title="LiveChat chat widget"] {
    bottom: 80px !important;
  }
}

/* Header logo — transparent, no square tile */
.elementor-location-header img,
.site-header .site-brand img,
.chb-popup-logo,
.elementor-location-header .elementor-widget-theme-site-logo img {
  background: transparent !important;
  mix-blend-mode: multiply !important;
  box-shadow: none !important;
}
.elementor-location-header .elementor-widget-theme-site-logo,
.elementor-location-header .elementor-widget-theme-site-logo .elementor-widget-container,
.elementor-location-header .elementor-widget-image .elementor-widget-container {
  background: transparent !important;
  box-shadow: none !important;
}

/* Desktop logo sits in the search row, not on the category bar */
@media (min-width: 1025px) {
  .elementor-location-header .elementor-widget-theme-site-logo,
  .elementor-location-header .elementor-widget-theme-site-logo .elementor-widget-container {
    padding: 4px 12px 18px 4px !important;
  }
  .elementor-location-header .elementor-widget-theme-site-logo img {
    height: 62px !important;
    max-height: 62px !important;
    max-width: 180px !important;
    width: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
  }
}

/* Mobile header: hamburger | wordmark | search | account | cart. No overlap. CSS-only — JS is delayed by LiteSpeed. */
@media (max-width: 1024px) {
  .elementor-location-header .elementor-element-cf3056e > .e-con-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    position: relative !important;
  }
  .elementor-location-header .elementor-element-64d4b92 {
    margin-left: auto !important;
    position: relative !important;
    z-index: 6 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    flex: 0 0 44px !important;
  }
  .elementor-location-header .elementor-element-07c51f9,
  .elementor-location-header .elementor-widget-fibosearch {
    position: relative !important;
    z-index: 6 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    flex: 0 0 44px !important;
    margin-left: 0 !important;
  }
  .elementor-location-header .elementor-element-75d1706 {
    --e-transform-translateX: 0px !important;
    --e-transform-translateY: 0px !important;
    position: absolute !important;
    left: 54px !important;
    right: 150px !important;
    top: 50% !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    transform: translateY(-50%) !important;
    overflow: visible !important;
    padding: 0 !important;
    z-index: 3 !important;
  }
  .elementor-location-header .elementor-element-75d1706.chb-logo-inflow {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    inset: auto !important;
    transform: none !important;
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 168px !important;
    margin: 0 !important;
  }
  .elementor-location-header .elementor-element-75d1706 .elementor-widget-container {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 38px !important;
    background-color: transparent !important;
    background-image: url("https://crystalhealthandbeauty.co.uk/wp-content/uploads/chb-email/logo-email.png") !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    background-size: contain !important;
    mix-blend-mode: multiply !important;
  }
  .elementor-location-header .elementor-element-75d1706 img {
    height: 38px !important;
    max-height: 40px !important;
    width: 150px !important;
    max-width: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    object-fit: contain !important;
  }
}

/* Product pages: one gutter, full-width card — do not fight product-v5 display:contents */
@media (max-width: 767px) {
  html body.single-product .shop-content > .container,
  html body.single-product .container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }
  html body.single-product .single-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html body.single-product .product.type-product {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  html body.single-product .product-images,
  html body.single-product .product-detail,
  html body.single-product .col-12.product-images,
  html body.single-product .col-12.product-detail {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    float: none !important;
  }
  html body.single-product .woocommerce-product-gallery,
  html body.single-product .woocommerce-product-gallery__wrapper,
  html body.single-product .woocommerce-product-gallery__image img {
    width: 100% !important;
    max-width: 100% !important;
  }
  html body.single-product h1.product_title {
    font-size: 1.75rem !important;
    line-height: 1.15 !important;
  }
  html body.single-product .cart,
  html body.single-product .single_add_to_cart_button {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Breadcrumbs — stop shouting */
body.tax-product_cat .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-breadcrumb li,
body.tax-product_cat .woocommerce-breadcrumb a,
body.tax-product_cat .woocommerce-breadcrumb span,
body.archive .woocommerce-breadcrumb,
body.archive .woocommerce-breadcrumb li,
body.archive .woocommerce-breadcrumb a,
.woocommerce-breadcrumb,
.woocommerce-breadcrumb li,
.woocommerce-breadcrumb a,
.klb-breadcrumb,
.klb-breadcrumb a,
body.tax-product_cat .site-content .woocommerce-breadcrumb li {
  text-transform: none !important;
}