/**
 * Mission Village Interactive Map (Phase 3)
 * Application Layout, Sidebar Accordion, and Header Banner
 * Scoped under .mv-app and template-specific body classes to prevent leaking into Avada.
 */

/* ==========================================================================
   Avada Theme Overrides (Scoped strictly to Mission Village Map template)
   ========================================================================== */

body:has(.mv-app) #main,
body.page-template-mission_village_map #main,
body.page-template-mission_village_map-php #main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  background: transparent !important;
  overflow: hidden;
}

body:has(.mv-app) #main > .fusion-row,
body.page-template-mission_village_map #main > .fusion-row,
body.page-template-mission_village_map-php #main > .fusion-row {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Viewport lock and outer page scroll suppression for both desktop and mobile app layout */
html:has(.mv-app),
body:has(.mv-app),
body.page-template-mission_village_map,
body.page-template-mission_village_map-php {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overscroll-behavior: none !important;
}

body:has(.mv-app) #boxed-wrapper,
body:has(.mv-app) #wrapper,
body.page-template-mission_village_map #boxed-wrapper,
body.page-template-mission_village_map #wrapper {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:has(.mv-app) #main,
body.page-template-mission_village_map #main {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body:has(.mv-app) #main > .fusion-row,
body.page-template-mission_village_map #main > .fusion-row {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* Prevent Avada footer and extra elements from creating scrollbars on this interactive map template */
body:has(.mv-app) .fusion-footer,
body:has(.mv-app) #footer,
body:has(.mv-app) .fusion-sliding-bar-wrapper,
body:has(.mv-app) .fusion-top-frame,
body:has(.mv-app) .fusion-bottom-frame,
body:has(.mv-app) .to-top-container,
body.page-template-mission_village_map .fusion-footer,
body.page-template-mission_village_map #footer,
body.page-template-mission_village_map .fusion-sliding-bar-wrapper,
body.page-template-mission_village_map .fusion-top-frame,
body.page-template-mission_village_map .fusion-bottom-frame,
body.page-template-mission_village_map .to-top-container {
  display: none !important;
}

/* ==========================================================================
   Root Application Container (.mv-app)
   ========================================================================== */

.mv-app {
  --mv-top-offset: 0px;
  --mv-font-family: inherit;
  --mv-color-bg-sidebar: #FAF8F5;
  --mv-color-border-subtle: rgba(60, 50, 40, 0.12);
  --mv-color-text-main: #201D1A;
  --mv-color-text-muted: #6B6258;
  --mv-color-text-subtle: #8A8177;
  --mv-select-color: #b8a89e;
  --mv-select-color-hover: rgba(184, 168, 158, 0.70);

  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  background-color: #F7F5F0;
  color: var(--mv-color-text-main);
  font-family: var(--mv-font-family);
  position: relative;
}

.mv-app *,
.mv-app *::before,
.mv-app *::after {
  box-sizing: inherit;
}

body.page-template-mission_village_map {
  overflow: hidden;
  overscroll-behavior: none;
}

.mv-app {
  height: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 1023px) {
  .mv-app {
    height: calc(100dvh - var(--mv-top-offset, 0px));
    max-height: calc(100dvh - var(--mv-top-offset, 0px));
    overflow: hidden;
  }
}

/* ==========================================================================
   Header Banner (.mv-header)
   ========================================================================== */

.mv-header {
  flex-shrink: 0;
  background: #FFFFFF;
  border-bottom: 1px solid var(--mv-color-border-subtle);
  padding: 10px 24px 12px 24px;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.mv-header__top {
  margin-bottom: 4px;
}

.mv-header__top:empty {
  display: none;
  margin: 0;
}

.mv-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--mv-color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mv-back-link:hover {
    color: #1a1816;
    text-decoration: underline;
    transform: translateX(-2px);
  }
}

.mv-back-link:focus-visible {
  color: #1a1816;
  text-decoration: underline;
}

.mv-header__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mv-header__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  line-height: 1.2;
  color: var(--mv-color-text-main);
}

