/**
 * Floor Plan Frontend Viewer — Terraep Premium Theme
 *
 * A polished, modern real-estate property explorer UI.
 * Built on the Terraep design system with CSS custom properties.
 *
 * @package terraep_theme
 */

/* ==========================================================================
   Design Tokens (CSS Custom Properties)
   ========================================================================== */

:root {
  /* Brand palette */
  --fp-primary: #002e5b;
  --fp-brand-bg: #123258;
  --fp-secondary: #197f47;
  --fp-accent: #86cd91;
  --fp-accent-hover: #6abb78;

  /* Ink */
  --fp-ink: #16325c;
  --fp-ink-weak: #33578f;
  --fp-ink-muted: #6b7f9e;

  /* Surfaces */
  --fp-surface: #ffffff;
  --fp-surface-weak: #f8fbff;
  --fp-surface-hover: #f0f5ff;
  --fp-surface-overlay: rgba(0, 46, 91, 0.55);

  /* Borders */
  --fp-border: #d6e0f0;
  --fp-border-weak: #e8eefc;
  --fp-divider-dark: rgba(255, 255, 255, 0.14);
  --fp-divider-light: #e8eefc;

  /* Functional */
  --fp-primary-weak: rgba(45, 92, 163, 0.35);
  --fp-success: #197f47;
  --fp-success-light: rgba(134, 205, 145, 0.18);
  --fp-sold: #8c9bae;
  --fp-sold-light: rgba(140, 155, 174, 0.12);
  --fp-danger: #d64545;

  /* Radii */
  --fp-radius-card: 18px;
  --fp-radius-md: 14px;
  --fp-radius-sm: 10px;
  --fp-radius-pill: 999px;

  /* Shadows */
  --fp-shadow-sm: 0 2px 8px rgba(0, 46, 91, 0.06);
  --fp-shadow-md: 0 8px 24px rgba(0, 46, 91, 0.09);
  --fp-shadow-lg: 0 16px 48px rgba(0, 46, 91, 0.13);
  --fp-shadow-glow: 0 0 0 4px rgba(134, 205, 145, 0.25);

  /* Transitions */
  --fp-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fp-duration: 0.25s;
  --fp-duration-slow: 0.4s;

  /* Spacing */
  --fp-gap: 1.5rem;
  --fp-gap-sm: 0.75rem;
}

/* ==========================================================================
   Container & Grid Layout
   ========================================================================== */

.fp-container {
  position: relative;
  margin-bottom: 3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--fp-ink);
  line-height: 1.5;
}

.fp-content-row {
  position: relative;
}

.fp-main {
  position: relative;
}

.fp-sidebar {
  position: relative;
}

/* ==========================================================================
   Header & View Switcher (Pill Tabs)
   ========================================================================== */

.fp-header {
  display: none;
}

.fp-view-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.fp-view-controls {
  display: none;
}

.fp-view-switcher {
  border-bottom: none;
  gap: 0.25rem;
  padding: 3px;
  background: var(--fp-surface-weak);
  border-radius: var(--fp-radius-pill);
  border: 1px solid var(--fp-border-weak);
  display: inline-flex;
}

.fp-view-switcher .nav-item {
  margin: 0;
}

.fp-view-switcher .nav-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fp-ink-weak);
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: var(--fp-radius-pill);
  background: transparent;
  transition: all var(--fp-duration) var(--fp-ease);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.fp-view-switcher .nav-link:hover {
  color: var(--fp-ink);
  background: rgba(45, 92, 163, 0.06);
}

.fp-view-switcher .nav-link.active {
  color: var(--fp-surface);
  background: var(--fp-primary);
  box-shadow: 0 2px 8px rgba(0, 46, 91, 0.2);
}

/* View/List Toggle Button */
.fp-view-toggle {
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: var(--fp-radius-pill);
  border: 1px solid var(--fp-border);
  color: var(--fp-ink-weak);
  background: var(--fp-surface);
  transition: all var(--fp-duration) var(--fp-ease);
}

