@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

:root {
  --s2k-red: #e30613;
  --s2k-black: #0d0d0d;
  --s2k-white: #ffffff;
  --s2k-gray-bg: #f4f4f4;
  --s2k-gray-border: #e0e0e0;
  --s2k-gray-text: #666666;
  --s2k-header-h: 56px;
  --s2k-catalogue-min-h: 70vh;
  --s2k-font: "Open Sans", sans-serif;
  --s2k-font-heading: "chevin-pro", "Open Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--s2k-font);
  font-weight: 400;
  color: var(--s2k-black);
  background: var(--s2k-white);
  -webkit-font-smoothing: antialiased;
}

.s2k-locator {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--s2k-white);
}

/* ── Header ── */
.s2k-header {
  position: relative;
  z-index: 20;
  background: var(--s2k-white);
}

.s2k-header__row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 16px;
}

.s2k-header__track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-height: var(--s2k-header-h);
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.s2k-header[data-mode='expanded'] .s2k-header__track {
  max-height: 12rem;
}

.s2k-header__views {
  display: grid;
  grid-template: 1fr / 1fr;
  position: relative;
  min-height: calc(var(--s2k-header-h) - 16px);
}

.s2k-header__bar,
.s2k-search-panel {
  grid-area: 1 / 1;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.s2k-header:not([data-mode='expanded']) .s2k-search-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-105%);
  opacity: 0;
  pointer-events: none;
}

.s2k-header[data-mode='expanded'] .s2k-header__views {
  min-height: 0;
}

.s2k-header[data-mode='expanded'] .s2k-header__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-105%);
  opacity: 0;
  pointer-events: none;
}

.s2k-header[data-mode='expanded'] .s2k-search-panel {
  position: relative;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.s2k-header__bar {
  display: flex;
  align-items: center;
  min-height: calc(var(--s2k-header-h) - 16px);
  transform: translateY(0);
  opacity: 1;
}

.s2k-header__fullscreen {
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .s2k-header__track,
  .s2k-header__bar,
  .s2k-search-panel {
    transition: none;
  }
}

.s2k-location-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.s2k-location-trigger:focus-visible {
  outline: 2px solid var(--s2k-red);
  outline-offset: 2px;
  border-radius: 4px;
}

.s2k-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.s2k-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.s2k-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--s2k-gray-border);
  border-radius: 50%;
  background: var(--s2k-white);
  cursor: pointer;
  padding: 0;
  color: var(--s2k-black);
  transition: border-color 0.15s, background 0.15s;
}

.s2k-location-trigger .s2k-icon-btn {
  pointer-events: none;
}

.s2k-icon-btn:hover {
  border-color: var(--s2k-black);
}

.s2k-icon-btn:focus-visible {
  outline: 2px solid var(--s2k-red);
  outline-offset: 2px;
}

.s2k-location-trigger:hover .s2k-icon-btn,
.s2k-location-trigger:focus-visible .s2k-icon-btn {
  border-color: var(--s2k-black);
}

.s2k-location-unknown {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.s2k-location-unknown__label {
  font-family: var(--s2k-font);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: none;
}

.s2k-location-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.s2k-location-selected__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.s2k-location-selected__name {
  display: block;
  font-family: var(--s2k-font);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.s2k-location-selected__details {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.s2k-location-selected__address {
  display: block;
  font-size: 12px;
  color: var(--s2k-gray-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.s2k-method-tag {
  display: inline-block;
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
}

.s2k-method-tag[data-method='gps'] { color: #16a34a; }
.s2k-method-tag[data-method='ip'] { color: #d97706; }
.s2k-method-tag[data-method='manual'] { color: #6366f1; }

/* Search panel (expanded header) */
.s2k-search-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(var(--s2k-header-h) - 16px);
  box-sizing: border-box;
}

.s2k-btn-geo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: var(--s2k-red);
  color: var(--s2k-white);
  font-family: var(--s2k-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.s2k-btn-geo:hover {
  background: #c00010;
}

.s2k-btn-geo .s2k-icon {
  flex-shrink: 0;
}

.s2k-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--s2k-black);
  border-radius: 999px;
  background: var(--s2k-white);
  overflow: hidden;
}

.s2k-search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.s2k-search-field input::placeholder {
  color: #aaa;
}

.s2k-search-field__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s2k-black);
  pointer-events: none;
}

/* Loading bar */
.s2k-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 12px;
  font-size: 13px;
  color: var(--s2k-gray-text);
}

.s2k-loading[hidden] {
  display: none !important;
}

.s2k-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #eee;
  border-top-color: var(--s2k-red);
  border-radius: 50%;
  animation: s2k-spin 0.7s linear infinite;
}

@keyframes s2k-spin {
  to { transform: rotate(360deg); }
}

/* Results dropdown */
.s2k-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
  background: var(--s2k-white);
  border: 1px solid var(--s2k-gray-border);
  border-top: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.s2k-results[hidden] {
  display: none !important;
}

.s2k-results__heading {
  margin: 0;
  padding: 10px 16px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--s2k-gray-text);
  border-top: 1px solid var(--s2k-gray-border);
  border-bottom: 1px solid var(--s2k-gray-border);
  background: var(--s2k-gray-bg);
}

.s2k-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: var(--s2k-white);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.1s;
}