.mv-header__subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--mv-color-text-muted);
  margin: 0;
  padding: 0;
}

@media (max-width: 1023px) {
  .mv-header {
    padding: 8px 16px 10px 16px;
  }
  .mv-header__title {
    font-size: 15px;
    letter-spacing: 0.05em;
  }
  .mv-header__subtitle {
    font-size: 11.5px;
    line-height: 1.35;
  }
}

@media (max-height: 750px) and (min-width: 1024px) {
  .mv-header {
    padding: 6px 24px 7px;
  }
  .mv-header__top {
    margin-bottom: 2px;
  }
  .mv-header__title {
    font-size: 17px;
    line-height: 1.15;
  }
  .mv-header__subtitle {
    font-size: 11.5px;
    margin-top: 2px;
  }
}

@media (max-width: 480px) {
  .mv-header {
    padding: 6px 12px;
  }
  .mv-back-link {
    font-size: 10.5px;
  }
  .mv-header__title {
    font-size: 13.5px;
  }
  .mv-header__subtitle {
    display: none; /* Hide subtitle on small phones to maximize map viewport */
  }
}

/* ==========================================================================
   Two-Column Desktop / Mobile App Layout (.mv-main)
   ========================================================================== */

.mv-main {
  display: flex;
  position: relative;
  width: 100%;
}

@media (min-width: 1024px) {
  .mv-main {
    flex: 1 1 0;
    min-height: 0;
    flex-direction: row;
    overflow: hidden;
  }
}

@media (max-width: 1023px) {
  .mv-main {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: block;
  }
}

/* ==========================================================================
   Left Panel Sidebar / Mobile Explore Bottom Sheet (.mv-sidebar)
   ========================================================================== */

.mv-sheet-handle-pill {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(60, 50, 40, 0.28);
  margin: 0 auto;
  flex-shrink: 0;
}

.mv-sidebar {
  background: var(--mv-color-bg-sidebar);
  border-right: 1px solid var(--mv-color-border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 40;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

@media (min-width: 1024px) {
  .mv-sidebar {
    width: 320px;
    min-width: 290px;
    max-width: 350px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .mv-sidebar__handle-btn {
    display: none !important;
  }

  .mv-sidebar__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid var(--mv-color-border-subtle);
    background: var(--mv-color-bg-sidebar);
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .mv-sidebar__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
  }
}

@media (max-width: 1023px) {
  .mv-sidebar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-right: none;
    border-top: 1px solid rgba(60, 50, 40, 0.15);
    border-radius: 16px 16px 0 0;
    background-color: #FAF8F5;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.10);
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    max-height: calc(58px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: height 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Tablet portrait centered max-width 600px */
  @media (min-width: 768px) and (max-width: 1023px) {
    .mv-sidebar {
      max-width: 600px;
      left: 50%;
      transform: translateX(-50%);
    }
    .mv-sidebar.is-suppressed {
      transform: translateX(-50%) translateY(100%) !important;
    }
  }

  .mv-sidebar.is-suppressed {
    transform: translateY(100%);
    pointer-events: none;
  }

  .mv-sidebar.is-expanded {
    height: 70dvh;
    max-height: 70dvh;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.16);
  }

  .mv-sidebar__header {
    display: none !important;
  }

  .mv-sidebar__handle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 58px;
    min-height: 58px;
    padding: 6px 16px 8px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mv-sidebar__bar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
  }

  .mv-sidebar__bar-title {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mv-color-text-main);
  }

  .mv-sidebar__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mv-color-text-subtle);
    transition: transform 0.25s ease;
  }

  .mv-sidebar.is-expanded .mv-sidebar__chevron {
    transform: rotate(180deg);
  }

  .mv-sidebar__scroll {
    display: none;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
  }

  .mv-sidebar.is-expanded .mv-sidebar__scroll {
    display: block;
  }
}

/* Custom scrollbar for sidebar */
.mv-sidebar::-webkit-scrollbar {
  width: 6px;
}
.mv-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.mv-sidebar::-webkit-scrollbar-thumb {
  background: rgba(60, 50, 40, 0.16);
  border-radius: 3px;
}
.mv-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(60, 50, 40, 0.28);
}