.fp-view-toggle:hover {
  color: var(--fp-primary);
  border-color: var(--fp-primary);
  background: var(--fp-surface-weak);
  box-shadow: var(--fp-shadow-sm);
}

.fp-view-toggle:focus-visible {
  outline: 2px solid var(--fp-accent);
  outline-offset: 2px;
}

.fp-toggle-icon-list {
  margin-right: 0.35rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Filter Bar — Sleek, Minimal, Pill-shaped
   ========================================================================== */

.fp-filter-bar {
  padding: 1rem 1.25rem;
  margin-bottom: var(--fp-gap);
  background: var(--fp-surface-weak);
  border: 1px solid var(--fp-border-weak);
  border-radius: var(--fp-radius-md);
}

.fp-filter-bar .form-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--fp-ink-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fp-filter-bar .form-select,
.fp-filter-bar .form-control {
  min-width: 90px;
  font-size: 0.8125rem;
  border-radius: var(--fp-radius-pill);
  border: 1px solid var(--fp-border);
  background-color: var(--fp-surface);
  color: var(--fp-ink);
  padding: 0.45rem 1rem;
  transition: border-color var(--fp-duration) var(--fp-ease), box-shadow var(--fp-duration) var(--fp-ease);
}

.fp-filter-bar .form-select:focus,
.fp-filter-bar .form-control:focus {
  border-color: var(--fp-accent);
  box-shadow: var(--fp-shadow-glow);
  outline: none;
}

.fp-filter-bar .input-group {
  min-width: 200px;
}

.fp-filter-bar .input-group .form-control {
  border-radius: var(--fp-radius-pill) 0 0 var(--fp-radius-pill);
}

.fp-filter-bar .input-group .form-control:last-child,
.fp-filter-bar .input-group .form-control + .form-control {
  border-radius: 0 var(--fp-radius-pill) var(--fp-radius-pill) 0;
}

.fp-filter-bar .input-group-text {
  font-size: 0.75rem;
  background: var(--fp-surface-weak);
  border-color: var(--fp-border);
  color: var(--fp-ink-muted);
  padding: 0.45rem 0.5rem;
}

.fp-filter-clear {
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--fp-radius-pill);
  padding: 0.45rem 1rem;
  border: 1px solid var(--fp-border);
  color: var(--fp-ink-muted);
  background: var(--fp-surface);
  transition: all var(--fp-duration) var(--fp-ease);
}

.fp-filter-clear:hover {
  color: var(--fp-danger);
  border-color: var(--fp-danger);
  background: rgba(214, 69, 69, 0.04);
}


/* ==========================================================================
   Image Wrapper & SVG Overlay
   ========================================================================== */

.fp-image-view {
  position: relative;
}

.fp-view-panel {
  display: none;
}

.fp-view-panel.active {
  display: block;
  animation: fp-view-enter 0.35s var(--fp-ease) forwards;
}

@keyframes fp-view-enter {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fp-image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--fp-surface-weak);
  border-radius: var(--fp-radius-card);
  border: 1px solid var(--fp-border-weak);
  box-shadow: var(--fp-shadow-md);
  transition: box-shadow var(--fp-duration-slow) var(--fp-ease);
}

.fp-image-wrapper:hover {
  box-shadow: var(--fp-shadow-lg);
}

.fp-view-image {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.fp-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
}

/* ==========================================================================
   Polygon Styles — Green Accent System
   ========================================================================== */

.fp-polygon {
  fill: rgba(134, 205, 145, 0.22);
  stroke: var(--fp-accent);
  stroke-width: 0.5;
  cursor: pointer;
  transition: fill var(--fp-duration) var(--fp-ease),
              stroke var(--fp-duration) var(--fp-ease),
              stroke-width var(--fp-duration) var(--fp-ease),
              opacity var(--fp-duration) var(--fp-ease);
}

.fp-polygon:hover,
.fp-polygon--focused {
  fill: rgba(134, 205, 145, 0.42);
  stroke: var(--fp-secondary);
  stroke-width: 0.8;
  filter: drop-shadow(0 0 6px rgba(134, 205, 145, 0.4));
}

