/* Materac Violet 2.9.5: mobile purchase dock + accessible cookie settings.
   Deliberately loaded after the earlier product styles: no changes to prices, cart or consent. */

/* CookieFirst/own-consent reopen is a real button with inline layout values.
   !important overrides ONLY the hard-coded position / font-size; not the click handler. */
body #oct-reopen {
  position: fixed !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  left: 14px !important;
  right: auto !important;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 99998 !important;
  width: auto !important;
  max-width: calc(100vw - 28px) !important;
  min-width: 0 !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 1px solid #e2d9f0 !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.97) !important;
  color: #463475 !important;
  box-shadow: 0 4px 20px rgba(39,25,75,.13) !important;
  font: 650 12px/1.3 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body #oct-reopen::before {
  content: "";
  display: inline-block;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23533a89' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 8h.01M15 10h.01M10 15h.01M16 16h.01' stroke-width='3'/%3E%3C/svg%3E");
}
body #oct-reopen:hover {background:#f7f2ff !important;border-color:#c7b6e8 !important;}
body #oct-reopen:focus-visible {outline:3px solid #8e69d5 !important;outline-offset:3px;}

@media (max-width: 900px) {
  /* Remove inherited bottom:71px left over from the old mobile navigation.
     The theme already hides .msv-mobile-bottom on product pages. */
  body.single-product .msv293-product .msv-sticky-buy.msv24-sticky-buy {
    position: fixed !important;
    inset: auto 0 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: clamp(9px, 3vw, 17px) !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 66px;
    margin: 0 !important;
    padding: 10px clamp(13px,4vw,24px) calc(10px + env(safe-area-inset-bottom,0px)) !important;
    border: 0 !important;
    border-top: 1px solid #e7dff2 !important;
    border-radius: 0 !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 -8px 24px rgba(32,18,75,.11) !important;
    z-index: 120 !important;
    box-sizing: border-box;
  }
  body.single-product .msv293-product .msv-sticky-buy .msv-sticky-price {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    max-width: 55%;
    overflow: hidden;
  }
  body.single-product .msv293-product .msv-sticky-buy .msv-sticky-price small {
    display: block;
    color: #75678f;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: 0;
  }
  body.single-product .msv293-product .msv-sticky-buy .msv-sticky-price strong {
    display: block;
    color: #34206c;
    font-size: clamp(14px,3.7vw,19px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.018em;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  body.single-product .msv293-product .msv-sticky-buy .msv-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-height: 44px !important;
    max-width: 52% !important;
    margin: 0 !important;
    padding: 11px 15px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: linear-gradient(110deg,#563a98,#7131c4) !important;
    box-shadow: 0 4px 10px rgba(69,35,142,.16);
    color: white !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    font-weight: 750 !important;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    white-space: normal !important;
  }
  body.single-product .msv293-product .msv-sticky-buy .msv-btn:focus-visible {
    outline: 3px solid #ab8aea !important;
    outline-offset: 2px;
  }
  body.single-product .msv-product-page {padding-bottom:calc(95px + env(safe-area-inset-bottom,0px));}

  /* No JS fallback: keep cookies above the still-visible dock. The JS below
     turns off the dock while its normal Add-to-cart form is on screen. */
  body.single-product #oct-reopen {
    bottom: calc(var(--msv295-buy-height, 78px) + 12px) !important;
  }
  body.single-product.msv295-sticky-js:not(.msv295-mobile-sticky-active) #oct-reopen {
    bottom: calc(12px + env(safe-area-inset-bottom,0px)) !important;
  }
  body.single-product .msv-sticky-buy.msv295-sticky-enhanced {
    transform: translate3d(0,110%,0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease, visibility .22s;
  }
  body.single-product .msv-sticky-buy.msv295-sticky-enhanced.is-visible {
    transform: translate3d(0,0,0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
@media (max-width: 380px) {
  body.single-product .msv293-product .msv-sticky-buy.msv24-sticky-buy {gap:8px !important;padding-inline:11px !important;}
  body.single-product .msv293-product .msv-sticky-buy .msv-btn {max-width:51% !important;font-size:11.5px !important;padding-inline:10px !important;}
  body.single-product .msv293-product .msv-sticky-buy .msv-sticky-price strong {font-size:14px;}
  body #oct-reopen {left:10px !important;max-width:calc(100vw - 20px) !important;font-size:11.5px !important;}
}
@media (prefers-reduced-motion: reduce) {
  body.single-product .msv-sticky-buy.msv295-sticky-enhanced,
  body #oct-reopen {transition: none !important;}
}


/* 2.9.7: The mobile navigation includes its own cookie settings action.
   Hide the original floating launcher ONLY while that navigation is displayed.
   This prevents any overlapping regardless of inline bottom/left/z-index values. */
@media (max-width:700px) {
  body:not(.single-product) #oct-reopen {
    display: none !important;
  }
  /* Keep the reopened consent panel clear of the mobile navigation as well. */
  body:not(.single-product) #oct-banner {
    bottom: calc(79px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px)) !important;
  }
  body .msv-mobile-bottom {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: stretch;
  }
  body .msv-mobile-bottom > a,
  body .msv-mobile-bottom > button.msv-mobile-cookies {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    height: 51px;
    min-height: 49px;
    padding: 0 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #6a5b80;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  body .msv-mobile-bottom > button.msv-mobile-cookies span,
  body .msv-mobile-bottom > a span {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    margin-top: 3px;
    white-space: nowrap;
  }
  body .msv-mobile-bottom > button.msv-mobile-cookies .msv21-svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
  }
  body .msv-mobile-bottom > button.msv-mobile-cookies:focus-visible {
    outline: 2px solid #8e69d5;
    outline-offset: -2px;
    border-radius: 8px;
  }
  body .msv-mobile-bottom > button.msv-mobile-cookies:hover {
    color: #4d327f;
  }
}