.mv-sidebar__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid var(--mv-color-border-subtle);
  background: var(--mv-color-bg-sidebar);
  position: sticky;
  top: 0;
  z-index: 10;
}

.mv-sidebar__title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mv-color-text-subtle);
  margin: 0;
  padding: 0;
}

.mv-sidebar__show-all {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #3b6088;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mv-sidebar__show-all:hover {
    color: #1a3a60;
  }
}

.mv-sidebar__show-all.is-hidden {
  display: none !important;
}

/* ==========================================================================
   Sidebar Accordion Component (.mv-accordion)
   ========================================================================== */

.mv-accordion {
  display: flex;
  flex-direction: column;
  padding-bottom: 48px;
}

.mv-accordion__item {
  border-bottom: 1px solid rgba(60, 50, 40, 0.08);
  transition: background-color 0.2s ease;
}

.mv-accordion__item:last-child {
  border-bottom: none;
}

.mv-accordion__header {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .mv-accordion__header:hover {
    background-color: rgba(60, 50, 40, 0.035);
  }
}

.mv-accordion__header:focus-visible {
  outline: 2px solid #5A82B8;
  outline-offset: -2px;
}

.mv-accordion__badge-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.mv-accordion__badge-wrap .mv-badge {
  display: block;
}

.mv-accordion__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mv-accordion__name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--mv-color-text-main);
  line-height: 1.3;
}

.mv-accordion__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--mv-color-text-subtle);
}

.mv-accordion__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mv-color-text-subtle);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mv-accordion__icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mv-accordion__header[aria-expanded="true"] .mv-accordion__icon {
  transform: rotate(180deg);
}

/* Accordion Smooth Expand/Collapse */
.mv-accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}

.mv-accordion__panel.is-open {
  max-height: 1200px;
  visibility: visible;
}

.mv-accordion__panel-inner {
  padding: 4px 18px 16px 18px;
}

.mv-accordion__desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--mv-color-text-muted);
  margin: 0 0 12px 0;
  padding: 0;
}

/* Collection List & Buttons */
.mv-collection-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mv-collection-item {
  margin: 0;
  padding: 0;
}

.mv-collection-btn {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid rgba(60, 50, 40, 0.10);
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .mv-collection-btn:hover {
    background-color: #FAF5EB;
    border-color: var(--mv-select-color-hover);
    transform: translateX(2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
  }
}

.mv-collection-btn:focus-visible {
  outline: 2px solid #5A82B8;
  outline-offset: -1px;
}

.mv-collection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mv-color-text-main);
  letter-spacing: 0.01em;
}

.mv-collection-builder {
  font-size: 11px;
  font-weight: 400;
  color: var(--mv-color-text-subtle);
  flex-shrink: 0;
}

/* ==========================================================================
   Map Container (#mv-map)
   ========================================================================== */

#mv-map {
  position: relative;
  background-color: #E6E4DF;
}

@media (min-width: 1024px) {
  #mv-map {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
  }
}

@media (max-width: 1023px) {
  #mv-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
  }
}

/* Mapbox overrides to align with clean aesthetic */
#mv-map .mapboxgl-ctrl-top-right {
  top: 14px;
  right: 14px;
}

#mv-map .mapboxgl-ctrl-group {
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(60, 50, 40, 0.12);
  overflow: hidden;
}

/* ==========================================================================
   Interactive Synchronization States (Phase 5)
   ========================================================================== */

