/**
 * ============================================================
 * GODWIN HOTELS — Internationalization (i18n) CSS
 * ============================================================
 * Clean, luxury styling for Language Switcher, Currency Selector,
 * and Geolocation Suggestion Banner.
 * Guaranteed zero overlap and strict hidden state handling.
 */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --i18n-dark-bg:      #0b1424;
  --i18n-dark-border:  rgba(200, 146, 46, 0.35);
  --i18n-gold:         #d4af37;
  --i18n-gold-hover:   rgba(212, 175, 55, 0.18);
  --i18n-text-white:   #ffffff;
  --i18n-text-muted:   rgba(255, 255, 255, 0.7);
  --i18n-radius:       8px;
  --i18n-shadow:       0 12px 35px rgba(0, 0, 0, 0.5);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ─── Header Controls Wrapper ───────────────────────────────── */
.header-i18n-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  margin-right: 0.5rem;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ─── Currency Switcher (Compact Dropdown) ───────────────────── */
.currency-switcher--compact {
  display: inline-flex;
  align-items: center;
  position: relative;
  vertical-align: middle;
}

.currency-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.currency-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(200, 146, 46, 0.12);
  border: 1px solid rgba(200, 146, 46, 0.35);
  color: #0b1424;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 1.6rem 0.3rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

/* When inside dark top-bar or hero */
.top-bar .currency-select,
.site-header--dark .currency-select {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.currency-select:hover,
.currency-select:focus {
  border-color: var(--i18n-gold);
  outline: none;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

.currency-select option {
  background: #0b1424;
  color: #ffffff;
  padding: 6px;
}

.currency-chevron {
  position: absolute;
  right: 0.55rem;
  pointer-events: none;
  font-size: 0.65rem;
  color: var(--i18n-gold);
}

/* ─── Language Switcher Trigger ─────────────────────────────── */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(200, 146, 46, 0.12);
  border: 1px solid rgba(200, 146, 46, 0.35);
  border-radius: 20px;
  color: #0b1424;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}

.top-bar .lang-switcher__trigger,
.site-header--dark .lang-switcher__trigger {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-switcher__trigger:hover,
.lang-switcher__trigger:focus-visible {
  border-color: var(--i18n-gold);
  outline: none;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

.lang-switcher__flag {
  font-size: 0.95rem;
  line-height: 1;
}

.lang-switcher__current-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lang-switcher__chevron {
  font-size: 0.65rem;
  color: var(--i18n-gold);
  transition: transform 0.2s ease;
}

.lang-switcher.is-open .lang-switcher__chevron,
.lang-switcher__trigger[aria-expanded="true"] .lang-switcher__chevron {
  transform: rotate(180deg);
}

/* ─── Language Switcher Dropdown (STRICT HIDDEN LOGIC) ──────── */
.lang-switcher__dropdown {
  display: none !important;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 999999;
  min-width: 250px;
  background: var(--i18n-dark-bg);
  border: 1px solid var(--i18n-dark-border);
  border-radius: var(--i18n-radius);
  box-shadow: var(--i18n-shadow);
  padding: 0.4rem 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Explicit display when open */
.lang-switcher.is-open > .lang-switcher__dropdown,
.lang-switcher__dropdown.is-open {
  display: block !important;
}

/* Never show when hidden */
.lang-switcher__dropdown[hidden] {
  display: none !important;
}

.lang-switcher__heading {
  padding: 0.5rem 0.85rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--i18n-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.25rem;
}

.lang-switcher__list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-height: 320px;
  overflow-y: auto;
}

.lang-switcher__item {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.lang-switcher__link {
  display: flex !important;
  align-items: center !important;
  gap: 0.55rem !important;
  padding: 0.45rem 0.85rem !important;
  color: var(--i18n-text-white) !important;
  text-decoration: none !important;
  font-size: 0.78rem !important;
  transition: background 0.15s ease !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.lang-switcher__link:hover,
.lang-switcher__link:focus {
  background: var(--i18n-gold-hover) !important;
  color: var(--i18n-gold) !important;
  outline: none !important;
}

.lang-switcher__item--active .lang-switcher__link {
  background: rgba(212, 175, 55, 0.15) !important;
  color: var(--i18n-gold) !important;
  font-weight: 700 !important;
}

.lang-switcher__link .lang-switcher__flag {
  font-size: 1rem;
  flex-shrink: 0;
}

.lang-switcher__link .lang-switcher__native {
  font-weight: 600;
  color: #ffffff;
}

.lang-switcher__link .lang-switcher__label {
  font-size: 0.72rem;
  color: var(--i18n-text-muted);
  margin-left: auto;
}

.lang-switcher__link .lang-switcher__currency {
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--i18n-gold);
  font-weight: 600;
  margin-left: 0.35rem;
}

/* ─── Geolocation Suggestion Banner ──────────────────────────── */
.geo-banner {
  background: linear-gradient(135deg, #0e1726 0%, #17243c 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  color: #ffffff;
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 10001;
  font-size: 0.82rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.geo-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.geo-banner__text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  color: #ffffff;
}

.geo-banner__flag {
  font-size: 1.25rem;
}

.geo-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.geo-banner__btn {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
}

.geo-banner__btn--accept {
  background: var(--i18n-gold);
  color: #000000;
}

.geo-banner__btn--accept:hover {
  background: #e2c159;
}

.geo-banner__btn--decline {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.geo-banner__btn--decline:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ─── Mobile Responsiveness ─────────────────────────────────── */
@media screen and (max-width: 768px) {
  .header-i18n-controls {
    gap: 0.35rem;
    margin-right: 0.35rem;
  }
  .currency-select {
    padding: 0.25rem 1.3rem 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
  .lang-switcher__trigger {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
  }
  .lang-switcher__dropdown {
    right: -20px;
    min-width: 220px;
  }
}
