/**
 * OPM Core — base layer. Minimal, scoped reset + shared primitives.
 * Everything is scoped under .opm so the theme never leaks into the host site.
 */

.opm {
  font-family: var(--opm-font-sans);
  font-size: var(--opm-fs-xs);
  color: var(--opm-color-ink);
  line-height: 1.4;
  box-sizing: border-box;
}
.opm *,
.opm *::before,
.opm *::after { box-sizing: border-box; }

.opm img { max-width: 100%; height: auto; display: block; }

/* Buttons / links shared primitives */
.opm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--opm-space-2);
  font: inherit;
  font-weight: var(--opm-fw-medium);
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: var(--opm-space-3) var(--opm-space-4);
  background: transparent;
  color: var(--opm-color-ink);
  border: 1px solid var(--opm-color-ink);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--opm-duration) var(--opm-ease),
              color var(--opm-duration) var(--opm-ease);
}
.opm-btn:hover { background: var(--opm-color-ink); color: var(--opm-color-bg); }

.opm-btn--accent { border-color: var(--opm-color-accent); }
.opm-btn--accent:hover { background: var(--opm-color-accent); border-color: var(--opm-color-accent); color: var(--opm-color-on-accent); }

/* Status dot + label (shared across views) */
.opm-status { display: inline-flex; align-items: center; gap: var(--opm-space-2); }
.opm-status__dot {
  width: var(--opm-status-dot);
  height: var(--opm-status-dot);
  flex: 0 0 auto;
  background: var(--opm-status-color, var(--opm-color-ink-muted));
}
.opm-status__label { font-size: var(--opm-fs-xs); text-transform: uppercase; white-space: nowrap; }
.opm-status[data-opm-status="available"]  { --opm-status-color: var(--opm-status-available); }
.opm-status[data-opm-status="reserved"]   { --opm-status-color: var(--opm-status-reserved); }
.opm-status[data-opm-status="contracted"] { --opm-status-color: var(--opm-status-contracted); }
.opm-status[data-opm-status="sold"]       { --opm-status-color: var(--opm-status-sold); }

/* Price (shared) */
.opm-price { font-weight: var(--opm-fw-bold); font-size: var(--opm-fs-sm); text-transform: uppercase; white-space: nowrap; }
.opm-price__old { display: block; font-weight: var(--opm-fw-regular); text-decoration: line-through; }

/* Promo label badge (shared) */
.opm-promo-label {
  display: inline-block;
  font-size: var(--opm-fs-2xs);
  text-transform: uppercase;
  letter-spacing: .02em;
  background: var(--opm-color-bg-muted);
  color: var(--opm-color-ink-muted);
  padding: 2px var(--opm-space-2);
}

/* Feature legend (shared: table + grid) */
.opm-legend {
  display: flex; flex-wrap: wrap;
  gap: var(--opm-space-2) var(--opm-space-5);
  margin-bottom: var(--opm-space-6);
}
.opm-legend__item { display: inline-flex; align-items: center; gap: var(--opm-space-2); }
.opm-legend__icon {
  width: var(--opm-legend-chip); height: var(--opm-legend-chip);
  flex: 0 0 auto; padding: 4px; object-fit: contain;
}
.opm-legend__label { font-size: var(--opm-fs-xs); font-weight: var(--opm-fw-medium); }

/* Per-unit feature icons (shared) */
.opm-feat { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--opm-space-1) var(--opm-space-2); }
.opm-feat__item { display: inline-flex; align-items: center; gap: var(--opm-space-1); }
.opm-feat__icon { width: var(--opm-feat-square); height: var(--opm-feat-square); flex: 0 0 auto; padding: 2px; object-fit: contain; }
.opm-feat__val { font-size: var(--opm-fs-xs); white-space: nowrap; }
.opm-feat__val sup { font-size: .65em; }