/* Panel Button Hover Sync */
.mv-collection-btn.is-hover {
  background-color: #FAF5EB;
  border-color: var(--mv-select-color-hover);
  transform: translateX(3px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Panel Button Active Selection */
.mv-collection-btn.is-active {
  background-color: #FFFFFF;
  border-color: var(--mv-select-color);
  border-width: 1.5px;
  transform: translateX(3px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.mv-collection-btn.is-active .mv-collection-title {
  color: var(--mv-color-text-main);
  font-weight: 700;
}

/* Dimmed States (when another Home Type is locked) */
.mv-accordion__item.is-dimmed {
  opacity: 0.45;
  filter: grayscale(25%);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mv-accordion__item.is-dimmed .mv-accordion__header:hover {
    background-color: rgba(60, 50, 40, 0.05);
  }
}

.mv-collection-btn.is-dimmed {
  opacity: 0.55;
}

/* Locked Home Type Header */
.mv-accordion__header.is-locked {
  background-color: rgba(60, 50, 40, 0.07);
  box-shadow: inset 3px 0 0 #201D1A;
}

/* ==========================================================================
   Sliding Collection Info Panel (Desktop Drawer / Mobile Bottom Card)
   ========================================================================== */

.mv-info-panel {
  background-color: #FAF8F5;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.mv-info-panel__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Close Button (≥ 44px tap target on mobile, 32px on desktop) */
.mv-info-panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(60, 50, 40, 0.16);
  color: var(--mv-color-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .mv-info-panel__close:hover {
    background-color: #FFFFFF;
    border-color: rgba(40, 30, 20, 0.40);
    transform: scale(1.08);
  }
}

.mv-info-panel__close:focus-visible {
  outline: 2px solid #5A82B8;
  outline-offset: 2px;
}

/* Desktop Sliding Drawer Styles */
@media (min-width: 1024px) {
  .mv-info-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 92vw;
    border-left: 1px solid rgba(60, 50, 40, 0.14);
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.09);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  }

  .mv-info-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mv-info-panel__handle-bar,
  .mv-info-panel__peek {
    display: none !important;
  }
}

/* Mobile & Tablet Bottom Card Styles */
@media (max-width: 1023px) {
  .mv-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(60, 50, 40, 0.15);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), height 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  }

  @media (min-width: 768px) and (max-width: 1023px) {
    .mv-info-panel {
      max-width: 600px;
      left: 50%;
      transform: translateX(-50%) translateY(100%);
    }

    .mv-info-panel.is-peek,
    .mv-info-panel.is-expanded {
      transform: translateX(-50%) translateY(0) !important;
    }
  }

  .mv-info-panel.is-peek {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    height: auto;
    min-height: 155px;
    max-height: 195px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mv-info-panel.is-expanded {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    height: 75dvh;
    max-height: 75dvh;
  }

  .mv-info-panel__handle-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 24px;
    flex-shrink: 0;
    touch-action: none;
  }

  .mv-info-panel__handle-btn {
    background: transparent;
    border: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* Peek Mode Layout */
  .mv-info-panel.is-peek .mv-info-panel__peek {
    display: flex;
    gap: 14px;
    padding: 0 16px calc(14px + env(safe-area-inset-bottom, 0px)) 16px;
    cursor: pointer;
    align-items: flex-start;
  }

  .mv-info-panel.is-peek .mv-info-panel__body,
  .mv-info-panel.is-peek .mv-info-panel__footer {
    display: none !important;
  }

  .mv-info-panel.is-expanded .mv-info-panel__peek {
    display: none !important;
  }

  .mv-info-panel.is-expanded .mv-info-panel__body {
    display: flex;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 18px 16px 18px;
  }

  .mv-info-panel.is-expanded .mv-info-panel__footer {
    display: block;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .mv-info-panel__peek-thumb {
    width: 76px;
    height: 76px;
    border-radius: 6px;
    overflow: hidden;
    background: #EAE6DF;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  .mv-info-panel__peek-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .mv-info-panel__peek-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 36px; /* space for close button */
  }

  .mv-info-panel__title--peek {
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
  }

  .mv-info-panel__builder--peek {
    font-size: 11.5px;
    margin: 0;
  }

  .mv-info-panel__peek-specs {
    font-size: 11.5px;
    font-weight: 600;
    color: #3C3228;
    margin-top: 3px;
    line-height: 1.3;
  }

  .mv-info-panel__close {
    top: 8px;
    right: 12px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* Scrollable Content Body */
.mv-info-panel__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 22px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mv-info-panel__body::-webkit-scrollbar {
  width: 5px;
}
.mv-info-panel__body::-webkit-scrollbar-thumb {
  background: rgba(60, 50, 40, 0.15);
  border-radius: 3px;
}

/* Header & Identity */
.mv-info-panel__header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 36px; /* Room for close button */
}

.mv-info-panel__badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mv-info-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mv-info-panel__badge img,
.mv-info-panel__badge svg {
  display: block;
}

.mv-info-panel__type-name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mv-color-text-subtle);
}

.mv-info-panel__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--mv-color-text-main);
  margin: 0;
  line-height: 1.2;
}