/* Custom-colored polygon hover: increase opacity */
.fp-polygon[data-custom-color]:hover,
.fp-polygon[data-custom-color].fp-polygon--focused {
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.25));
  stroke-width: 0.8;
}

.fp-polygon:focus {
  outline: none;
}

.fp-polygon:focus-visible {
  fill: rgba(134, 205, 145, 0.42);
  stroke: var(--fp-primary);
  stroke-width: 1;
  filter: drop-shadow(0 0 8px rgba(0, 46, 91, 0.3));
}

/* Sold state — grey, dimmed */
.fp-polygon--sold {
  fill: rgba(140, 155, 174, 0.15);
  stroke: var(--fp-sold);
  stroke-width: 0.3;
  cursor: default;
  opacity: 0.6;
}

.fp-polygon--sold:hover,
.fp-polygon--sold.fp-polygon--focused {
  fill: rgba(140, 155, 174, 0.22);
  stroke: var(--fp-sold);
  stroke-width: 0.5;
  filter: none;
  opacity: 0.7;
}

/* Sold label overlay — subtle pill badge */
.fp-sold-label {
  pointer-events: none;
  opacity: 0.85;
}

.fp-sold-label rect {
  fill: rgba(30, 40, 55, 0.75);
}

.fp-sold-label text {
  font-size: 1.8px;
  font-weight: 700;
  fill: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.3px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Hidden state — filtered out */
.fp-polygon--hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--fp-ease);
}

/* ==========================================================================
   Compass Indicator — Top-Right
   ========================================================================== */

.fp-compass-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  border: 1px solid var(--fp-border-weak);
  box-shadow: var(--fp-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform var(--fp-duration) var(--fp-ease);
}

.fp-compass-svg {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   Apartment List Table — Clean with Subtle Hover
   ========================================================================== */

.fp-apartment-list {
  margin-top: var(--fp-gap);
  border-radius: var(--fp-radius-card);
  overflow: hidden;
  border: 1px solid var(--fp-border-weak);
  background: var(--fp-surface);
  box-shadow: var(--fp-shadow-sm);
}

.fp-apartment-table {
  font-size: 0.8125rem;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.fp-apartment-table thead {
  background: var(--fp-surface-weak);
}

.fp-apartment-table thead th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fp-ink-muted);
  border-bottom: 1px solid var(--fp-border-weak);
  padding: 0.875rem 1rem;
  white-space: nowrap;
  vertical-align: middle;
}

/* Sortable headers */
.fp-sortable {
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  position: relative;
  padding-right: 1.5rem !important;
  transition: color var(--fp-duration) var(--fp-ease);
}

.fp-sortable:hover {
  color: var(--fp-primary);
}

.fp-sortable::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--fp-border);
  margin-top: -5px;
}

.fp-sortable::before {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-top-color: var(--fp-border);
  margin-top: 5px;
}

.fp-sort-asc::after {
  border-bottom-color: var(--fp-primary);
}

.fp-sort-desc::before {
  border-top-color: var(--fp-primary);
}

/* Table body rows */
.fp-apartment-table tbody tr {
  cursor: pointer;
  transition: background-color var(--fp-duration) var(--fp-ease),
              transform var(--fp-duration) var(--fp-ease);
}

.fp-apartment-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--fp-border-weak);
  vertical-align: middle;
  color: var(--fp-ink);
}

.fp-apartment-table tbody tr:last-child td {
  border-bottom: none;
}

.fp-apartment-table tbody tr:hover {
  background-color: var(--fp-success-light);
}

.fp-apartment-table tbody tr:active {
  background-color: rgba(134, 205, 145, 0.12);
}

/* Sold row dimming */
.fp-row--sold {
  opacity: 0.5;
}

.fp-row--sold td {
  color: var(--fp-ink-muted);
}

.fp-apartment-table tbody tr.fp-row--sold:hover {
  background-color: var(--fp-sold-light);
}

/* Hidden row */
.fp-row--hidden {
  display: none;
}