.opm-feat__item[data-opm-tooltip] {
  position: relative;
  cursor: help;
  outline: none;
  box-shadow: none;
}
.opm-feat__item[data-opm-tooltip]:focus,
.opm-feat__item[data-opm-tooltip]:focus-visible,
.opm-feat__item[data-opm-tooltip]:active {
  outline: none;
  box-shadow: none;
}
.opm-feat__item[data-opm-tooltip]::before,
.opm-feat__item[data-opm-tooltip]::after {
  text-transform: none;
  font-size: 10px;
  line-height: 1.15;
  user-select: none;
  pointer-events: none;
  position: absolute;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -0.5em);
  transition: opacity 220ms ease-out, visibility 220ms ease-out, transform 220ms ease-out;
}
.opm-feat__item[data-opm-tooltip]::before {
  content: "";
  bottom: 100%;
  border: 5px solid transparent;
  border-bottom-width: 0;
  border-top-color: #333;
  z-index: 100021;
}
.opm-feat__item[data-opm-tooltip]::after {
  content: attr(data-opm-tooltip);
  bottom: calc(100% + 5px);
  width: max-content;
  min-width: 120px;
  max-width: 260px;
  padding: 1ch 1.5ch;
  border-radius: 0.3ch;
  box-shadow: 0 1em 2em -0.5em rgba(0, 0, 0, 0.35);
  background: #333;
  color: #fff;
  font-family: Helvetica, Arial, sans-serif;
  text-align: center;
  white-space: normal;
  text-overflow: ellipsis;
  z-index: 100020;
}
.opm-feat__item[data-opm-tooltip]:hover::before,
.opm-feat__item[data-opm-tooltip]:hover::after,
.opm-feat__item[data-opm-tooltip]:focus::before,
.opm-feat__item[data-opm-tooltip]:focus::after,
.opm-feat__item[data-opm-tooltip]:focus-visible::before,
.opm-feat__item[data-opm-tooltip]:focus-visible::after {
  opacity: 0.95;
  visibility: visible;
  transform: translate(-50%, 0);
}
.opm-feat__item[data-opm-tooltip=""]::before,
.opm-feat__item[data-opm-tooltip=""]::after {
  display: none !important;
}
.opm-feat__item:first-child[data-opm-tooltip]::before,
.opm-feat__item:first-child[data-opm-tooltip]::after {
  left: 0;
  transform: translate(0, -0.5em);
}
.opm-feat__item:first-child[data-opm-tooltip]:hover::before,
.opm-feat__item:first-child[data-opm-tooltip]:hover::after,
.opm-feat__item:first-child[data-opm-tooltip]:focus::before,
.opm-feat__item:first-child[data-opm-tooltip]:focus::after,
.opm-feat__item:first-child[data-opm-tooltip]:focus-visible::before,
.opm-feat__item:first-child[data-opm-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}
.opm-feat__item:last-child[data-opm-tooltip]::before,
.opm-feat__item:last-child[data-opm-tooltip]::after {
  left: auto;
  right: 0;
  transform: translate(0, -0.5em);
}
.opm-feat__item:last-child[data-opm-tooltip]:hover::before,
.opm-feat__item:last-child[data-opm-tooltip]:hover::after,
.opm-feat__item:last-child[data-opm-tooltip]:focus::before,
.opm-feat__item:last-child[data-opm-tooltip]:focus::after,
.opm-feat__item:last-child[data-opm-tooltip]:focus-visible::before,
.opm-feat__item:last-child[data-opm-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}
.opm-feat__item:first-child[data-opm-tooltip]::before {
  left: 12px;
  right: auto;
}
.opm-feat__item:last-child[data-opm-tooltip]::before {
  left: auto;
  right: 12px;
}

@media (max-width: 767px) {
  .opm-feat__item[data-opm-tooltip]::after {
    max-width: min(260px, calc(100vw - 56px));
    min-width: 120px;
    font-size: 10px;
  }
}

