/* YITH retains both modal implementations and all form/submission behavior. */
body.fpb-shell-active {
  --fpb-project-dialog: rgb(24 24 24 / 96%);
  --fpb-project-dialog-field: rgb(255 255 255 / 5%);
}
:root[data-fpb-theme="light"] body.fpb-shell-active {
  --fpb-project-dialog: rgb(227 225 222 / 96%);
  --fpb-project-dialog-field: #efeeeb;
}
@layer fpb-project-modals {
  body.fpb-shell-active :is(.yith-wcwl-modal, .yith-wcwl-pp-modal) { z-index: 10020 !important; color: var(--fpb-ink) !important; font-family: var(--fpb-ui-font) !important; }
  body.fpb-shell-active :is(.yith-wcwl-overlay, .yith-wcwl-modal .lapilliUI-Modal__backdrop) {
    background: rgb(0 0 0 / 38%) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
  body.fpb-shell-active .yith-wcwl-overlay { position: fixed !important; inset: 0 !important; width: 100% !important; height: 100% !important; z-index: 10010 !important; }
  body.fpb-shell-active :is(.yith-wcwl-pp-modal, .yith-wcwl-modal .lapilliUI-Modal__paper) {
    box-sizing: border-box !important;
    width: min(560px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100dvh - 64px) !important;
    border: 1px solid var(--fpb-line) !important;
    border-radius: 28px !important;
    background: linear-gradient(145deg, rgb(255 255 255 / 4%), transparent 55%), var(--fpb-project-dialog) !important;
    box-shadow: var(--fpb-shadow), inset 0 1px 0 rgb(255 255 255 / 6%) !important;
    color: var(--fpb-ink) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
  }
  body.fpb-shell-active .yith-wcwl-pp-modal { position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; margin: 0 !important; padding: 0 !important; }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Modal__paper { padding: 56px 40px 40px !important; margin: 24px !important; }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Modal__container { padding: 0 !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal :where(.pp_content_container, .pp_content, .pp_fade, .pp_inline, #pp_full_res) {
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--fpb-ink) !important;
  }
  body.fpb-shell-active .yith-wcwl-pp-modal .pp_inline { padding: 40px !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal .pp_details { position: static !important; margin: 0 !important; height: 0 !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal .pp_inline form { width: 100% !important; margin: 0 !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal .yith-wcwl-popup-content { padding: 0 !important; border: 0 !important; }
  body.fpb-shell-active :is(.yith-wcwl-modal, .yith-wcwl-pp-modal) :is(p, label, input, select, .lapilliUI-Typography__root, .lapilliUI-Select__toggleLabel, .lapilliUI-RadioGroup__optionLabel) {
    color: var(--fpb-ink) !important;
    font-family: var(--fpb-ui-font) !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    text-shadow: none !important;
  }
  body.fpb-shell-active .yith-wcwl-pp-modal .popup-description { margin: 0 32px 28px 0 !important; text-align: left !important; font-size: 28px !important; font-weight: 500 !important; line-height: 1.25 !important; letter-spacing: -.04em !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal .heading-icon { margin: 0 0 22px !important; text-align: left !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal .heading-icon svg { width: 36px !important; height: 36px !important; color: var(--fpb-muted) !important; }
  body.fpb-shell-active .yith-wcwl-modal__title { display: block !important; padding: 0 !important; margin: 0 !important; }
  body.fpb-shell-active .yith-wcwl-modal__icon { display: block !important; width: 44px !important; height: 44px !important; object-fit: contain; margin: 0 0 24px !important; }
  body.fpb-shell-active .yith-wcwl-add-to-wishlist-modal__type_selection { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
  body.fpb-shell-active .yith-wcwl-add-to-wishlist-modal__type_option { min-height: 44px !important; padding: 10px 14px !important; font: 500 12px/1.5 var(--fpb-ui-font) !important; text-transform: none !important; }
  body.fpb-shell-active .yith-wcwl-add-to-wishlist-modal__type_option:not(.yith-wcwl-add-to-wishlist-modal__type_option--selected) { border: 1px solid transparent !important; border-radius: 999px !important; background: transparent !important; box-shadow: none !important; color: var(--fpb-muted) !important; }
  body.fpb-shell-active .yith-wcwl-modal__content { overflow: visible !important; padding: 0 !important; margin: 28px 0 !important; }
  body.fpb-shell-active .yith-wcwl-modal__actions { display: flex !important; justify-content: flex-end !important; padding: 24px 0 0 !important; margin: 0 !important; border-top: 1px solid var(--fpb-line) !important; }
  body.fpb-shell-active :is(.yith-wcwl-modal, .yith-wcwl-pp-modal) :is(input[type="text"], select, .lapilliUI-Select__toggle) {
    box-sizing: border-box !important; width: 100% !important; min-height: 48px !important; margin: 0 !important; padding: 12px 14px !important;
    border: 1px solid var(--fpb-line) !important; border-radius: 12px !important; background: var(--fpb-project-dialog-field) !important; color: var(--fpb-ink) !important; box-shadow: none !important;
  }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Input__backdrop { border: 0 !important; background: transparent !important; }
  body.fpb-shell-active :is(.yith-wcwl-modal, .yith-wcwl-pp-modal) input::placeholder { color: var(--fpb-muted) !important; opacity: 1 !important; }
  body.fpb-shell-active :is(.yith-wcwl-modal, .yith-wcwl-pp-modal) :is(.wishlist-privacy-radio, .lapilliUI-RadioGroup__root) { display: grid !important; gap: 0 !important; margin: 24px 0 !important; }
  body.fpb-shell-active :is(.yith-wcwl-modal, .yith-wcwl-pp-modal) :is(.wishlist-privacy-radio label, .lapilliUI-RadioGroup__option) { margin: 0 !important; padding: 14px 0 !important; border: 0 !important; border-bottom: 1px solid var(--fpb-line) !important; border-radius: 0 !important; background: transparent !important; text-align: left !important; }
  body.fpb-shell-active .yith-wcwl-pp-modal .wishlist-privacy-radio input { width: 16px !important; height: 16px !important; margin: 0 10px 0 0 !important; vertical-align: middle; accent-color: var(--fpb-green); }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-RadioGroup__optionRadioShape { border-color: var(--fpb-muted) !important; }
  body.fpb-shell-active :is(.yith-wcwl-modal__primary-button, .yith-wcwl-pp-modal input[type="submit"]) { min-height: 46px !important; padding: 12px 22px !important; font: 500 12px/1.6 var(--fpb-ui-font) !important; text-transform: none !important; }
  body.fpb-shell-active :is(.yith-wcwl-pp-modal .pp_close, .yith-wcwl-modal .lapilliUI-Modal__close) {
    box-sizing: border-box !important; position: absolute !important; top: 14px !important; right: 14px !important; left: auto !important;
    display: grid !important; place-items: center !important; width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important;
    padding: 0 !important; border: 1px solid var(--fpb-line) !important; border-radius: 50% !important; background: var(--fpb-project-dialog-field) !important;
    color: var(--fpb-ink) !important; text-indent: 0 !important; text-decoration: none !important; box-shadow: none !important; font-size: 0 !important;
  }
  body.fpb-shell-active .yith-wcwl-pp-modal .pp_close::before { content: '×' !important; font: 300 23px/1 var(--fpb-ui-font) !important; }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Modal__close svg { width: 18px; height: 18px; }
  body.fpb-shell-active .fpb-yith-project-options { z-index: 10040 !important; }
  body.fpb-shell-active .fpb-yith-project-options .lapilliUI-Dropdown__content { padding: 8px !important; border: 1px solid var(--fpb-line) !important; border-radius: 16px !important; background: var(--fpb-project-dialog) !important; color: var(--fpb-ink) !important; box-shadow: var(--fpb-shadow) !important; }
  body.fpb-shell-active .fpb-yith-project-options .lapilliUI-Select__option { min-height: 42px !important; padding: 10px 12px !important; border-radius: 8px !important; background: transparent !important; color: var(--fpb-ink) !important; font: 400 13px/1.7 var(--fpb-ui-font) !important; }
  body.fpb-shell-active .fpb-yith-project-options .lapilliUI-Select__option:is(:hover, [aria-selected="true"], .lapilliUI--active) { background: var(--fpb-panel-soft) !important; }
  @media (max-width: 760px) {
    body.fpb-shell-active :is(.yith-wcwl-pp-modal, .yith-wcwl-modal .lapilliUI-Modal__paper) { width: calc(100vw - 28px) !important; max-width: calc(100vw - 28px) !important; max-height: calc(100dvh - 28px) !important; border-radius: 24px !important; }
    body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Modal__paper { padding: 56px 22px 28px !important; margin: 14px !important; }
    body.fpb-shell-active .yith-wcwl-pp-modal .pp_inline { padding: 28px 22px !important; }
    body.fpb-shell-active .yith-wcwl-add-to-wishlist-modal__type_option { padding: 10px 12px !important; font-size: 11px !important; }
    body.fpb-shell-active :is(.yith-wcwl-modal__primary-button, .yith-wcwl-pp-modal input[type="submit"]) { width: 100% !important; }
  }
}

body.fpb-shell-active .yith-wcwl-add-to-wishlist-modal__type_option--selected { --fpb-control-fill: var(--fpb-button-selected-fill); --fpb-control-border: .48; }

body.fpb-shell-active .fpb-project-product-preview {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 24px; margin: 0 0 28px; padding: 0;
}
body.fpb-shell-active .fpb-project-product-preview::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -12px; top: 50%; width: 176px; height: 176px; transform: translateY(-50%);
  background: radial-gradient(ellipse, rgb(255 255 255 / 12%) 0%, rgb(255 255 255 / 4%) 35%, transparent 72%);
  filter: blur(14px);
}
:root[data-fpb-theme="light"] body.fpb-shell-active .fpb-project-product-preview::before {
  background: radial-gradient(ellipse, rgb(255 255 255 / 18%) 0%, rgb(255 255 255 / 6%) 35%, transparent 72%);
}
body.fpb-shell-active .fpb-project-product-preview img {
  display: block; flex: 0 0 152px; width: 152px; height: 152px; padding: 12px;
  box-sizing: border-box; object-fit: contain; border-radius: 18px;
  background: transparent; filter: none; mix-blend-mode: normal;
}
body.fpb-shell-active .fpb-project-product-preview figcaption { display: grid; gap: 12px; min-width: 0; margin: 0; }
body.fpb-shell-active .fpb-project-product-preview strong { color: var(--fpb-ink); font: 500 18px/1.4 var(--fpb-ui-font); letter-spacing: -.025em; overflow-wrap: anywhere; }
body.fpb-shell-active .fpb-project-product-preview span { color: var(--fpb-muted); font: 500 11px/1.6 var(--fpb-ui-font); letter-spacing: .06em; text-transform: uppercase; }
@layer fpb-project-modals {
  body.fpb-shell-active .fpb-has-product-preview .yith-wcwl-modal__icon { display: none !important; }
}
:root:not([data-fpb-theme="light"]) body.fpb-shell-active .yith-wcwl-modal__icon { filter: brightness(0) invert(1); }

/* Match the shared segmented pills, overriding their original underline and
   the general action-button rules in the same important cascade layer. */
@layer fpb-glass-buttons {
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_selection {
    display: flex !important; flex-wrap: nowrap !important; gap: 4px !important;
    padding: 4px !important; border: 1px solid var(--fpb-line) !important; border-radius: 999px !important;
    background: var(--fpb-project-dialog-field) !important;
  }
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_option {
    flex: 1 1 0 !important; min-width: 0 !important; min-height: 44px !important;
    padding: 10px 12px !important; border: 1px solid transparent !important; border-radius: 999px !important;
    background: transparent !important; box-shadow: none !important; color: var(--fpb-muted) !important;
    font: 500 12px/1.5 var(--fpb-ui-font) !important; white-space: normal !important;
  }
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_option--selected {
    border-color: var(--fpb-line) !important; background: var(--fpb-panel-soft) !important; color: var(--fpb-ink) !important;
  }
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_option::before,
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_selection::before,
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_option::after,
  body.fpb-shell-active .yith-wcwl-modal .yith-wcwl-add-to-wishlist-modal__type_selection::after { content: none !important; display: none !important; }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Modal__close {
    padding: 0 !important; width: 40px !important; min-width: 40px !important; height: 40px !important;
    display: grid !important; place-items: center !important; color: var(--fpb-ink) !important;
  }
  body.fpb-shell-active .yith-wcwl-modal .lapilliUI-Modal__close svg {
    display: block !important; width: 20px !important; min-width: 20px !important; height: 20px !important;
    flex: 0 0 20px !important; margin: 0 !important; padding: 0 !important; fill: currentColor !important;
  }
}
@media (max-width: 480px) {
  body.fpb-shell-active .fpb-project-product-preview { flex-direction: column; gap: 16px; text-align: center; }
  body.fpb-shell-active .fpb-project-product-preview img { flex-basis: auto; width: 136px; height: 136px; }
  body.fpb-shell-active .fpb-project-product-preview::before { left: 50%; top: 68px; width: 160px; height: 160px; transform: translate(-50%, -50%); }
}
