.ref-style-card { min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.ref-style-card > :first-child { flex: 1 1 auto; }
.ref-style-card:has(> [hidden], > [data-catalog-visibility="hidden"]) { display: none; }
.ref-style-toggle, .ref-remove { font: inherit; color: var(--color-primary, #75488a); cursor: pointer; }
.ref-style-toggle { display: block; width: 100%; min-height: 44px; margin-block: .3rem; padding: .35rem .2rem; font-size: .8rem; line-height: 1.25; font-weight: 600; border: 1px solid #e9e2ee; background: #fff; border-radius: .55rem; }
.ref-style-toggle[aria-pressed="true"] { background: #f2eaf7; border-color: #b894c9; }
.ref-remove { border: 0; background: transparent; padding: .35rem; min-height: 40px; text-decoration: underline; text-underline-offset: .15em; }
.ref-dialog { position: fixed; inset: auto 0 0 auto; width: min(100%, 490px); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 1rem; border: 0; background: white; color: #302439; overflow: auto; }
.ref-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: .55rem; }
.ref-dialog::backdrop { background: #21122d70; }
.ref-dialog-list { overflow: auto; }
.ref-actions { display: flex; flex-wrap: wrap; gap: .45rem; padding-bottom: env(safe-area-inset-bottom); }
.ref-actions button { white-space: normal; }
.ref-rows { list-style: none; margin: .5rem 0 0; padding: 0; }
.ref-rows li { display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid #eee6f3; padding: .38rem 0; overflow-wrap: anywhere; }
.ref-rows li > :is(div,span) { flex: 1; min-width: 0; }
.ref-rows img { width: 50px; height: 55px; object-fit: contain; border-radius: .3rem; background: #f9f7fa; }
.ref-rows small { display: block; }
.ref-form-block { min-width: 0; padding: .72rem; border: 1px solid #e9e2ee; border-radius: .65rem; background: #faf7fc; }
.ref-form-block p { font-size: .87rem; margin: .3rem 0; }
.ref-form-block input[type=file] { max-width: 100%; }
.ref-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:is(.ref-dock,.ref-notice,.ref-form-block,.ref-form-block p)[hidden] { display: none; }
@media(max-width: 600px) {
  .ref-dialog { inset: auto 0 0; height: min(90dvh, 690px); border-radius: 1rem 1rem 0 0; }
}

form[data-validate] > [aria-hidden="true"]:has(input[name="website"]) { inset: 0 auto auto 0 !important; clip-path: inset(50%); }

@media (max-width: 700px) {
  body:has(#wholesale-inquiry) { overflow-x: clip; }
  body:has(#wholesale-inquiry) input[name="website"] { width: 1px !important; min-width: 0 !important; padding: 0 !important; }
  #wholesale-inquiry .grid-2,
  #wholesale-inquiry .form-grid,
  body:has(#wholesale-inquiry) .grid-3:has(> .contact-card) { grid-template-columns: minmax(0, 1fr); }
  #wholesale-inquiry .grid-2 > *,
  #wholesale-inquiry .form-grid > *,
  #wholesale-inquiry .whatsapp-number > *,
  body:has(#wholesale-inquiry) .contact-card > div { min-width: 0; }
  #wholesale-inquiry .whatsapp-number select { max-width: 48%; }
  body:has(#wholesale-inquiry) .container:has(> .grid-3 > .contact-card) { overflow-x: clip; }
  body:has(#wholesale-inquiry) .contact-card { min-width: 0; overflow-wrap: anywhere; }
  body:has(#wholesale-inquiry) .contact-card a { white-space: normal; }
}

.ref-group { border:1px solid #e8dfeb; border-radius:.6rem; padding:.55rem; margin-block:.45rem; }
.ref-form-block textarea { min-height:4rem; margin-bottom:.55rem; }
.formeno-cookie-banner { position:fixed; z-index:220; inset:auto max(1rem,env(safe-area-inset-right)) 1rem 1rem; margin:auto; max-width:790px; padding:.6rem 2.4rem .6rem .8rem; background:#faf6fd; color:#281c30; border:1px solid #c9b4d2; border-radius:.65rem; box-shadow:0 4px 18px #24132e24; font-size:.82rem; }
.formeno-cookie-banner p { margin:0 0 .35rem; }
.formeno-cookie-controls { display:flex; flex-wrap:wrap; gap:.3rem; }
.formeno-cookie-controls .btn { padding:.22rem .48rem; min-height:34px; font-size:.76rem; white-space:normal; }
.formeno-cookie-close { position:absolute; inset-inline-end:.4rem; top:.4rem; min-height:32px; min-width:32px; padding:.1rem; }
.formeno-cookie-dialog { width:min(calc(100% - 1.5rem),430px); margin:auto; border:1px solid #d5c4df; border-radius:.8rem; padding:1rem; color:#302439; }
.formeno-cookie-dialog::backdrop { background:#21122d70; }
.formeno-cookie-dialog h3 { margin:.6rem 0 .25rem; }
.formeno-cookie-dialog label { display:flex; gap:.4rem; margin:.3rem 0; }
.formeno-cookie-dialog .btn { margin:.25rem; }
/* Share the existing fixed action stack without reserving a bottom bar. */
.floats.ref-floats {
  --ref-action-size: 50px;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom), var(--ref-cookie-clearance, 0px));
  gap: 10px;
  pointer-events: none;
}
.ref-floats :is(.ref-float, .wa-btn, .back-top.show) { pointer-events: auto; }
.ref-floats .wa-btn, .ref-dock { width: var(--ref-action-size); height: var(--ref-action-size); }
.ref-floats .wa-btn svg { width: 26px; height: 26px; }
.ref-float { position: relative; }
.ref-float[hidden] { display: none; }
.ref-dock { position: relative; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: white; background: #75488a; box-shadow: 0 6px 18px #53326343; cursor: pointer; }
.ref-dock:hover { background: #653b79; }
.ref-dock:focus-visible { outline: 2px solid #57306c; outline-offset: 4px; }
.ref-dock-count { position: absolute; top: -3px; right: -3px; display: grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 3px; box-sizing: border-box; border: 1px solid #75488a; border-radius: 12px; background: #fff; color: #502b63; font: 700 .73rem/1 system-ui, sans-serif; }
.ref-float-tip, .ref-notice { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); border: 1px solid #e9e2ee; background: #fff; color: #302439; border-radius: .65rem; box-shadow: 0 3px 16px #2b163326; }
.ref-float-tip { visibility: hidden; pointer-events: none; white-space: nowrap; padding: .42rem .65rem; font-size: .82rem; }
.ref-dock:focus-visible + .ref-float-tip { visibility: visible; }
@media (hover: hover) { .ref-dock:hover + .ref-float-tip { visibility: visible; } }
.ref-float:has(.ref-notice:not([hidden])) .ref-float-tip { visibility: hidden; }
.ref-notice { padding: .58rem .7rem; width: min(215px, calc(100vw - 92px)); font-size: .83rem; }
.ref-notice strong, .ref-notice small { display: block; }
.ref-notice .ref-remove { padding: .2rem 0 0; }
.ref-form-summary { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
body:has(.ref-dialog[open], .formeno-cookie-dialog[open], .lightbox.open, .inquiry-modal.is-open) .ref-floats { visibility: hidden; }
@media (max-width: 700px) {
  .floats.ref-floats {
    --ref-action-size: 44px;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom), var(--ref-cookie-clearance, 0px));
    gap: 8px;
  }
  .ref-floats .wa-btn svg { width: 24px; height: 24px; }
  .floats.ref-floats .back-top { width: 44px; height: 44px; }
  /* Keep the catalog and inquiry controls clear of the physical right rail in both text directions. */
  :is(.catalog-product-grid, .machine-product-grid, .gallery-grid):has(> .ref-style-card),
  :is(.gel-collection-grid, .kit-components-grid):has(.ref-style-toggle),
  body:has(.ref-floats) #wholesale-inquiry .form-card {
    margin-right: max(42px, calc(env(safe-area-inset-right) + 30px));
  }
}