.mv-info-panel__builder {
  font-size: 13px;
  font-weight: 500;
  color: var(--mv-color-text-muted);
  margin: 0;
}

/* Gallery Block */
.mv-info-panel__gallery {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #EAE6DF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mv-info-panel__img-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #EAE6DF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mv-info-panel__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

.mv-info-panel__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #3C3228;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 20px;
}

/* Gallery Controls */
.mv-info-panel__gallery-controls {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

.mv-info-panel__gallery-controls.is-hidden {
  display: none !important;
}

.mv-info-panel__counter {
  background: rgba(26, 23, 20, 0.75);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

.mv-info-panel__nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(60, 50, 40, 0.15);
  color: var(--mv-color-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mv-info-panel__nav-btn:hover {
    background-color: #FFFFFF;
    transform: scale(1.1);
  }
}

/* Specifications Grid */
.mv-info-panel__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
}

.mv-spec-item {
  background: #FFFFFF;
  border: 1px solid rgba(60, 50, 40, 0.09);
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mv-spec-item--full {
  grid-column: 1 / -1;
}

.mv-spec-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mv-color-text-subtle);
}

.mv-spec-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--mv-color-text-main);
  line-height: 1.25;
}

/* Footer CTA */
.mv-info-panel__footer {
  flex-shrink: 0;
  padding: 14px 22px 18px 22px;
  border-top: 1px solid var(--mv-color-border-subtle);
  background: #FAF8F5;
}

.mv-info-panel__cta-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: #201D1A;
  color: #FFFFFF !important;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .mv-info-panel__cta-btn:hover {
    background: #3B342C;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.20);
  }
}

.mv-info-panel__cta-btn:focus-visible {
  background: #3B342C;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.20);
}

.mv-info-panel__cta-btn.is-hidden {
  display: none !important;
}

/* ==========================================================================
   Compact Legal Strip & Disclaimer Modal (Phase 7)
   ========================================================================== */

