/* =====================================================================
   Nobility Glory — Language Selector Styles (Desktop & Mobile)
   Accessible, lightweight, responsive language picker
===================================================================== */

/* ===== DESKTOP LANGUAGE SELECTOR ===== */
.lang-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1001;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark, #000000);
  border: 1px solid var(--border, #e0d8d0);
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  height: 36px;
  box-sizing: border-box;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  background: rgba(0, 0, 0, 0.09);
  border-color: var(--red, #ff0000);
  outline: none;
}

.lang-btn i.fa-globe,
.lang-btn svg.lang-icon,
.lang-btn .lang-icon {
  font-size: 14px;
  width: 15px;
  height: 15px;
  color: var(--red, #ff0000);
  flex-shrink: 0;
}

.lang-btn .lang-current-text {
  font-weight: 600;
  letter-spacing: 0;
}

.lang-btn .lang-arrow,
.lang-btn svg.lang-arrow {
  font-size: 10px;
  width: 11px;
  height: 11px;
  transition: transform 0.2s ease;
  opacity: 0.75;
  flex-shrink: 0;
}

.lang-selector.open .lang-btn .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  background: #ffffff;
  border: 1px solid var(--border, #e0d8d0);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  padding: 5px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1005;
  animation: langDropdownIn 0.18s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes langDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

.lang-selector.open .lang-dropdown {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark, #1a0a0a);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

[dir="rtl"] .lang-option {
  text-align: right;
  flex-direction: row-reverse;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: var(--cream, #f5f0eb);
  color: var(--red, #ff0000);
  outline: none;
}

.lang-option.active {
  background: rgba(255, 0, 0, 0.08);
  color: var(--red, #ff0000);
  font-weight: 700;
}

.lang-option .lang-check,
.lang-option svg.lang-check {
  font-size: 11px;
  width: 13px;
  height: 13px;
  color: var(--red, #ff0000);
  opacity: 0;
  flex-shrink: 0;
}

.lang-option.active .lang-check,
.lang-option.active svg.lang-check {
  opacity: 1;
}

/* ===== MOBILE LANGUAGE PICKER (SEGMENTED CONTROL IN DRAWER) ===== */
/* NEVER show the mobile segmented control on desktop! */
.mobile-lang-picker {
  display: none !important;
}

/* Only display inside mobile navigation drawers when on mobile */
@media (max-width: 768px) {
  .header-nav.active .mobile-lang-picker,
  .mobile-nav.active .mobile-lang-picker,
  .mobile-nav.open .mobile-lang-picker,
  .mobile-nav .mobile-lang-picker {
    display: flex !important;
  }
}

.mobile-lang-picker {
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  margin: 12px 0 6px 0;
  border-top: 1px solid var(--border, #e0d8d0);
  border-bottom: 1px solid var(--border, #e0d8d0);
  width: 100%;
}

.mobile-lang-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-muted, #666666);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-lang-label i,
.mobile-lang-label svg {
  width: 14px;
  height: 14px;
  color: var(--red, #ff0000);
  flex-shrink: 0;
}

.mobile-lang-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.mobile-lang-btn {
  padding: 10px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border, #e0d8d0);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark, #000000);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
}

.mobile-lang-btn:hover,
.mobile-lang-btn:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  outline: none;
}

.mobile-lang-btn.active {
  background: var(--red, #ff0000);
  color: #ffffff;
  border-color: var(--red, #ff0000);
}

/* ===== MOBILE HEADER SIZING RULES (<= 768px) ===== */
@media (max-width: 768px) {
  /* Prevent phone number and CTA from wrapping or crowding mobile header */
  .header-right .header-phone,
  .header-right .header-cta,
  .header-right .btn-header {
    display: none !important;
  }

  .header-right {
    gap: 8px !important;
  }

  .lang-btn {
    height: 32px;
    padding: 4px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .lang-btn i.fa-globe,
  .lang-btn svg.lang-icon {
    width: 13px;
    height: 13px;
  }

  .lang-btn .lang-arrow {
    width: 9px;
    height: 9px;
  }
}
