
/*
 * TimberIN B2-44 — Utility widgets, header strip and mini-cart theme
 * Shared by woodenhottubsale.co.uk and badetonneholz.de
 * Scope: AI help trigger, WhatsApp trigger, Trustindex sticky badge,
 *        #top strip, cart ribbon and quick-cart panel.
 */

:root {
  --ti-b244-brown: #7a3f20;
  --ti-b244-brown-dark: #572b17;
  --ti-b244-brown-soft: #9a5b33;
  --ti-b244-cream: #fbf4ea;
  --ti-b244-cream-light: #fffdf9;
  --ti-b244-border: #dfbea0;
  --ti-b244-ink: #2d241f;
  --ti-b244-shadow: 0 10px 28px rgba(57, 31, 18, 0.22);
}

/* Header utility strip */
#top {
  min-height: 30px !important;
  background: linear-gradient(90deg, #4d2817 0%, #75401f 50%, #4d2817 100%) !important;
  border-top: 1px solid rgba(255, 253, 249, 0.12) !important;
  border-bottom: 1px solid #b5764b !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px rgba(46, 25, 15, 0.14) !important;
}

/* Cart ribbon: preserve its position above the menu and replace the dated bitmap. */
#cart {
  width: 112px !important;
  height: 96px !important;
  overflow: visible !important;
  background: none !important;
  isolation: isolate;
}

#cart::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(145deg, #8b4a28 0%, #6f371e 58%, #572b17 100%);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  filter: drop-shadow(0 6px 7px rgba(43, 24, 15, 0.24));
}

#cart .widget_shopping_cart.trigger {
  position: relative !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  display: flex !important;
  width: 112px !important;
  height: 96px !important;
  padding: 48px 8px 17px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  color: #fffaf3 !important;
  text-align: center !important;
  text-decoration: none !important;
  border: 0 !important;
  background: transparent !important;
  outline-offset: -5px;
}

#cart .widget_shopping_cart.trigger::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 29px;
  height: 29px;
  transform: translateX(-50%);
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23fffaf3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='19' cy='20' r='1'/%3E%3Cpath d='M3 4h2l2.4 10.1a2 2 0 0 0 2 1.5h7.8a2 2 0 0 0 2-1.6L21 7H6'/%3E%3C/svg%3E");
  opacity: 0.98;
}

#cart .widget_shopping_cart.trigger:hover,
#cart .widget_shopping_cart.trigger:focus-visible {
  color: #fff !important;
  text-decoration: none !important;
  outline: 2px solid #f4d7bd !important;
  border-radius: 5px 5px 18px 18px;
}

#cart .minicart {
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* The mini-cart remains a functional layer above the menu. */
#cart .quick-cart {
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  z-index: 100150 !important;
  box-sizing: border-box !important;
  width: min(360px, calc(100vw - 24px)) !important;
  max-height: min(70vh, 520px) !important;
  margin: 0 !important;
  padding: 16px !important;
  overflow: hidden auto !important;
  color: var(--ti-b244-ink) !important;
  background: var(--ti-b244-cream-light) !important;
  border: 1px solid var(--ti-b244-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--ti-b244-shadow) !important;
}

#cart .cart_list {
  display: grid !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ti-b244-ink) !important;
  list-style: none !important;
}

#cart .ti-wh-cart-line {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px 12px !important;
  align-items: start !important;
  margin: 0 !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid #ead8c7 !important;
}

#cart .ti-wh-cart-line-name,
#cart .ti-wh-cart-line-name a {
  min-width: 0 !important;
  color: var(--ti-b244-ink) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  text-decoration: none !important;
  overflow-wrap: anywhere;
}

#cart .ti-wh-cart-line-name a:hover,
#cart .ti-wh-cart-line-name a:focus-visible {
  color: var(--ti-b244-brown) !important;
  text-decoration: underline !important;
}

#cart .ti-wh-cart-line-price,
#cart .ti-wh-cart-total-price {
  color: var(--ti-b244-brown) !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

#cart .totals {
  display: flex !important;
  gap: 16px !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ti-b244-ink) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  list-style: none !important;
}

#cart li.view-cart-button {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#cart li.view-cart-button > a.view-cart-button {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  color: #fffaf3 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-decoration: none !important;
  background: linear-gradient(135deg, #8b4a28, #6b341c) !important;
  border: 1px solid #623019 !important;
  border-radius: 8px !important;
  box-shadow: 0 5px 12px rgba(80, 40, 19, 0.18) !important;
}

#cart li.view-cart-button > a.view-cart-button:hover,
#cart li.view-cart-button > a.view-cart-button:focus-visible {
  background: linear-gradient(135deg, #6b341c, #4d2817) !important;
  outline: 2px solid #d7a77e !important;
  outline-offset: 2px;
}

/*
 * Specificity lock: the shared B2 layout controller is intentionally loaded
 * later by WordPress and owns open/close behaviour. These selectors change
 * presentation only while leaving that behaviour untouched.
 */
