/** Shopify CDN: Minification failed

Line 614:24 Expected ":"
Line 614:67 Unexpected "'@theme/dialog'"
Line 615:21 Expected ":"
Line 615:29 Unexpected "'@theme/events'"
Line 616:27 Expected ":"
Line 616:35 Unexpected "'@theme/utilities'"
Line 628:2 Expected identifier but found "#summaryThreshold"
Line 631:2 Expected identifier but found "#historyAbortController"
Line 633:2 Unexpected "connectedCallback("
Line 634:9 Expected ":"
... and 52 more hidden warnings

**/
:root {
  --weem-bg: #0b0b0c;
  --weem-bg-2: #111113;
  --weem-surface: rgba(255, 255, 255, 0.04);
  --weem-surface-2: rgba(255, 255, 255, 0.06);
  --weem-line: rgba(255, 255, 255, 0.08);
  --weem-line-strong: rgba(255, 255, 255, 0.14);
  --weem-text: #f5f3ef;
  --weem-muted: rgba(245, 243, 239, 0.72);
  --weem-gold: #d8b97f;
  --weem-gold-2: #f5f3ef;
  --weem-green: #93a36b;
  --weem-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

html,
body {
  background:
    radial-gradient(circle at top right, rgba(147, 163, 107, 0.06), transparent 22%),
    radial-gradient(circle at left 20%, rgba(197, 163, 106, 0.06), transparent 18%),
    linear-gradient(180deg, var(--weem-bg) 0%, var(--weem-bg-2) 100%) !important;
  color: var(--weem-text) !important;
}

body,
.content-for-layout,
main {
  color: var(--weem-text) !important;
}

/* allgemeine Seitenbereiche dunkel */
.template-cart main,
.template-customers main,
.template-search main,
.template-page main,
.template-policy main,
.template-blog main,
.template-article main,
.template-404 main,
.shopify-policy__container,
.shopify-policy__body,
.customer,
.main-page,
.main-search,
.main-cart,
.main-blog,
.main-article,
.main-404 {
  background: transparent !important;
  color: var(--weem-text) !important;
}

/* Container / Cards / Drawer / Modal */
.shopify-policy__container,
.customer,
.customer form,
.customer .field,
.main-page .page,
.main-cart,
.cart__warnings,
.cart__footer,
.totals,
.cart-items,
.cart-item,
cart-drawer .drawer__inner,
.cart-drawer .drawer__inner,
.cart-drawer .drawer__header,
.cart-drawer .drawer__footer,
.cart-drawer .cart-drawer__warnings,
.cart-drawer .cart-drawer__empty-content,
.drawer__inner,
.drawer__header,
.drawer__footer,
.predictive-search,
.predictive-search__results-groups-wrapper,
.modal__content,
.search__results,
.article-template,
.blog-articles article,
.pagination-wrapper,
.facets-container,
.facet-filters,
.collection-hero,
.main-page .rte,
.main-article .article-template__content {
  background: var(--weem-surface) !important;
  color: var(--weem-text) !important;
  border: 1px solid var(--weem-line) !important;
  border-radius: 28px !important;
  box-shadow: var(--weem-shadow) !important;
  backdrop-filter: blur(14px);
}

/* große Wrapper nicht unnötig abrunden */
.main-cart,
.customer,
.shopify-policy__container {
  padding: 28px !important;
}

/* Texte */
.template-cart h1,
.template-cart h2,
.template-cart h3,
.template-customers h1,
.template-customers h2,
.template-customers h3,
.template-page h1,
.template-page h2,
.template-page h3,
.template-policy h1,
.template-policy h2,
.template-policy h3,
.template-search h1,
.template-search h2,
.template-search h3,
.template-blog h1,
.template-blog h2,
.template-blog h3,
.template-article h1,
.template-article h2,
.template-article h3,
.template-404 h1,
.template-404 h2,
.template-404 h3,
.shopify-policy__container h1,
.shopify-policy__container h2,
.shopify-policy__container h3,
.customer h1,
.customer h2,
.customer h3,
.main-cart h1,
.main-cart h2,
.main-cart h3,
.drawer__inner h1,
.drawer__inner h2,
.drawer__inner h3,
.cart-drawer h1,
.cart-drawer h2,
.cart-drawer h3 {
  color: var(--weem-text) !important;
  letter-spacing: -0.04em;
}

.template-cart p,
.template-customers p,
.template-page p,
.template-policy p,
.template-search p,
.template-blog p,
.template-article p,
.template-404 p,
.shopify-policy__container p,
.shopify-policy__container li,
.customer p,
.customer li,
.main-cart p,
.main-cart li,
.drawer__inner p,
.drawer__inner li,
.cart-drawer p,
.cart-drawer li,
small,
label {
  color: var(--weem-muted) !important;
}

/* Links */
a {
  color: var(--weem-gold) !important;
}

a:hover {
  opacity: 0.86;
}

/* Inputs */
input,
select,
textarea {
  background: #121215 !important;
  color: var(--weem-text) !important;
  border: 1px solid var(--weem-line-strong) !important;
  border-radius: 16px !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(245, 243, 239, 0.42) !important;
}

/* Buttons primär */
.button,
a.button,
button.button,
input.button,
.shopify-payment-button__button,
.cart__checkout-button,
.customer button[type='submit'],
input[type='submit'],
button[type='submit'] {
  background: linear-gradient(180deg, var(--weem-gold-2) 0%, var(--weem-gold) 160%) !important;
  color: #0f0f10 !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-weight: 800 !important;
}

/* sekundäre Buttons */
.button-secondary,
.button--secondary,
a.button.button--secondary,
button.button--secondary {
  background: transparent !important;
  color: var(--weem-text) !important;
  border: 1px solid var(--weem-line-strong) !important;
}

/* Tabellen / Warenkorb */
table,
.cart-items,
.cart-item,
.cart-item td,
.cart-item th,
tbody,
thead,
tr {
  color: var(--weem-text) !important;
  border-color: var(--weem-line) !important;
}

.cart-item__name,
.cart-item__name:hover,
.product-option,
.totals__total-value,
.totals__subtotal-value,
.quantity,
.quantity__input {
  color: var(--weem-text) !important;
}

/* cart drawer speziell */
cart-drawer,
.cart-drawer,
.cart-drawer * {
  color: var(--weem-text);
}

cart-drawer .drawer__inner,
.cart-drawer .drawer__inner,
.cart-drawer .drawer__header,
.cart-drawer .drawer__footer,
.cart-drawer .cart-drawer__warnings,
.cart-drawer .cart-drawer__empty-content {
  background:
    radial-gradient(circle at top right, rgba(197, 163, 106, 0.08), transparent 22%),
    linear-gradient(180deg, #0c0c0d 0%, #121214 100%) !important;
}

.cart-drawer .button,
.cart-drawer a.button,
.cart__warnings .button,
.cart__warnings a.button {
  min-height: 54px !important;
  padding-inline: 24px !important;
}

/* Icons */
svg,
svg path,
svg circle,
svg rect,
svg line,
svg polyline {
  color: currentColor;
}

/* pagination / chips / filters */
.pagination__item,
.facets__summary,
.facet-filters__field,
.select,
.select__select {
  background: #121215 !important;
  color: var(--weem-text) !important;
  border-color: var(--weem-line-strong) !important;
}

/* Policies */
.shopify-policy__container {
  max-width: 1100px !important;
}

/* Login / Register / Reset */
.customer form,
.customer .field,
.customer .field__input,
.customer .field input {
  color: var(--weem-text) !important;
}

/* Leerzustände */
.empty,
.is-empty,
.cart__empty-text,
.cart-drawer__empty-content,
.cart-drawer__warnings {
  color: var(--weem-text) !important;
}

/* Mobile */
@media screen and (max-width: 749px) {
  .shopify-policy__container,
  .customer,
  .main-page,
  .main-cart,
  .cart__warnings,
  .cart-drawer__empty-content,
  .drawer__inner,
  .article-template,
  .search__results {
    text-align: center !important;
    padding: 22px !important;
  }

  .shopify-policy__container h1,
  .shopify-policy__container h2,
  .shopify-policy__container p,
  .customer h1,
  .customer h2,
  .customer p,
  .main-page h1,
  .main-page h2,
  .main-page p,
  .main-cart h1,
  .main-cart h2,
  .main-cart p,
  .cart-drawer__empty-content h2,
  .cart-drawer__empty-content p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .button,
  a.button,
  button.button,
  input.button,
  .shopify-payment-button__button,
  .cart__checkout-button,
  .customer button[type='submit'],
  input[type='submit'],
  button[type='submit'] {
    width: 100% !important;
    max-width: 360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
  }

  .cart-drawer .button,
  .cart__warnings .button {
    max-width: 100% !important;
  }
}

/* === WEEMCOS BUTTON FIX: EINHEITLICHE BUTTON-FARBEN === */

.button,
a.button,
button.button,
input.button,
button[type='submit'],
input[type='submit'],
.shopify-payment-button__button,
.cart__checkout-button,
.customer button,
.customer [type='submit'],
.wc-empty-btn-primary,
.wc-checkout,
.wp-add,
.wd-btn-primary,
.cart-drawer .button,
.cart__warnings .button,
.cart-drawer a.button,
.cart__warnings a.button {
  background: linear-gradient(180deg, #f5f3ef 0%, #d8b97f 160%) !important;
  color: #0f0f10 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.button *,
a.button *,
button.button *,
button[type='submit'] *,
input[type='submit'] *,
.shopify-payment-button__button *,
.cart__checkout-button *,
.customer button *,
.customer [type='submit'] *,
.wc-empty-btn-primary *,
.wc-checkout *,
.wp-add *,
.wd-btn-primary *,
.cart-drawer .button *,
.cart__warnings .button *,
.cart-drawer a.button *,
.cart__warnings a.button * {
  color: #0f0f10 !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* Sekundäre Buttons überall gleich */
.button-secondary,
.button--secondary,
a.button.button--secondary,
button.button--secondary,
.wc-empty-btn-secondary,
.wd-btn-secondary,
.wc-secondary-link {
  background: transparent !important;
  color: #f5f3ef !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.button-secondary *,
.button--secondary *,
a.button.button--secondary *,
button.button--secondary *,
.wc-empty-btn-secondary *,
.wd-btn-secondary *,
.wc-secondary-link * {
  color: #f5f3ef !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}
/* === WEEMCOS CART DRAWER FIX === */

cart-drawer,
.cart-drawer {
  color: var(--weem-text) !important;
}

cart-drawer .drawer,
.cart-drawer .drawer,
cart-drawer .drawer__inner,
.cart-drawer .drawer__inner,
cart-drawer .drawer__header,
.cart-drawer .drawer__header,
cart-drawer .drawer__footer,
.cart-drawer .drawer__footer,
cart-drawer .cart-drawer__empty-content,
.cart-drawer .cart-drawer__empty-content,
cart-drawer .cart-drawer__warnings,
.cart-drawer .cart-drawer__warnings {
  background:
    radial-gradient(circle at top right, rgba(147, 163, 107, 0.08), transparent 22%),
    radial-gradient(circle at left 20%, rgba(197, 163, 106, 0.08), transparent 18%),
    linear-gradient(180deg, #0b0b0c 0%, #111113 100%) !important;
  color: #f5f3ef !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

cart-drawer .drawer__inner,
.cart-drawer .drawer__inner {
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
}

cart-drawer .drawer__header,
.cart-drawer .drawer__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

cart-drawer .drawer__footer,
.cart-drawer .drawer__footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

cart-drawer .cart-drawer__empty-content,
.cart-drawer .cart-drawer__empty-content,
cart-drawer .cart-drawer__warnings,
.cart-drawer .cart-drawer__warnings {
  min-height: 100%;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center !important;
  padding: 42px 24px !important;
}

cart-drawer .cart-drawer__empty-content h1,
.cart-drawer .cart-drawer__empty-content h1,
cart-drawer .cart-drawer__empty-content h2,
.cart-drawer .cart-drawer__empty-content h2,
cart-drawer .cart-drawer__warnings h1,
.cart-drawer .cart-drawer__warnings h1,
cart-drawer .cart-drawer__warnings h2,
.cart-drawer .cart-drawer__warnings h2 {
  color: #f5f3ef !important;
  font-size: clamp(34px, 5vw, 56px) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.05em !important;
  font-weight: 900 !important;
  margin-bottom: 14px !important;
}

cart-drawer .cart-drawer__empty-content p,
.cart-drawer .cart-drawer__empty-content p,
cart-drawer .cart-drawer__warnings p,
.cart-drawer .cart-drawer__warnings p,
cart-drawer .cart-drawer__empty-content .rte,
.cart-drawer .cart-drawer__empty-content .rte,
cart-drawer .cart-drawer__warnings .rte,
.cart-drawer .cart-drawer__warnings .rte {
  color: rgba(245, 243, 239, 0.72) !important;
  font-size: 17px !important;
  line-height: 1.8 !important;
  max-width: 520px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

cart-drawer .button,
.cart-drawer .button,
cart-drawer a.button,
.cart-drawer a.button,
cart-drawer button,
.cart-drawer button {
  background: linear-gradient(180deg, #f5f3ef 0%, #d8b97f 160%) !important;
  color: #0f0f10 !important;
  border: 0 !important;
  border-radius: 999px !important;
  min-height: 56px !important;
  padding: 0 28px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

cart-drawer .button *,
.cart-drawer .button *,
cart-drawer a.button *,
.cart-drawer a.button *,
cart-drawer button *,
.cart-drawer button * {
  color: #0f0f10 !important;
}

cart-drawer a,
.cart-drawer a {
  color: #d8b97f !important;
}

cart-drawer .drawer__close,
.cart-drawer .drawer__close,
cart-drawer .icon-close,
.cart-drawer .icon-close,
cart-drawer .modal__close-button,
.cart-drawer .modal__close-button {
  color: #f5f3ef !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

cart-drawer .drawer__close *,
.cart-drawer .drawer__close *,
cart-drawer .icon-close *,
.cart-drawer .icon-close *,
cart-drawer .modal__close-button *,
.cart-drawer .modal__close-button * {
  color: #f5f3ef !important;
  stroke: currentColor !important;
}

@media screen and (max-width: 749px) {
  cart-drawer .cart-drawer__empty-content,
  .cart-drawer .cart-drawer__empty-content,
  cart-drawer .cart-drawer__warnings,
  .cart-drawer .cart-drawer__warnings {
    padding: 32px 20px !important;
  }

  cart-drawer .button,
  .cart-drawer .button,
  cart-drawer a.button,
  .cart-drawer a.button,
  cart-drawer button,
  .cart-drawer button {
    width: 100% !important;
    max-width: 320px !important;
    justify-content: center !important;
  }
}
import { DialogComponent, DialogOpenEvent, DialogCloseEvent } from '@theme/dialog';
import { CartAddEvent } from '@theme/events';
import { isMobileBreakpoint } from '@theme/utilities';

/**
 * A custom element that manages a cart drawer.
 *
 * @typedef {object} Refs
 * @property {HTMLDialogElement} dialog - The dialog element.
 *
 * @extends {DialogComponent}
 */
class CartDrawerComponent extends DialogComponent {
  /** @type {number} */
  #summaryThreshold = 0.5;

  /** @type {AbortController | null} */
  #historyAbortController = null;

  connectedCallback() {
    super.connectedCallback();
    document.addEventListener(CartAddEvent.eventName, this.#handleCartAdd);
    this.addEventListener(DialogOpenEvent.eventName, this.#updateStickyState);
    this.addEventListener(DialogOpenEvent.eventName, this.#handleHistoryOpen);
    this.addEventListener(DialogCloseEvent.eventName, this.#handleHistoryClose);

    if (history.state?.cartDrawerOpen) {
      history.replaceState(null, '');
    }
  }

  disconnectedCallback() {
    super.disconnectedCallback();
    document.removeEventListener(CartAddEvent.eventName, this.#handleCartAdd);
    this.removeEventListener(DialogOpenEvent.eventName, this.#updateStickyState);
    this.removeEventListener(DialogOpenEvent.eventName, this.#handleHistoryOpen);
    this.removeEventListener(DialogCloseEvent.eventName, this.#handleHistoryClose);
    this.#historyAbortController?.abort();
  }

  #handleHistoryOpen = () => {
    if (!isMobileBreakpoint()) return;

    if (!history.state?.cartDrawerOpen) {
      history.pushState({ cartDrawerOpen: true }, '');
    }

    this.#historyAbortController = new AbortController();
    window.addEventListener('popstate', this.#handlePopState, { signal: this.#historyAbortController.signal });
  };

  #handleHistoryClose = () => {
    this.#historyAbortController?.abort();
    if (history.state?.cartDrawerOpen) {
      history.back();
    }
  };

  #handlePopState = async () => {
    if (this.refs.dialog?.open) {
      this.refs.dialog.style.setProperty('--dialog-drawer-closing-animation', 'none');
      await this.closeDialog();
      this.refs.dialog.style.removeProperty('--dialog-drawer-closing-animation');
    }
  };

  #handleCartAdd = () => {
    if (this.hasAttribute('auto-open')) {
      this.showDialog();
    }
  };

  open() {
    this.showDialog();

    /**
     * Close cart drawer when installments CTA is clicked to avoid overlapping dialogs
     */
    customElements.whenDefined('shopify-payment-terms').then(() => {
      const installmentsContent = document.querySelector('shopify-payment-terms')?.shadowRoot;
      const cta = installmentsContent?.querySelector('#shopify-installments-cta');
      cta?.addEventListener('click', this.closeDialog, { once: true });
    });
  }

  close() {
    this.closeDialog();
  }

  #updateStickyState() {
    const { dialog } = /** @type {Refs} */ (this.refs);
    if (!dialog) return;

    // Refs do not cross nested `*-component` boundaries (e.g., `cart-items-component`), so we query within the dialog.
    const content = dialog.querySelector('.cart-drawer__content');
    const summary = dialog.querySelector('.cart-drawer__summary');

    if (!content || !summary) {
      // Ensure the dialog doesn't get stuck in "unsticky" mode when summary disappears (e.g., empty cart).
      dialog.setAttribute('cart-summary-sticky', 'false');
      return;
    }

    const drawerHeight = dialog.getBoundingClientRect().height;
    const summaryHeight = summary.getBoundingClientRect().height;
    const ratio = summaryHeight / drawerHeight;
    dialog.setAttribute('cart-summary-sticky', ratio > this.#summaryThreshold ? 'false' : 'true');
  }
}

if (!customElements.get('cart-drawer-component')) {
  customElements.define('cart-drawer-component', CartDrawerComponent);
}