/* ==========================================================================
   Detail Panel — Beautiful Card with Clear Hierarchy
   ========================================================================== */

.fp-detail-panel {
  position: relative;
}

.fp-detail-panel-inner {
  position: relative;
  padding: 1.75rem;
  background: var(--fp-surface);
  border: 1px solid var(--fp-border-weak);
  border-radius: var(--fp-radius-card);
  box-shadow: var(--fp-shadow-md);
  transition: box-shadow var(--fp-duration-slow) var(--fp-ease);
}

.fp-detail-panel-inner:hover {
  box-shadow: var(--fp-shadow-lg);
}

.fp-detail-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 5;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--fp-surface-weak);
  border: 1px solid var(--fp-border-weak);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fp-duration) var(--fp-ease);
  opacity: 0.7;
}

.fp-detail-close:hover {
  opacity: 1;
  background: var(--fp-surface);
  border-color: var(--fp-border);
  box-shadow: var(--fp-shadow-sm);
  transform: scale(1.1);
}

.fp-detail-title {
  font-size: 1.375rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  padding-right: 2.5rem;
  color: var(--fp-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Definition list fields */
.fp-detail-list {
  margin: 0 0 1.25rem;
}

.fp-detail-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--fp-border-weak);
  transition: background-color var(--fp-duration) var(--fp-ease);
}

.fp-detail-field:last-child {
  border-bottom: none;
}

.fp-detail-field:hover {
  background-color: var(--fp-surface-weak);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--fp-radius-sm);
}

.fp-detail-field dt {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fp-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.fp-detail-field dd {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fp-ink);
  margin: 0;
  text-align: right;
}

/* Price field emphasis */
.fp-detail-price dd {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--fp-primary);
}

/* Sold indicator badge */
.fp-detail-sold-indicator {
  margin-bottom: 1rem;
}

.fp-detail-sold-indicator .badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 1rem;
  border-radius: var(--fp-radius-pill);
  letter-spacing: 0.03em;
}

/* Gallery */
.fp-detail-gallery,
.fp-detail-floorplan-gallery {
  margin-bottom: 1.25rem;
}

.fp-detail-gallery-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fp-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.fp-detail-gallery-container,
.fp-detail-floorplan-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.fp-gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  -o-object-fit: cover;
  object-fit: cover;
  border-radius: var(--fp-radius-sm);
  border: 1px solid var(--fp-border-weak);
  cursor: pointer;
  transition: all var(--fp-duration) var(--fp-ease);
}

.fp-gallery-thumb:hover {
  transform: scale(1.04);
  box-shadow: var(--fp-shadow-md);
  border-color: var(--fp-accent);
}

.fp-gallery-thumb:focus-visible {
  outline: 2px solid var(--fp-accent);
  outline-offset: 2px;
}

/* Permalink CTA */
.fp-detail-permalink {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--fp-border-weak);
}

.fp-detail-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: var(--fp-radius-pill);
  background: var(--fp-primary);
  color: var(--fp-surface);
  border: none;
  text-decoration: none;
  transition: all var(--fp-duration) var(--fp-ease);
  box-shadow: 0 4px 12px rgba(0, 46, 91, 0.2);
}

.fp-detail-link:hover {
  background: var(--fp-brand-bg);
  color: var(--fp-surface);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 46, 91, 0.25);
}

.fp-detail-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 46, 91, 0.2);
}

/* ==========================================================================
   Map Section — Rounded Corners & Subtle Shadow
   ========================================================================== */

.fp-map-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--fp-divider-light);
}

.fp-map-container {
  width: 100%;
  height: 380px;
  border-radius: var(--fp-radius-card);
  border: 1px solid var(--fp-border-weak);
  overflow: hidden;
  background: var(--fp-surface-weak);
  box-shadow: var(--fp-shadow-md);
  transition: box-shadow var(--fp-duration-slow) var(--fp-ease);
}

.fp-map-container:hover {
  box-shadow: var(--fp-shadow-lg);
}