/* Wishlist + compare buttons (shared) */
.opm-iconbtn { background: none; border: 0; padding: var(--opm-space-1); cursor: pointer; color: var(--opm-color-ink); vertical-align: middle; }
.opm-heart { display: block; width: 20px; height: 20px; opacity: .85; transition: opacity var(--opm-duration) var(--opm-ease), transform var(--opm-duration) var(--opm-ease); }
.opm-iconbtn:hover .opm-heart { opacity: 1; transform: scale(1.08); }
.opm-iconbtn[data-opm-wishlist="true"] .opm-heart { opacity: 1; }

/* In wishlist → solid red heart (mask the filled silhouette so we can colour it). */
[data-opm-action="wishlist-toggle"] { position: relative; }
[data-opm-action="wishlist-toggle"][data-opm-wishlist="true"] .opm-heart { opacity: 0; }
[data-opm-action="wishlist-toggle"][data-opm-wishlist="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  /* Heart fill is solid black (no accent — only the CTA button uses the
     category accent, on :hover). */
  background-color: #000;
  -webkit-mask: url(../svg/heart-fill.svg) center / contain no-repeat;
  mask: url(../svg/heart-fill.svg) center / contain no-repeat;
  pointer-events: none;
}
.opm-compare {
  background: none; border: 0; padding: var(--opm-space-1) var(--opm-space-2);
  cursor: pointer; font: inherit; font-size: var(--opm-fs-xs); text-transform: uppercase;
  color: var(--opm-color-ink);
}
/* Selected state: bold + black (heart/compare carry no accent — only the CTA
   button uses the category accent, on :hover). */
.opm-compare[data-opm-compare="true"] { font-weight: var(--opm-fw-bold); color: #000; }

/* Visually-hidden (a11y) */
.opm-vh {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* [opm-map] wrapper — constrains the engine viewer to the content width and
   sits as a header above the table/grid. */
.opm-map-wrap {
  /* The map is always full-width; the page-builder container that hosts the
     shortcode controls the actual width. No own max-width / auto-centering. */
  width: 100%;
  margin: 0 0 var(--opm-space-5, 32px);
  border-radius: var(--opm-radius-lg, 16px);
  overflow: hidden;
}

/* ---- Floating launcher / responsive quick dock ----
   Desktop: right edge tab with hover panel. Mobile <= 767px: bottom dock. */
.opm-launcher {
  --opm-launcher-panel-width: 250px;
  --opm-launcher-tab-width: 56px;
  position: fixed;
  right: 0;
  top: 50%;
  bottom: auto;
  width: var(--opm-launcher-tab-width);
  transform: translateY(-50%);
  z-index: 9000;
  display: block;
  color: var(--opm-color-ink);
  filter: drop-shadow(var(--opm-shadow-lg));
  overflow: visible;
}

.opm-launcher__panel {
  position: absolute;
  top: 0;
  right: calc(var(--opm-launcher-tab-width) - 1px);
  width: var(--opm-launcher-panel-width);
  background: var(--opm-color-bg);
  border: 1px solid var(--opm-color-ink);
  border-right: 0;
  transform: translateX(calc(var(--opm-launcher-panel-width) + 1px));
  opacity: 0;
  pointer-events: none;
  transition: transform var(--opm-duration) var(--opm-ease), opacity var(--opm-duration) var(--opm-ease);
}

.opm-launcher:hover .opm-launcher__panel,
.opm-launcher:focus-within .opm-launcher__panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.opm-launcher__handle {
  width: var(--opm-launcher-tab-width);
  min-height: 216px;
  border: 1px solid var(--opm-color-ink);
  background: var(--opm-color-ink);
  color: var(--opm-color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--opm-space-3);
  position: relative;
  z-index: 2;
}

.opm-launcher__handle-icon,
.opm-launcher__handle-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.opm-launcher__handle-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--opm-fs-2xs);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: var(--opm-fw-bold);
}

.opm-launcher__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.opm-launcher__item {
  margin: 0;
  padding: 0;
  position: relative;
}

.opm-launcher__item + .opm-launcher__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--opm-color-border-soft);
  z-index: 2;
  pointer-events: none;
}

