:root {
  --red: #ed0018;
  --ink: #14171a;
  --muted: #858b92;
  --line: #d1d5da;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #6ecad7;
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.locations-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #6ecad7;
}

.locations-shell {
  position: relative;
  min-height: 100vh;
}

.locations-map-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.locations-map {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(116,214,224,.45), rgba(116,214,224,.45)),
    url("/assets/camiones-hub/Isuzu_sitio_productos_mapa.jpg") center / cover no-repeat;
}

.locations-corner {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  width: min(42vw, 620px);
  height: auto;
  opacity: 0;
  will-change: clip-path, opacity, transform;
}

.locations-corner--top {
  top: 0;
  left: 0;
  clip-path: inset(0 100% 0 0);
  transform: translate3d(-32px, -18px, 0);
  animation: locationCornerTopIn 1.25s cubic-bezier(.16, 1, .3, 1) .18s forwards;
}

.locations-corner--bottom {
  right: 0;
  bottom: 0;
  width: min(46vw, 700px);
  clip-path: inset(0 0 0 100%);
  transform: translate3d(34px, 22px, 0);
  animation: locationCornerBottomIn 1.35s cubic-bezier(.16, 1, .3, 1) .32s forwards;
}

@keyframes locationCornerTopIn {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translate3d(-32px, -18px, 0);
  }

  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes locationCornerBottomIn {
  0% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
    transform: translate3d(34px, 22px, 0);
  }

  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translate3d(0, 0, 0);
  }
}

.locations-panel {
  position: relative;
  z-index: 10;
  width: min(360px, calc(100vw - 32px));
  padding: 110px 0 34px 28px;
}

.location-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.22fr;
  width: min(320px, 100%);
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
}

.location-tabs button {
  min-height: 30px;
  border: 0;
  color: #8c8f94;
  background: #d9d9dc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transition: color .2s ease, background .2s ease;
}

.location-tabs button.active {
  color: #fff;
  background: var(--red);
}

.locations-card {
  width: min(320px, 100%);
  max-height: calc(100vh - 148px);
  display: grid;
  padding: 16px 18px 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 38px rgba(0,0,0,.2);
  overflow: hidden;
}

.locations-card h1 {
  margin: 0 0 14px;
  color: #777b80;
  font-size: 20px;
  line-height: 1.08;
  font-weight: 400;
}

.locations-search {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 10px;
  margin-bottom: 10px;
}

.locations-search input {
  min-width: 0;
  min-height: 42px;
  padding: 0 13px;
  border: 2px solid #c7c9cc;
  border-radius: 4px;
  color: #555;
  background: #fff;
  font-size: 13px;
}

.locations-search button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 5px;
  background: var(--red);
  cursor: pointer;
}

.locations-search button span,
.locations-search button span::before,
.locations-search button span::after {
  display: block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}

.locations-search button span {
  position: relative;
}

.locations-search button span::before,
.locations-search button span::after {
  content: "";
  position: absolute;
  left: 0;
}

.locations-search button span::before {
  top: -7px;
  width: 13px;
}

.locations-search button span::after {
  top: 7px;
  width: 10px;
}

.locations-status {
  min-height: 18px;
  margin: 0 0 12px;
  color: #8d9298;
  font-size: 12px;
  line-height: 1.3;
}

.locations-results {
  display: grid;
  gap: 14px;
  max-height: min(590px, calc(100vh - 302px));
  overflow: auto;
  padding: 2px 3px 4px 0;
  overscroll-behavior: contain;
}

.location-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  width: 100%;
  min-height: 164px;
  padding: 22px 24px;
  border: 2px solid #d0d0d0;
  border-radius: 4px;
  color: #7a7d82;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.18;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.location-result strong {
  color: #6a6d72;
  font-size: 13px;
  line-height: 1.15;
}

.location-result small {
  justify-self: end;
  color: #868a90;
  white-space: nowrap;
}

.location-result span {
  grid-column: 1 / -1;
}

.location-result:hover,
.location-result.is-active {
  border-color: var(--red);
  box-shadow: 0 10px 20px rgba(0,0,0,.1);
  transform: translateY(-1px);
}

.results-status {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  background: #fff;
  color: #777;
  font-size: 13px;
  line-height: 1.35;
}

.fallback-map {
  position: relative;
  height: 100%;
}

.fallback-marker {
  position: absolute;
  width: 45px;
  height: 59px;
  border: 0;
  background: url("/assets/camiones-hub/marker.png") center / contain no-repeat;
  transform: translate(-50%, -100%);
  cursor: pointer;
}

.fallback-popup {
  position: absolute;
  left: min(390px, 42vw);
  top: 90px;
  z-index: 20;
  width: min(300px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: 6px;
  color: #555;
  background: #fff;
  box-shadow: 0 18px 34px rgba(0,0,0,.24);
}

.map-popup {
  display: grid;
  gap: 5px;
  max-width: 270px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.3;
}

.map-popup b {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
}

.map-popup strong {
  width: fit-content;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 11px;
}

@media (max-width: 760px) {
  .locations-shell {
    min-height: 100svh;
    display: grid;
    grid-template-rows: 48svh auto;
  }

  .locations-map-wrap {
    position: relative;
    inset: auto;
    min-height: 48svh;
    overflow: hidden;
  }

  .locations-map {
    position: absolute;
    inset: 0;
  }

  .locations-panel {
    width: 100%;
    padding: 0 16px 28px;
  }

  .location-tabs,
  .locations-card {
    width: min(440px, 100%);
    margin-inline: auto;
  }

  .locations-card {
    max-height: none;
  }

  .locations-results {
    max-height: 420px;
  }

  .locations-corner {
    width: min(72vw, 390px);
  }

  .locations-corner--bottom {
    width: min(78vw, 440px);
  }

  .fallback-popup {
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .locations-corner {
    opacity: 1;
    clip-path: none;
    transform: none;
    animation: none;
  }
}
