/* =========================================================
   UniDash Location Map Modal (EatSure-style square)
   File: assets/css/location.css
   Back inside, Close outside-right inline
   Buttons = icon only (no white bg)
   ========================================================= */

/* darker overlay like screenshot */
.ud-map-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px 54px;
}

.ud-map-overlay.show {
  display: flex;
}

.ud-map-shell {
  position: relative;
  width: min(760px, calc(100vw - 108px));
  height: min(760px, calc(100vh - 48px));
  max-height: 88vh;
}

/* modal box is square */
.ud-map-modal {
  width: 100%;
  height: 100%;
  background: var(--ud-bg);
  border-radius: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

/* ✅ Close icon OUTSIDE, to the right, inline with top edge (NO BG) */
.ud-map-close-out {
  position: absolute;
  top: 14px;
  right: -38px; /* small gap outside */
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent; /* ✅ no bg */
  box-shadow: none;        /* ✅ no shadow */
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 10001;
  padding: 0;
  opacity: 0.95;
}

.ud-map-close-out:hover {
  opacity: 1;
}

.ud-map-close-out img {
  width: 30px;
  height: 30px;
  display: block;
}

/* top map area */
.ud-map-top {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #e5e7eb;
}

#udMapContainer {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
}

/* force canvas visible */
#udMapContainer canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  opacity: 1 !important;
}

/* ✅ Back icon INSIDE (top-left) (NO BG) */
.ud-map-back-in {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent; /* ✅ no bg */
  box-shadow: none;        /* ✅ no shadow */
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 10;
  padding: 0;
  opacity: 0.95;
}

.ud-map-back-in:hover {
  opacity: 1;
}

.ud-map-back-in img {
  width: 30px;
  height: 30px;
  display: block;
}

/* hint bubble with pointer */
.ud-map-hint {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 17, 17, 0.80);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  z-index: 9;
}

.ud-map-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid rgba(17, 17, 17, 0.80);
}

/* ✅ Center pin icon image */
.ud-map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -92%);
  pointer-events: none;
  z-index: 9;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
}

.ud-map-pin img {
  width: 46px;
  height: 46px;
  display: block;
}

/* zoom buttons right (keep white like screenshot) */
.ud-map-zoom {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

.ud-map-zoom button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--ud-bg);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.ud-map-zoom button:active {
  transform: translateY(0.5px);
}

/* Bottom section tightened */
.ud-map-bottom {
  flex: 0 0 220px;
  padding: 14px 22px 28px;
  background: var(--ud-bg);
}

.ud-map-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.ud-map-info img {
  width: 16px;
  height: 16px;
  margin-top: 6px;
  opacity: 0.95;
}

.ud-map-label {
  font-size: 14px;
  color: var(--ud-text-muted);
  margin-bottom: 6px;
}

.ud-map-title {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--ud-text-strong);
}

.ud-map-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ud-text-strong);
  opacity: 0.95;
}

/* confirm button */
.ud-map-confirm {
  margin-top: 12px;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 0;
  background: var(--ud-primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.ud-map-confirm:hover {
  background: var(--ud-brand);
}

.ud-map-confirm:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Mobile fallback */
@media (max-width: 600px) {
  .ud-map-overlay {
    padding: 14px;
  }

  .ud-map-shell {
    width: 100%;
    height: min(86vh, 720px);
    max-height: 86vh;
  }

  .ud-map-bottom {
    flex-basis: 218px;
    padding: 14px 16px 28px;
  }

  .ud-map-title {
    font-size: 24px;
  }

  .ud-map-close-out {
    right: 10px;
    top: 10px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
  }
}
