.wp-map-country-selector {
  box-sizing: border-box;
  overflow: visible;
}

.wp-map-country-selector * {
  box-sizing: border-box;
}

.wp-map-container {
  max-width: 1250px; /* fallback when no inline style */
  margin: 0 auto;
  overflow: visible;
}

.wp-map-main-layout {
  display: flex;
  gap: var(--wp-map-gap, 1.5rem);
  align-items: stretch;
  min-width: 0;
}

.wp-map-dropdown-column {
  flex: 1 1 25%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 10;
  overflow: visible;
}

.wp-map-dropdown-column:has(.wp-map-custom-dropdown.open) {
  z-index: 9998;
}

.wp-map-map-column {
  flex: 3 1 75%;
  min-width: 0;
}

.wp-map-wrapper {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 470.42 / 234.33;
  min-height: 150px;
  overflow: hidden;
  border-radius: 4px;
}


.wp-map-country-label {
  position: absolute;
  padding: 0.4rem 0.75rem;
  background: #1e3a5f;
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.wp-map-country-label::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e3a5f;
}

.wp-map-country-label.visible {
  opacity: 1;
}

.wp-map-wrapper svg {
  width: 100%;
  height: auto;
  min-width: 0;
  max-width: 100%;
  display: block;
  vertical-align: top;
}

.wp-map-wrapper svg .cls-2,
.wp-map-wrapper svg [class*="cls-2"] {
  fill: #ffffff;
  stroke: #000;
  stroke-width: 0.5px;
  transition: fill 0.2s ease, stroke-width 0.2s ease;
}

.wp-map-wrapper.zoomed svg .cls-2,
.wp-map-wrapper.zoomed svg [class*="cls-2"] {
  stroke-width: 0.25px;
}

.wp-map-wrapper svg .highlighted {
  fill: #1e3a5f !important;
}

.wp-map-content-above {
  margin-bottom: 1rem;
}

.wp-map-content-above p:last-child {
  margin-bottom: 0;
}

.wp-map-dropdown-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Full-width section below dropdown + map - same max-width as map container for alignment */
.wp-map-country-detail {
  width: 100%;
  max-width: var(--wp-map-max-width, 1250px);
  margin: 1.5rem auto 0;
  padding: 1.5rem 0;
  box-sizing: border-box;
}

.wp-map-country-stores {
  max-width: var(--wp-map-stores-container-max-width, none);
  margin-left: auto;
  margin-right: auto;
}

.wp-map-country-detail:empty {
  display: none !important;
}

.wp-map-country-detail:not(:empty),
.wp-map-country-detail.has-content {
  display: block !important;
}

.wp-map-country-description {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #374151;
}

.wp-map-country-description p:first-child {
  margin-top: 0;
}

.wp-map-country-description p:last-child {
  margin-bottom: 0;
}

.wp-map-country-stores ul {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 1099px) {
  .wp-map-country-stores ul {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .wp-map-country-stores ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 499px) {
  .wp-map-country-stores ul {
    grid-template-columns: 1fr;
  }
}

/* Feature view: >1100 = 3 butikker, ≤1099 = 2 butikker, ≤767 = 1 butik */
@media (max-width: 1099px) {
  .wp-map-default-view ul {
    grid-template-columns: repeat(3, 1fr);
  }
  .wp-map-default-view ul li:nth-child(4) {
    display: none;
  }
}

@media (max-width: 767px) {
  .wp-map-default-view ul {
    grid-template-columns: repeat(2, 1fr);
  }
  .wp-map-default-view ul li:nth-child(4),
  .wp-map-default-view ul li:nth-child(3) {
    display: none;
  }
}

.wp-map-country-stores li {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  box-sizing: border-box;
}

.wp-map-country-stores .wp-map-store {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wp-map-country-stores .store-logo-wrap {
  display: flex;
  justify-content: center;
}

.wp-map-country-stores .store-logo {
  max-width: var(--wp-map-store-logo-max-width, 460px);
  max-height: var(--wp-map-store-logo-max-height, 112px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.wp-map-country-stores .store-name {
  margin-top: -10px;
  text-align: center !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  color: #374151;
}

.wp-map-country-stores .wp-map-store-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}

.wp-map-country-stores .wp-map-store-link:hover {
  opacity: 0.8;
}

.wp-map-country-stores .store-logo-wrap .wp-map-store-link {
  display: block;
}

/* Default view (no country selected): intro text + 3 random stores */
.wp-map-default-view .wp-map-default-intro {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: none;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #374151;
}

.wp-map-default-view .wp-map-store .store-country-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #6b7280;
}

.wp-map-dropdown-wrapper label {
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.wp-map-custom-dropdown {
  position: relative;
  width: 100%;
  z-index: 1;
}

.wp-map-custom-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  color: #333;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wp-map-custom-dropdown-trigger:hover {
  border-color: #3b82f6;
}

.wp-map-custom-dropdown.open .wp-map-custom-dropdown-trigger {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.wp-map-custom-dropdown-trigger .placeholder {
  color: #6b7280;
}

.wp-map-custom-dropdown-trigger .chevron {
  margin-left: 0.5rem;
  color: #6b7280;
  transition: transform 0.2s;
}

.wp-map-custom-dropdown.open .wp-map-custom-dropdown-trigger .chevron {
  transform: rotate(180deg);
  color: #3b82f6;
}

.wp-map-custom-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.wp-map-custom-dropdown.open .wp-map-custom-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wp-map-custom-dropdown-option {
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}

.wp-map-custom-dropdown-option:first-child {
  border-radius: 8px 8px 0 0;
}

.wp-map-custom-dropdown-option:last-child {
  border-radius: 0 0 8px 8px;
}

.wp-map-custom-dropdown-option:hover {
  background: #f3f4f6;
}

.wp-map-custom-dropdown-option.selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

@media (min-width: 769px) and (max-width: 999px) {
  .wp-map-dropdown-column {
    flex: 0 0 300px;
    width: 300px;
  }

  .wp-map-map-column {
    flex: 1 1 auto;
    width: auto;
  }
}

@media (max-width: 768px) {
  .wp-map-main-layout {
    flex-direction: column;
  }

  .wp-map-dropdown-column,
  .wp-map-map-column {
    flex: 1 1 100%;
    width: 100%;
  }

  .wp-map-wrapper {
    min-height: 0;
    max-height: 220px !important;
  }

  .wp-map-wrapper svg {
    max-height: 220px;
  }
}