.opm-launcher__btn {
  width: 100%;
  min-height: 70px;
  padding: 14px var(--opm-space-5);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--opm-color-ink);
  cursor: pointer;
  font: inherit;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  box-shadow: none;
}

.opm-launcher__btn:hover,
.opm-launcher__btn:focus-visible {
  background: var(--opm-color-bg-muted);
  color: var(--opm-color-ink);
  outline: none;
}

.opm-launcher__ico {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.opm-launcher__ico img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.opm-launcher__label {
  display: block;
  font-size: var(--opm-fs-xs);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: var(--opm-fw-bold);
}

.opm-launcher__label-mobile {
  display: none;
}

.opm-launcher__sub {
  display: block;
  margin-top: var(--opm-space-1);
  font-size: 11px;
  line-height: 1.2;
  color: var(--opm-color-ink-muted);
  letter-spacing: 0;
  text-transform: none;
  font-weight: var(--opm-fw-regular);
}

.opm-launcher__count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--opm-color-ink);
  background: var(--opm-color-bg);
  color: var(--opm-color-ink);
  font-size: 11px;
  line-height: 1;
}

.opm-launcher__arrow {
  font-size: var(--opm-fs-sm);
  line-height: 1;
}

@media (max-width: 767px) {
  .opm-launcher {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    transform: none;
    display: block;
    filter: none;
    background: var(--opm-color-bg);
    border-top: 1px solid var(--opm-color-ink);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.10);
    padding: 0 max(10px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  }

  .opm-launcher__handle {
    display: none;
  }

  .opm-launcher__panel {
    position: static;
    width: 100%;
    border: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    background: var(--opm-color-bg);
  }

  .opm-launcher__list {
    grid-template-columns: repeat(3, 1fr);
  }

  .opm-launcher__item + .opm-launcher__item::before {
    left: 0;
    right: auto;
    top: 12px;
    bottom: 12px;
    width: 1px;
    height: auto;
  }

  .opm-launcher__btn {
    min-height: 72px;
    padding: 10px var(--opm-space-1) 9px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    align-content: center;
    gap: 6px;
    text-align: center;
  }

  .opm-launcher__btn:hover,
  .opm-launcher__btn:focus-visible,
  .opm-launcher__btn:active {
    background: var(--opm-color-bg-muted);
  }

  .opm-launcher__label-main,
  .opm-launcher__sub,
  .opm-launcher__arrow {
    display: none;
  }

  .opm-launcher__label-mobile {
    display: block;
  }

  .opm-launcher__label {
    font-size: var(--opm-fs-2xs);
    line-height: 1.05;
    white-space: nowrap;
  }

  .opm-launcher__count {
    position: absolute;
    top: 8px;
    right: calc(50% - 26px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: var(--opm-fs-2xs);
  }
}

/* Modal hero zoom icon: use the exact zoom.svg asset without a button background. */
.opm-modal .opm-mo .opm-mo__opis-photo .opm-single__zoom {
  width: 33px !important;
  height: 32px !important;
  min-width: 33px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: url(../svg/zoom.svg) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 33px 32px !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  box-shadow: none !important;
}

.opm-modal .opm-mo .opm-mo__opis-photo .opm-single__zoom:hover,
.opm-modal .opm-mo .opm-mo__opis-photo .opm-single__zoom:focus,
.opm-modal .opm-mo .opm-mo__opis-photo .opm-single__zoom:active {
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Lightbox close: plain white X, no circular button background. */
.opm-single__lightbox .opm-single__lightbox-close,
.opm-single__lightbox-close {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 32px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}

.opm-single__lightbox .opm-single__lightbox-close:hover,
.opm-single__lightbox .opm-single__lightbox-close:focus,
.opm-single__lightbox .opm-single__lightbox-close:active,
.opm-single__lightbox-close:hover,
.opm-single__lightbox-close:focus,
.opm-single__lightbox-close:active {
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}