.fp-map-fallback {
  padding: 2rem;
  text-align: center;
  color: var(--fp-ink-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   Desktop Layout (>=992px) — Sticky Detail Panel with Slide-in
   ========================================================================== */

@media (min-width: 992px) {
  .fp-sidebar {
    position: relative;
  }

  .fp-detail-panel {
    position: sticky;
    top: 1.5rem;
  }

  .fp-detail-panel[hidden] {
    display: none;
  }

  .fp-detail-panel:not([hidden]) {
    display: block;
    animation: fp-slide-in-right 0.4s var(--fp-ease) forwards;
  }

  @keyframes fp-slide-in-right {
    from {
      opacity: 0;
      transform: translateX(24px) scale(0.97);
    }
    to {
      opacity: 1;
      transform: translateX(0) scale(1);
    }
  }
}

/* ==========================================================================
   Tablet Layout (768px–991px) — Bottom Sheet Detail Panel
   ========================================================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
  .fp-main {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .fp-sidebar {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 0;
    pointer-events: none;
  }

  .fp-detail-panel[hidden] {
    display: none;
  }

  .fp-detail-panel:not([hidden]) {
    display: block;
    pointer-events: all;
    max-height: 65vh;
    overflow-y: auto;
    animation: fp-slide-up 0.4s var(--fp-ease) forwards;
  }

  .fp-detail-panel-inner {
    border-radius: var(--fp-radius-card) var(--fp-radius-card) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 46, 91, 0.15);
    padding: 1.75rem 1.75rem 2.5rem;
  }

  @keyframes fp-slide-up {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .fp-detail-gallery-container,
  .fp-detail-floorplan-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   Mobile Layout (<768px) — Full-Screen Overlay with Smooth Animation
   ========================================================================== */

@media (max-width: 767.98px) {
  .fp-container {
    margin-bottom: 2rem;
  }

  .fp-main {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .fp-sidebar {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    padding: 0;
    pointer-events: none;
    background: transparent;
    transition: background var(--fp-duration-slow) var(--fp-ease);
  }

  .fp-sidebar:has(.fp-detail-panel:not([hidden])) {
    background: var(--fp-surface-overlay);
    pointer-events: all;
  }

  .fp-detail-panel[hidden] {
    display: none;
  }

  .fp-detail-panel:not([hidden]) {
    display: block;
    pointer-events: all;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: fp-mobile-slide-up 0.4s var(--fp-ease) forwards;
  }

  .fp-detail-panel-inner {
    border-radius: 0;
    box-shadow: none;
    min-height: 100%;
    padding: 1.5rem;
    padding-top: 3.5rem;
    background: var(--fp-surface);
  }

  .fp-detail-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1070;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--fp-surface);
    border: 1px solid var(--fp-border-weak);
    border-radius: 50%;
    box-shadow: var(--fp-shadow-md);
    opacity: 1;
  }

  @keyframes fp-mobile-slide-up {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* View bar mobile */
  .fp-view-bar {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* View switcher scrollable on mobile */
  .fp-view-switcher {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }

  .fp-view-switcher::-webkit-scrollbar {
    display: none;
  }

  .fp-view-switcher .nav-link {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  /* Filter bar stacks on mobile */
  .fp-filter-bar {
    padding: 0.875rem 1rem;
    border-radius: var(--fp-radius-sm);
  }

  .fp-filter-bar .row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .fp-filter-bar .col-auto {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .fp-filter-bar .input-group {
    min-width: 100%;
  }

  /* Image wrapper */
  .fp-image-wrapper {
    border-radius: var(--fp-radius-md);
  }

  /* Compass smaller on mobile */
  .fp-compass-indicator {
    width: 36px;
    height: 36px;
    top: 0.75rem;
    right: 0.75rem;
  }

  .fp-compass-svg {
    width: 22px;
    height: 22px;
  }

  /* Map height reduced on mobile */
  .fp-map-container {
    height: 260px;
    border-radius: var(--fp-radius-md);
  }

  /* Gallery 2 columns on mobile */
  .fp-detail-gallery-container,
  .fp-detail-floorplan-container {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Table adjustments */
  .fp-apartment-list {
    border-radius: var(--fp-radius-md);
  }

  .fp-apartment-table thead th,
  .fp-apartment-table tbody td {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Small Mobile (<480px)
   ========================================================================== */

@media (max-width: 479.98px) {
  .fp-view-switcher .nav-link {
    font-size: 0.6875rem;
    padding: 0.35rem 0.75rem;
  }

  .fp-view-toggle {
    font-size: 0.75rem;
    padding: 0.4rem 0.875rem;
  }

  .fp-detail-title {
    font-size: 1.125rem;
  }

  .fp-detail-field dt {
    font-size: 0.6875rem;
  }

  .fp-detail-field dd {
    font-size: 0.8125rem;
  }

  .fp-detail-link {
    font-size: 0.8125rem;
    padding: 0.625rem 1.25rem;
  }
}

/* ==========================================================================
   Utility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .fp-polygon,
  .fp-view-panel.active,
  .fp-detail-panel:not([hidden]),
  .fp-image-wrapper,
  .fp-gallery-thumb,
  .fp-compass-svg,
  .fp-detail-link,
  .fp-view-switcher .nav-link,
  .fp-view-toggle,
  .fp-detail-close {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .fp-filter-bar,
  .fp-view-toggle,
  .fp-map-section,
  .fp-detail-close,
  .fp-detail-permalink {
    display: none !important;
  }

  .fp-container {
    margin-bottom: 0;
  }

  .fp-image-wrapper {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
  }

  .fp-polygon {
    fill: rgba(0, 0, 0, 0.08) !important;
    stroke: #333 !important;
    stroke-width: 0.5 !important;
  }

  .fp-polygon--sold {
    fill: rgba(0, 0, 0, 0.03) !important;
    stroke: #999 !important;
  }

  .fp-detail-panel-inner {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
    page-break-inside: avoid;
  }

  .fp-apartment-table {
    font-size: 0.75rem;
  }

  .fp-apartment-list {
    box-shadow: none;
    border-radius: 0;
  }
}

/* ==========================================================================
   Focus Visible — Accessibility
   ========================================================================== */

.fp-view-switcher .nav-link:focus-visible,
.fp-filter-bar .form-select:focus-visible,
.fp-filter-bar .form-control:focus-visible,
.fp-apartment-table tbody tr:focus-visible,
.fp-detail-close:focus-visible {
  outline: 2px solid var(--fp-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Status Badge Styles (used in table and detail panel)
   ========================================================================== */

.fp-status-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--fp-radius-pill);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fp-status-badge--available {
  background: var(--fp-success-light);
  color: var(--fp-secondary);
}

.fp-status-badge--sold {
  background: var(--fp-sold-light);
  color: var(--fp-sold);
}

.fp-status-badge--reserved {
  background: rgba(255, 193, 7, 0.12);
  color: #b8860b;
}


/* ==========================================================================
   Property List Sidebar — Always Visible Accordion
   ========================================================================== */

.fp-property-list {
  background: var(--fp-surface);
  border: 1px solid var(--fp-border-weak);
  border-radius: var(--fp-radius-card);
  box-shadow: var(--fp-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.fp-property-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--fp-border-weak);
  background: var(--fp-surface-weak);
  flex-shrink: 0;
}

.fp-property-list-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--fp-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.fp-property-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--fp-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--fp-surface);
  padding: 0.25rem 0.625rem;
  border-radius: var(--fp-radius-pill);
  border: 1px solid var(--fp-border-weak);
}

.fp-property-list-items {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--fp-border) transparent;
}

.fp-property-list-items::-webkit-scrollbar {
  width: 5px;
}

.fp-property-list-items::-webkit-scrollbar-track {
  background: transparent;
}

.fp-property-list-items::-webkit-scrollbar-thumb {
  background: var(--fp-border);
  border-radius: 10px;
}

/* Property Card */
.fp-prop-card {
  border-bottom: 1px solid var(--fp-border-weak);
  transition: background-color var(--fp-duration) var(--fp-ease);
}

.fp-prop-card:last-child {
  border-bottom: none;
}

.fp-prop-card-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background-color var(--fp-duration) var(--fp-ease);
}

.fp-prop-card-header:hover {
  background: var(--fp-surface-hover);
}

.fp-prop-card--active .fp-prop-card-header {
  background: var(--fp-success-light);
  border-left: 3px solid var(--fp-secondary);
  padding-left: calc(1.25rem - 3px);
}

.fp-prop-card--sold .fp-prop-card-header {
  opacity: 0.55;
}

/* Left section: status + floor + title */
.fp-prop-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.fp-prop-status-line {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.fp-prop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fp-prop-dot--available {
  background: var(--fp-secondary);
  box-shadow: 0 0 6px rgba(25, 127, 71, 0.4);
}

.fp-prop-dot--sold {
  background: var(--fp-sold);
}

.fp-prop-status-text {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fp-ink-muted);
}

.fp-prop-floor {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--fp-ink-muted);
}

.fp-prop-card-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--fp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.fp-prop-card--active .fp-prop-card-title {
  color: var(--fp-primary);
}

/* Right section: stats (infographic) */
.fp-prop-card-stats {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.fp-prop-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 40px;
}

.fp-prop-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--fp-ink);
  line-height: 1.1;
}

.fp-prop-stat--price .fp-prop-stat-value {
  color: var(--fp-primary);
}

.fp-prop-stat-unit {
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--fp-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fp-prop-card-chevron {
  font-size: 0.75rem;
  color: var(--fp-ink-muted);
  transition: transform var(--fp-duration) var(--fp-ease);
  flex-shrink: 0;
  justify-self: end;
}

.fp-prop-card--active .fp-prop-card-chevron {
  transform: rotate(180deg);
  color: var(--fp-secondary);
}

/* Expanded Body */
.fp-prop-card-body {
  padding: 0 1.25rem 1.25rem;
  animation: fp-expand-in 0.25s var(--fp-ease) forwards;
}

@keyframes fp-expand-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Thumbnail image */
.fp-prop-thumb-wrap {
  margin-bottom: 0.875rem;
  border-radius: var(--fp-radius-sm);
  overflow: hidden;
  border: 1px solid var(--fp-border-weak);
  box-shadow: var(--fp-shadow-sm);
}

.fp-prop-thumb {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  -o-object-fit: cover;
  object-fit: cover;
}

.fp-prop-details {
  margin-bottom: 0.875rem;
}

.fp-prop-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--fp-border-weak);
  font-size: 0.75rem;
}

.fp-prop-detail-row:last-child {
  border-bottom: none;
}

.fp-prop-detail-row span {
  color: var(--fp-ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.625rem;
}

.fp-prop-detail-row strong {
  color: var(--fp-ink);
  font-weight: 700;
  font-size: 0.8125rem;
}

/* Action buttons */
.fp-prop-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.fp-prop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--fp-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--fp-duration) var(--fp-ease);
  cursor: pointer;
  border: none;
}

.fp-prop-btn--primary {
  background: var(--fp-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 46, 91, 0.2);
}

.fp-prop-btn--primary:hover {
  background: var(--fp-brand-bg);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 46, 91, 0.25);
}

.fp-prop-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fp-primary);
  text-decoration: none;
  transition: color var(--fp-duration) var(--fp-ease);
}

.fp-prop-detail-link:hover {
  color: var(--fp-secondary);
}

/* Desktop: sticky sidebar */
@media (min-width: 992px) {
  .fp-property-list {
    position: sticky;
    top: 1.5rem;
  }
}

/* Mobile: property list below the image */
@media (max-width: 991.98px) {
  .fp-property-list {
    max-height: 400px;
    margin-top: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .fp-property-list {
    max-height: 350px;
    border-radius: var(--fp-radius-md);
  }

  .fp-prop-card-header {
    padding: 0.75rem 1rem;
  }

  .fp-prop-card-body {
    padding: 0 1rem 0.875rem;
  }
}
/*# sourceMappingURL=floor-plan-frontend.css.map */