html body.wp-theme-maya #top #cart .quick-cart {
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  z-index: 100150 !important;
  box-sizing: border-box !important;
  width: min(360px, calc(100vw - 24px)) !important;
  max-height: min(70vh, 520px) !important;
  margin: 0 !important;
  padding: 16px !important;
  overflow: hidden auto !important;
  color: var(--ti-b244-ink) !important;
  background: var(--ti-b244-cream-light) !important;
  border: 1px solid var(--ti-b244-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--ti-b244-shadow) !important;
}

html body.wp-theme-maya #top #cart .quick-cart ul.cart_list {
  display: grid !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.wp-theme-maya #top #cart .quick-cart li.ti-wh-cart-line {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px 12px !important;
  align-items: start !important;
  margin: 0 !important;
  padding: 0 0 12px !important;
  border: 0 !important;
  border-bottom: 1px solid #ead8c7 !important;
}

html body.wp-theme-maya #top #cart .quick-cart li.ti-wh-cart-line a {
  color: var(--ti-b244-ink) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  text-align: left !important;
  text-decoration: none !important;
  overflow-wrap: anywhere;
}

html body.wp-theme-maya #top #cart .quick-cart li.ti-wh-cart-line a:hover,
html body.wp-theme-maya #top #cart .quick-cart li.ti-wh-cart-line a:focus-visible {
  color: var(--ti-b244-brown) !important;
  text-decoration: underline !important;
}

html body.wp-theme-maya #top #cart .quick-cart .ti-wh-cart-line-price,
html body.wp-theme-maya #top #cart .quick-cart .ti-wh-cart-total-price {
  color: var(--ti-b244-brown) !important;
}

html body.wp-theme-maya #top #cart .quick-cart li.totals {
  display: flex !important;
  gap: 16px !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--ti-b244-ink) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

html body.wp-theme-maya #top #cart .quick-cart li.view-cart-button {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

html body.wp-theme-maya #top #cart .quick-cart li.view-cart-button > a.view-cart-button {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  color: #fffaf3 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-decoration: none !important;
  background: linear-gradient(135deg, #8b4a28, #6b341c) !important;
  border: 1px solid #623019 !important;
  border-radius: 8px !important;
  box-shadow: 0 5px 12px rgba(80, 40, 19, 0.18) !important;
}

/* AI help trigger */
.mwai-trigger.mwai-open-button {
  z-index: 2147481000 !important;
  filter: none !important;
}

.mwai-trigger .mwai-icon-container {
  box-sizing: border-box !important;
  width: 60px !important;
  height: 60px !important;
  padding: 5px !important;
  overflow: hidden !important;
  background: linear-gradient(145deg, #fffdf9 0%, #f4e2cf 100%) !important;
  border: 2px solid var(--ti-b244-brown) !important;
  border-radius: 50% !important;
  box-shadow: 0 8px 22px rgba(67, 34, 17, 0.25) !important;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.mwai-trigger .mwai-icon-container:hover,
.mwai-trigger .mwai-icon-container:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 11px 25px rgba(67, 34, 17, 0.32) !important;
  outline: 3px solid rgba(223, 190, 160, 0.75) !important;
  outline-offset: 2px;
}

.mwai-trigger .mwai-icon {
  width: 46px !important;
  height: 46px !important;
  object-fit: contain !important;
}

.mwai-trigger .mwai-icon-text {
  box-sizing: border-box !important;
  min-height: 42px !important;
  padding: 10px 14px !important;
  color: #fffaf3 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  background: linear-gradient(135deg, #8b4a28 0%, #6b341c 100%) !important;
  border: 1px solid #e1bea0 !important;
  border-radius: 11px !important;
  box-shadow: 0 9px 22px rgba(54, 29, 16, 0.24) !important;
}

.mwai-trigger .mwai-icon-text-close {
  box-sizing: border-box !important;
  display: grid !important;
  width: 30px !important;
  height: 30px !important;
  place-items: center !important;
  color: var(--ti-b244-brown-dark) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  background: var(--ti-b244-cream-light) !important;
  border: 2px solid var(--ti-b244-brown) !important;
  border-radius: 50% !important;
  box-shadow: 0 5px 13px rgba(54, 29, 16, 0.22) !important;
}

.mwai-trigger .mwai-icon-text-close:hover,
.mwai-trigger .mwai-icon-text-close:focus-visible {
  color: #fff !important;
  background: var(--ti-b244-brown) !important;
  outline: 2px solid #e8c9ad !important;
  outline-offset: 2px;
}

/* WhatsApp remains immediately recognizable, but uses the TimberIN palette. */
#ht-ctc-chat {
  right: 14px !important;
  bottom: 70px !important;
  z-index: 2147481000 !important;
}

#ht-ctc-chat svg {
  box-sizing: border-box !important;
  width: 54px !important;
  height: 54px !important;
  padding: 2px !important;
  overflow: visible !important;
  background: var(--ti-b244-cream-light) !important;
  border: 2px solid var(--ti-b244-brown) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 22px rgba(67, 34, 17, 0.26) !important;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