.mv-legal-strip {
  padding: 10px 16px 12px 16px;
  background: #FAF8F5;
  color: var(--mv-color-text-subtle, #8A8177);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  box-sizing: border-box;
}

.mv-legal-strip__broker {
  font-weight: 500;
  color: var(--mv-color-text-muted, #6B6258);
  margin-bottom: 2px;
}

.mv-legal-strip__disclaimer {
  font-size: 10.5px;
  color: var(--mv-color-text-subtle, #8A8177);
}

.mv-legal-strip__link {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--mv-color-text-main, #201D1A);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}

.mv-legal-strip__link:hover,
.mv-legal-strip__link:focus-visible {
  color: #000000;
}

/* Desktop: Pinned at bottom of left sidebar */
@media (min-width: 1024px) {
  .mv-legal-strip--desktop {
    display: block;
    flex-shrink: 0;
    border-top: 1px solid var(--mv-color-border-subtle, rgba(60, 50, 40, 0.12));
  }

  .mv-legal-strip--mobile {
    display: none !important;
  }
}

/* Mobile: Placed at the bottom of the scrollable Explore accordion */
@media (max-width: 1023px) {
  .mv-legal-strip--desktop {
    display: none !important;
  }

  .mv-legal-strip--mobile {
    display: block;
    margin-top: 16px;
    margin-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(60, 50, 40, 0.08);
    background: transparent;
  }
}

/* Disclaimer Dialog / Modal */
.mv-legal-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.mv-legal-modal.is-hidden {
  display: none !important;
}

.mv-legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mv-legal-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mvModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mvModalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.mv-legal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px 24px;
  border-bottom: 1px solid rgba(60, 50, 40, 0.10);
  background: #FAF8F5;
}

.mv-legal-modal__title {
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #201D1A;
}

.mv-legal-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #6B6258;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mv-legal-modal__close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #201D1A;
}

.mv-legal-modal__content {
  padding: 20px 24px 24px 24px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #3C3630;
}

.mv-legal-modal__content p {
  margin: 0 0 14px 0;
}

.mv-legal-modal__content p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Parks & Recreation Styles (Addition)
   ========================================================================== */

.mv-sidebar__section-header {
  padding: 20px 20px 8px;
  border-top: 1px solid rgba(60, 50, 40, 0.08);
  margin-top: 4px;
}

.mv-accordion:not(.mv-accordion--places) {
  padding-bottom: 8px;
}

.mv-accordion--places {
  padding-bottom: 48px;
}

.mv-collection-status {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #c07a3e;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.mv-place-status-pill {
  display: inline-block;
  background: #fdf3e7;
  color: #b8621b;
  border: 1px solid rgba(184, 98, 27, 0.25);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
}

.mv-place-photo-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  gap: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.mv-place-photo-placeholder__badge svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.mv-place-photo-placeholder__text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.mv-place-peek-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.mv-place-peek-placeholder svg {
  width: 28px;
  height: 28px;
}

.mv-spec-item--highlights {
  gap: 8px;
  padding: 10px 12px;
}

.mv-spec-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mv-spec-highlights li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--mv-color-text-main);
  font-weight: 500;
}

.mv-spec-highlights li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mv-color-border-strong, #8C7A6B);
}

/* Desktop Info Panel Flex & Short-Viewport Safeguards */
@media (min-width: 1024px) {
  .mv-info-panel__body {
    min-height: 0;
    overflow: hidden;
  }

  .mv-info-panel__header {
    flex: 0 0 auto;
  }

  .mv-info-panel__gallery {
    flex: 0 0 auto;
    min-height: 200px;
    max-height: 31vh;
  }

  .mv-info-panel__img-wrap,
  .mv-place-photo-placeholder {
    flex: 0 0 auto;
    aspect-ratio: 16 / 10;
    min-height: 200px;
    max-height: 31vh;
  }

  .mv-info-panel__specs {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    padding-right: 2px;
  }

  .mv-info-panel__specs::-webkit-scrollbar {
    width: 5px;
  }

  .mv-info-panel__specs::-webkit-scrollbar-thumb {
    background: rgba(60, 50, 40, 0.15);
    border-radius: 3px;
  }
}

@media (min-width: 1024px) and (max-height: 800px) {
  .mv-info-panel__body {
    padding: 10px 18px 6px 18px;
    gap: 6px;
  }

  .mv-info-panel__header {
    gap: 1px;
  }

  .mv-info-panel__badge-row {
    margin-bottom: 1px;
    gap: 6px;
  }

  .mv-info-panel__badge svg,
  .mv-info-panel__badge img {
    width: 24px;
    height: 24px;
  }

  .mv-info-panel__title {
    font-size: 17px;
    line-height: 1.15;
  }

  .mv-info-panel__builder {
    font-size: 11.5px;
    line-height: 1.2;
  }

  .mv-place-status-pill {
    margin-top: 2px;
    padding: 2px 8px;
    font-size: 10px;
  }

  .mv-info-panel__specs {
    padding-top: 0;
    gap: 6px;
  }

  .mv-spec-item {
    padding: 6px 9px;
  }

  .mv-spec-item--highlights {
    padding: 7px 10px;
    gap: 5px;
  }

  .mv-spec-highlights {
    gap: 4px;
  }

  .mv-spec-highlights li {
    font-size: 12px;
    line-height: 1.3;
  }

  .mv-info-panel__footer {
    padding: 8px 18px 10px 18px;
  }

  .mv-info-panel__cta-btn {
    padding: 9px 14px;
    font-size: 11.5px;
  }
}