.s2k-results-empty {
  margin: 0;
  padding: 16px;
  font-size: 13px;
  color: var(--s2k-gray-text);
  text-align: center;
}

.s2k-result:last-child {
  border-bottom: none;
}

.s2k-result:hover,
.s2k-result.is-active {
  background: #fafafa;
}

.s2k-result__pin {
  flex-shrink: 0;
  color: var(--s2k-red);
}

.s2k-result__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.s2k-result__info strong {
  font-family: var(--s2k-font);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}

.s2k-result__cp {
  font-size: 12px;
  color: var(--s2k-gray-text);
}

.s2k-result__name {
  width: 100%;
  font-size: 12px;
  color: var(--s2k-gray-text);
}

.s2k-result__dist,
.s2k-result__type {
  flex-shrink: 0;
  font-size: 12px;
  color: #999;
}

/* Header mode visibility */
.s2k-header[data-mode='unknown'] .s2k-location-selected {
  display: none;
}

.s2k-header[data-mode='expanded'] .s2k-header__bar .s2k-location-unknown,
.s2k-header[data-mode='expanded'] .s2k-header__bar .s2k-location-selected {
  display: none;
}

.s2k-header[data-mode='selected'] .s2k-location-unknown {
  display: none;
}

.s2k-header[data-mode='selected'] .s2k-location-selected {
  display: flex;
}

/* ── Main content ── */
.s2k-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.s2k-dismiss-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: default;
}

.s2k-dismiss-overlay[hidden] {
  display: none !important;
}

.s2k-locator[data-state='searching'] .s2k-dismiss-overlay:not([hidden]) {
  cursor: pointer;
}

.s2k-placeholder {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--s2k-catalogue-min-h);
  margin: 16px;
  padding: 48px 24px;
  background: var(--s2k-gray-bg);
  overflow: hidden;
}

.s2k-placeholder[hidden],
.s2k-catalogue-wrap[hidden] {
  display: none !important;
}

.s2k-placeholder__design {
  position: absolute;
  top: 0;
  right: 0;
  width: min(232px, 36vw);
  height: auto;
  pointer-events: none;
}

.s2k-placeholder__title {
  position: relative;
  z-index: 1;
  margin: 0 0 24px;
  font-family: var(--s2k-font-heading);
  font-weight: 600;
  font-style: normal;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}

.s2k-placeholder__title em {
  font-family: inherit;
  font-weight: inherit;
  font-style: normal;
  color: var(--s2k-red);
}

.s2k-btn-cta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 48px;
  padding: 0 28px;
  border: none;
  background: var(--s2k-red);
  color: var(--s2k-white);
  font-family: var(--s2k-font);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.s2k-btn-cta:hover {
  background: #c00010;
}

.s2k-btn-cta:active {
  transform: scale(0.98);
}

/* Catalogue iframe */
.s2k-catalogue-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: var(--s2k-catalogue-min-h);
  margin: 0;
  background: var(--s2k-gray-bg);
}

.s2k-catalogue-wrap:fullscreen {
  min-height: 100%;
  background: var(--s2k-white);
}

.s2k-catalogue-frame {
  flex: 1;
  width: 100%;
  min-height: var(--s2k-catalogue-min-h);
  border: none;
  background: var(--s2k-white);
}

.s2k-catalogue-wrap:fullscreen .s2k-catalogue-frame {
  min-height: 100vh;
}

.s2k-attribution {
  flex-shrink: 0;
  padding: 6px 16px 8px;
  border-top: 1px solid var(--s2k-gray-border);
  background: var(--s2k-white);
}

.s2k-attribution[hidden] {
  display: none !important;
}

.s2k-attribution p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--s2k-gray-text);
  text-align: center;
}

.s2k-attribution a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.s2k-attribution a:hover {
  color: var(--s2k-black);
}

/* Mobile */
@media (max-width: 599px) {
  :root {
    --s2k-catalogue-min-h: 60vh;
  }

  .s2k-header__row {
    padding: 8px 12px;
    align-items: flex-start;
  }

  .s2k-header[data-mode='expanded'] .s2k-header__track {
    max-height: 11rem;
  }

  .s2k-search-panel {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 4px;
  }

  .s2k-btn-geo {
    justify-content: center;
  }

  .s2k-placeholder {
    margin: 8px;
    padding: 32px 16px;
  }

  .s2k-placeholder__design {
    width: min(160px, 40vw);
  }
}