#ht-ctc-chat svg use {
  fill: var(--ti-b244-brown) !important;
}

#ht-ctc-chat:hover svg,
#ht-ctc-chat:focus-within svg {
  transform: translateY(-2px);
  box-shadow: 0 11px 25px rgba(67, 34, 17, 0.33) !important;
}

#ht-ctc-chat .ht-ctc-cta {
  padding: 9px 13px !important;
  color: #fffaf3 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  background: linear-gradient(135deg, #8b4a28, #6b341c) !important;
  border: 1px solid #dfbea0 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 20px rgba(67, 34, 17, 0.24) !important;
}

/* Trustindex badge: readable and visually paired with WhatsApp, not hidden below it. */
.ti-sticky-button.ti-position-right {
  right: 14px !important;
  bottom: 12px !important;
  z-index: 2147481000 !important;
  width: auto !important;
  min-width: 152px !important;
  max-width: min(230px, calc(100vw - 28px)) !important;
  overflow: hidden !important;
  color: var(--ti-b244-ink) !important;
  background: var(--ti-b244-cream-light) !important;
  border: 1px solid var(--ti-b244-border) !important;
  border-radius: 11px !important;
  box-shadow: 0 8px 22px rgba(67, 34, 17, 0.23) !important;
  cursor: pointer !important;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ti-sticky-button.ti-position-right:hover,
.ti-sticky-button.ti-position-right:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 11px 25px rgba(67, 34, 17, 0.31) !important;
}

.ti-sticky-button .ti-clickable-expand {
  z-index: 5 !important;
}

.ti-sticky-button .ti-sticky-button-header {
  box-sizing: border-box !important;
  display: flex !important;
  min-height: 27px !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 10px 4px !important;
  color: var(--ti-b244-ink) !important;
  background: linear-gradient(180deg, #fffdf9 0%, #f7eadd 100%) !important;
  border-radius: 10px 10px 0 0 !important;
}

.ti-sticky-button .ti-trust-icon,
.ti-sticky-button .ti-trust-icon img {
  width: 16px !important;
  height: 16px !important;
}

.ti-sticky-button .ti-verified-title {
  color: var(--ti-b244-ink) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

.ti-sticky-button .ti-sticky-button-footer,
.ti-sticky-button .ti-sticky-button-footer-inner {
  box-sizing: border-box !important;
  color: #fffaf3 !important;
  background: var(--ti-b244-brown) !important;
}

.ti-sticky-button .ti-sticky-button-footer-inner {
  min-height: 15px !important;
  padding: 2px 10px 3px !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  text-align: center !important;
}

/* Keep utility triggers below the intentionally modal Instagram promotion layer. */
body:has(.ti-b243-popup-layer, .ti-b243-popup-shell, .ti-instagram-popup-overlay) .mwai-trigger,
body:has(.ti-b243-popup-layer, .ti-b243-popup-shell, .ti-instagram-popup-overlay) #ht-ctc-chat,
body:has(.ti-b243-popup-layer, .ti-b243-popup-shell, .ti-instagram-popup-overlay) .ti-sticky-button {
  z-index: 2147481000 !important;
}

@media (max-width: 767px) {
  #top {
    min-height: 32px !important;
  }

  #cart {
    right: 8px !important;
    width: 104px !important;
    height: 92px !important;
  }

  #cart .widget_shopping_cart.trigger {
    width: 104px !important;
    height: 92px !important;
    padding: 45px 6px 17px !important;
  }

  #cart .widget_shopping_cart.trigger::before {
    top: 10px;
    width: 27px;
    height: 27px;
  }

  #cart .quick-cart {
    top: calc(100% + 8px) !important;
    width: min(340px, calc(100vw - 32px)) !important;
    max-height: min(66vh, 500px) !important;
    padding: 14px !important;
  }

  .mwai-trigger.mwai-open-button {
    right: auto !important;
    bottom: auto !important;
    left: max(14px, env(safe-area-inset-left)) !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    max-width: calc(100vw - 28px) !important;
  }

  .admin-bar .mwai-trigger.mwai-open-button {
    top: calc(46px + max(14px, env(safe-area-inset-top))) !important;
  }

  .mwai-trigger .mwai-icon-text {
    max-width: min(220px, calc(100vw - 28px)) !important;
  }

  #ht-ctc-chat {
    right: 12px !important;
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
  }

  #ht-ctc-chat svg {
    width: 52px !important;
    height: 52px !important;
  }

  .ti-sticky-button.ti-position-right {
    right: 12px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    min-width: 148px !important;
    max-width: min(220px, calc(100vw - 24px)) !important;
  }
}

@media (min-width: 768px) {
  .admin-bar .mwai-trigger.mwai-open-button {
    top: 50px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mwai-trigger .mwai-icon-container,
  #ht-ctc-chat svg,
  .ti-sticky-button.ti-position-right {
    transition: none !important;
  }
}
