.ail-store-locator,
.ail-store-locator * {
  box-sizing: border-box;
}

.ail-store-locator {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  width: 100%;
  min-height: var(--ail-map-height, 720px);
  background: #14131a;
  color: #f2f2f6;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}

.ail-sidebar {
  background: linear-gradient(180deg, #1b1a23 0%, #111119 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  min-height: var(--ail-map-height, 720px);
  padding-bottom: 14px;
}

.ail-filter-box {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.ail-filter-label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #f6f6fb;
}

.ail-comuna-dropdown {
  position: relative;
}

.ail-comuna-trigger {
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: #242330;
  color: #ffffff;
  border-radius: 14px;
  height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.ail-comuna-trigger:hover,
.ail-comuna-dropdown.is-open .ail-comuna-trigger {
  border-color: rgba(255,255,255,.14);
}

.ail-comuna-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ail-accent, #e31e24);
  border-bottom: 2px solid var(--ail-accent, #e31e24);
  transform: rotate(45deg) translateY(-1px);
  flex: 0 0 auto;
  transition: transform .2s ease;
}

.ail-comuna-dropdown.is-open .ail-comuna-chevron {
  transform: rotate(-135deg) translateY(-1px);
}

.ail-comuna-menu[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ail-comuna-dropdown:not(.is-open) .ail-comuna-menu {
  display: none !important;
}

.ail-comuna-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  background: #201f2a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,.28);
  max-height: 320px;
  overflow: auto;
}

.ail-comuna-option {
  appearance: none;
  border: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  cursor: pointer;
}

.ail-comuna-option:hover,
.ail-comuna-option.is-active {
  background: rgba(255,255,255,.06);
  color: var(--ail-accent, #e31e24);
}

.ail-locales-list {
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 0 1 auto;
  max-height: calc((72px + 36px + 1px) * var(--ail-list-visible-items, 5));
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}

.ail-locales-list::-webkit-scrollbar {
  width: 8px;
}

.ail-locales-list::-webkit-scrollbar-track {
  background: transparent;
}

.ail-locales-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.24);
  border-radius: 999px;
}

.ail-local-card {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  padding: 18px 20px;
  text-align: left;
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ail-local-card:hover,
.ail-local-card.is-active {
  background: rgba(255,255,255,.035);
}

.ail-local-card:focus-visible {
  outline: 2px solid var(--ail-accent, #e31e24);
  outline-offset: -4px;
}

.ail-local-card.is-active {
  box-shadow: inset 4px 0 0 var(--ail-accent, #e31e24);
}

.ail-local-card.is-hidden,
.ail-local-card[hidden] {
  display: none !important;
}

.ail-local-thumb-wrap {
  width: 72px;
  height: 72px;
  display: block;
}

.ail-local-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.ail-local-thumb--placeholder {
  background: var(--ail-accent, #e31e24);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  display: grid;
  place-items: center;
}

.ail-local-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.ail-local-title {
  color: var(--ail-accent, #e31e24);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.ail-local-address,
.ail-local-comuna,
.ail-local-region,
.ail-local-whatsapp {
  color: #f0f0f5;
  font-size: 14px;
  line-height: 1.35;
}

.ail-local-comuna {
  color: rgba(255,255,255,.82);
}

.ail-local-region {
  color: rgba(255,255,255,.64);
}

.ail-local-whatsapp {
  color: rgba(255,255,255,.7);
  font-size: 13px;
}

.ail-local-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
}

.ail-local-action {
  appearance: none;
  border: 0;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}

.ail-local-action:hover {
  transform: translateY(-1px);
}

.ail-local-action--map {
  background: rgba(255,255,255,.08);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.12);
}

.ail-local-action--whatsapp {
  background: #22c55e;
  color: #071b10 !important;
}

.ail-map-panel,
.ail-map {
  min-height: var(--ail-map-height, 720px);
}

.ail-map-panel {
  position: relative;
}

.ail-map {
  width: 100%;
  height: 100%;
  min-height: var(--ail-map-height, 720px);
  background: #e7e2dd;
}

.ail-store-locator .leaflet-container {
  background: #e7e2dd;
}

.ail-store-locator .leaflet-container img,
.ail-store-locator .leaflet-container svg,
.ail-store-locator .leaflet-pane > img,
.ail-store-locator .leaflet-pane > svg {
  max-width: none !important;
}

.ail-empty-locales {
  padding: 18px 20px;
  background: #17161d;
  color: #fff;
  border-radius: 14px;
}

.ail-map-marker-wrap {
  background: transparent !important;
  border: 0 !important;
}

.ail-map-marker {
  display: block;
  width: 24px;
  height: 24px;
  background: var(--ail-marker, #e31e24);
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.ail-map-marker::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.ail-leaflet-popup .leaflet-popup-content-wrapper {
  background: #16161f;
  color: #fff;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 44px rgba(0,0,0,.32);
}

.ail-leaflet-popup .leaflet-popup-content {
  margin: 0;
  width: 300px !important;
}

.ail-leaflet-popup .leaflet-popup-tip {
  background: #16161f;
}

.ail-leaflet-popup .leaflet-popup-close-button {
  width: 30px;
  height: 30px;
  line-height: 28px;
  font-size: 20px;
  color: #fff !important;
  background: rgba(0,0,0,.42) !important;
  border-radius: 999px;
  top: 8px;
  right: 8px;
}

.ail-popup-card {
  overflow: hidden;
}

.ail-popup-image img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.ail-popup-body {
  padding: 16px;
}

.ail-popup-title {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--ail-accent, #e31e24);
}

.ail-popup-line,
.ail-popup-hours {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,.9);
  margin-bottom: 6px;
}

.ail-popup-line a,
.ail-popup-hours a {
  color: #fff;
  text-decoration: none;
}

.ail-popup-line a:hover {
  color: var(--ail-accent, #e31e24);
}

.ail-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ail-popup-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none !important;
  background: var(--ail-accent, #e31e24);
  color: #fff !important;
  font-weight: 800;
  border: 0;
}

.ail-popup-action--whatsapp {
  background: #22c55e;
  color: #071b10 !important;
}

.ail-popup-action:visited,
.ail-popup-action:focus,
.ail-popup-action:active {
  color: #fff !important;
  text-decoration: none;
}

.ail-popup-action--whatsapp:visited,
.ail-popup-action--whatsapp:focus,
.ail-popup-action--whatsapp:active {
  color: #071b10 !important;
}

.ail-popup-action:hover {
  filter: brightness(1.06);
}

.ail-store-locator .leaflet-control-attribution {
  font-size: 11px;
}

@media (max-width: 1024px) {
  .ail-store-locator {
    grid-template-columns: 1fr;
  }

  .ail-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .ail-locales-list {
    max-height: 360px;
  }

  .ail-map-panel,
  .ail-map {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .ail-store-locator {
    display: flex;
    flex-direction: column;
    min-height: auto;
    border-radius: 16px;
  }

  .ail-sidebar {
    display: contents;
    min-height: auto;
    padding-bottom: 0;
    border: 0;
  }

  .ail-filter-box {
    order: 1;
    padding: 14px 14px 12px;
    background: #17161f;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .ail-filter-label {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .ail-comuna-trigger {
    height: 46px;
    border-radius: 13px;
    padding: 0 14px;
    font-size: 15px;
  }

  .ail-comuna-menu {
    z-index: 1000;
    max-height: min(60vh, 340px);
  }

  .ail-map-panel {
    order: 2;
    min-height: 360px;
    height: 360px;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .ail-map {
    height: 360px;
    min-height: 360px;
  }

  .ail-locales-list {
    order: 3;
    max-height: 228px;
    flex: none;
    padding: 0;
    background: #12121a;
  }

  .ail-local-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
  }

  .ail-local-thumb-wrap,
  .ail-local-thumb {
    width: 52px;
    height: 52px;
  }

  .ail-local-thumb {
    border-radius: 11px;
  }

  .ail-local-copy {
    gap: 3px;
  }

  .ail-local-title {
    font-size: 14px;
    line-height: 1.2;
  }

  .ail-local-address,
  .ail-local-comuna,
  .ail-local-region,
  .ail-local-whatsapp {
    font-size: 13px;
    line-height: 1.25;
  }

  .ail-local-actions {
    gap: 7px;
    margin-top: 6px;
  }

  .ail-local-action {
    min-height: 32px;
    padding: 0 11px;
    font-size: 12px;
  }

  .ail-leaflet-popup .leaflet-popup-content {
    width: min(280px, calc(100vw - 48px)) !important;
  }

  .ail-popup-image img {
    height: 86px;
    object-fit: contain;
    background: var(--ail-accent, #e31e24);
  }

  .ail-popup-body {
    padding: 12px;
  }

  .ail-popup-title {
    font-size: 16px;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  .ail-popup-line,
  .ail-popup-hours {
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  .ail-popup-actions {
    gap: 7px;
    margin-top: 9px;
  }

  .ail-popup-action {
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
  }

  .ail-store-locator .leaflet-control-zoom a {
    width: 32px;
    height: 32px;
    line-height: 32px;
  }

  .ail-store-locator .leaflet-top .leaflet-control {
    margin-top: 10px;
  }

  .ail-store-locator .leaflet-left .leaflet-control {
    margin-left: 10px;
  }
}

@media (max-width: 380px) {
  .ail-map-panel,
  .ail-map {
    height: 330px;
    min-height: 330px;
  }

  .ail-locales-list {
    max-height: 218px;
  }

  .ail-local-action {
    padding: 0 10px;
  }
}
