/* ==============================================================================
   IVY CENTRAL - VỊ TRÍ & KẾT NỐI (Compact Widescreen Layout)
   Approved Benchmark: media_1793072350039_24d445cb.jpg
   Fonts: Montserrat (Details/UI) & Playfair Display (Titles/Distance Numbers)
   ============================================================================== */

/* Section Base */
#location {
  padding-top: 40px;
  padding-bottom: 40px;
  background-color: #F2F7FF;
  color: #243B60;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 80px;
}

.ivy-loc-header h2 {
  color: #0B1D49 !important;
}

.ivy-loc-header p {
  color: #405779 !important;
}

/* Typography Classes */
.font-montserrat {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}

.font-playfair {
  font-family: 'Playfair Display', Georgia, serif;
}

.lining-numbers {
  font-variant-numeric: lining-nums tabular-nums;
  -moz-font-feature-settings: "lnum" 1, "tnum" 1;
  -webkit-font-feature-settings: "lnum" 1, "tnum" 1;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

/* Widescreen Container: 32px horizontal padding on desktop */
.ivy-loc-widescreen-container {
  width: 100%;
  max-width: 1600px;
  padding-left: 32px;
  padding-right: 32px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Section Header */
.ivy-loc-header {
  margin-bottom: 24px;
}

/* Desktop Grid: minmax(0, 1fr) 380px, gap 24px, aligned top */
.ivy-loc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

/* Left Map Viewport */
.ivy-loc-map-col {
  min-width: 0;
  width: 100%;
}

.ivy-loc-map-container {
  position: relative;
  width: 100%;
  height: clamp(500px, 64vh, 620px);
  background-color: #EBF2EC;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(11, 29, 73, 0.04);
}

.ivy-loc-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  background-color: #EBF2EC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ivy-loc-map-stage.is-dragging {
  cursor: grabbing !important;
}

.ivy-loc-map-stage.is-zoomed {
  cursor: grab;
}

.ivy-loc-map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transform-origin: center center;
  transition: transform 180ms cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

@media (prefers-reduced-motion: reduce) {
  .ivy-loc-map-img {
    transition: none !important;
  }
}

/* Floating Map Controls (Zoom & Reset) */
.ivy-loc-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(11, 29, 73, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(11, 29, 73, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ivy-loc-ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #0B1D49;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  user-select: none;
}

.ivy-loc-ctrl-btn:not(:last-child) {
  border-bottom: 1px solid rgba(11, 29, 73, 0.08);
}

.ivy-loc-ctrl-btn:hover {
  background-color: #F1F5F9;
  color: #B89344;
}

.ivy-loc-ctrl-btn:focus-visible {
  outline: 2px solid #B89344;
  outline-offset: -2px;
}

/* Caption under Map */
.ivy-loc-map-note {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11.5px;
  color: #405779;
  margin-top: 8px;
  margin-bottom: 0;
  font-weight: 400;
}

/* Right Info Column (Sidebar) */
.ivy-loc-info-col {
  border-left: 1px solid rgba(11, 29, 73, 0.15);
  padding-left: 28px;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

/* Eyebrow Label */
.ivy-loc-subhead {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0549CE;
  margin-bottom: 10px; /* 10px to tab */
  display: block;
}

/* 2-Row Compact Category Buttons */
.ivy-loc-tabs-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.ivy-loc-tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.ivy-loc-tab-btn {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid rgba(11, 29, 73, 0.22);
  border-radius: 9999px;
  cursor: pointer;
  color: #0B1D49;
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: all 180ms ease;
  outline: none;
  line-height: 1.3;
}

.ivy-loc-tab-btn:hover {
  color: #0B1D49;
  background: rgba(11, 29, 73, 0.06);
  border-color: rgba(11, 29, 73, 0.4);
}

.ivy-loc-tab-btn::after {
  display: none;
}

.ivy-loc-tab-btn.is-active {
  color: #FFFFFF !important;
  background-color: #0B1D49 !important;
  border-color: #0B1D49 !important;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(11, 29, 73, 0.22);
}

.ivy-loc-tab-btn:focus-visible {
  outline: 2px solid #0B1D49;
  outline-offset: 3px;
}

/* Thin Divider */
.ivy-loc-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(11, 29, 73, 0.15);
  margin-bottom: 18px;
}

/* Tab Content Pane */
.ivy-loc-content-pane {
  opacity: 1;
  min-height: 200px;
}

@keyframes locFadeIn {
  from {
    opacity: 0.65;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ivy-loc-content-pane.animate-fade {
  animation: locFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Content Title */
.ivy-loc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: #0B1D49;
  margin: 0 0 8px 0;
}

/* Content Description */
.ivy-loc-desc {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
  color: #243B60;
  margin: 0 0 16px 0;
}

/* Highlights List */
.ivy-loc-highlight-list {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.ivy-loc-highlight-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(11, 29, 73, 0.15);
}

.ivy-loc-num-col {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px solid rgba(11, 29, 73, 0.15);
  white-space: nowrap;
}

.ivy-loc-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  color: #0B1D49;
}

.ivy-loc-unit {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #405779;
  align-self: baseline;
}

.ivy-loc-dash {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #0B1D49;
  padding-left: 2px;
}

.ivy-loc-name {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #243B60;
  padding-left: 14px;
  word-break: break-word;
}

/* Bottom Action Row (Xem thêm + on left / Xem bản đồ lớn ↗ on right) */
.ivy-loc-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

.ivy-loc-more-btn {
  background: transparent;
  border: 1px solid rgba(11, 29, 73, 0.25);
  border-radius: 6px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #0B1D49;
  cursor: pointer;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  transition: all 180ms ease;
  outline: none;
}

.ivy-loc-more-btn:hover {
  background: rgba(11, 29, 73, 0.06);
  border-color: #0B1D49;
  color: #0B1D49;
}

.ivy-loc-modal-trigger {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  height: 38px;
  padding: 0 18px;
  border: 1px solid #0B1D49;
  border-radius: 6px;
  background: #0B1D49;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
  outline: none;
  box-shadow: 0 2px 8px rgba(11, 29, 73, 0.15);
}

.ivy-loc-modal-trigger:hover {
  background-color: #142F63;
  border-color: #142F63;
  color: #FFFFFF;
}

.ivy-loc-modal-trigger:focus-visible {
  outline: 2px solid #0B1D49;
  outline-offset: 2px;
}

/* ---------------- FULLSCREEN MAP MODAL ---------------- */
.ivy-map-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 16, 46, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.ivy-map-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.ivy-map-modal-dialog {
  background: #FFFFFF;
  border-radius: 12px;
  width: 100%;
  max-width: 1280px;
  height: 92vh;
  max-height: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  transform: scale(0.98);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ivy-map-modal.is-open .ivy-map-modal-dialog {
  transform: scale(1);
}

.ivy-map-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #E5D7B7;
  background: #FAF8F5;
}

.ivy-map-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: #0B1D49;
  margin: 0;
}

.ivy-map-modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #0B1D49;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 150ms ease;
}

.ivy-map-modal-close:hover {
  background-color: rgba(11, 29, 73, 0.08);
}

.ivy-map-modal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #EBF2EC;
}

.ivy-map-modal-footer {
  padding: 10px 20px;
  background: #FAF8F5;
  border-top: 1px solid #E5D7B7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #747782;
}

/* ---------------- RESPONSIVE BREAKPOINTS ---------------- */
@media (max-width: 1023px) {
  .ivy-loc-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .ivy-loc-widescreen-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  #location {
    padding-top: 32px;
    padding-bottom: 36px;
  }

  .ivy-loc-map-container {
    height: clamp(380px, 52vh, 460px);
  }

  .ivy-loc-info-col {
    border-left: none;
    border-top: 1px solid rgba(11, 29, 73, 0.15);
    padding-left: 0;
    padding-top: 20px;
  }

  .ivy-loc-tabs-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 20px;
    padding-bottom: 4px;
    margin-bottom: 14px;
  }

  .ivy-loc-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .ivy-loc-tabs-row {
    display: contents; /* Unwraps the 2 rows into a single horizontal scroll row */
  }

  .ivy-loc-tab-btn {
    min-height: 44px; /* Vùng chạm tối thiểu 44px */
    padding: 0 4px;
    flex-shrink: 0;
  }

  .ivy-loc-actions-row {
    margin-top: 16px;
  }
}
