/* Language Toggle & Thai Font Styles */

/* Import Athiti font for Thai */
@import url('https://fonts.googleapis.com/css2?family=Athiti:wght@300;400;500;600;700&display=swap');

/* ============================================
   SETTINGS GEAR DROPDOWN
   ============================================ */
.settings-container {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 8px;
}

.settings-btn {
  background: transparent;
  border: none;
  color: #0f3058;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: rgba(15, 48, 88, 0.1);
  transform: rotate(30deg);
}

.settings-btn.active {
  background: rgba(15, 48, 88, 0.15);
  transform: rotate(90deg);
}

.settings-btn svg {
  width: 20px;
  height: 20px;
}

/* Portal dropdown - appended to body to avoid overflow clipping */
.settings-dropdown-portal {
  position: fixed;
  top: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 100px;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.95);
  transition: all 0.15s ease;
  pointer-events: none;
}

.settings-dropdown-portal.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.settings-section {
  margin-bottom: 6px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: block;
  font-size: 8px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.settings-options {
  display: flex;
  gap: 3px;
}

.settings-option {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.settings-option:hover {
  border-color: #0f3058;
  background: #f0f4f8;
}

.settings-option.active {
  background: #0f3058;
  border-color: #0f3058;
  color: white;
}

.settings-divider {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}

/* Dark theme for aurora background pages */
body.aurora-bg .settings-btn {
  color: rgba(255, 255, 255, 0.9);
}

body.aurora-bg .settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

body.aurora-bg .settings-btn.active {
  background: rgba(255, 255, 255, 0.2);
}

/* Footer placement for login page */
.footer .settings-container,
.footer-links .settings-container {
  margin-left: 8px;
}

/* Hide old toggles when settings is active */
.settings-container ~ .currency-toggle,
.settings-container ~ .lang-toggle-container {
  display: none !important;
}

/* Mobile responsive settings */
@media (max-width: 768px) {
  .settings-btn {
    padding: 4px;
  }
  
  .settings-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .settings-dropdown-portal {
    min-width: 90px;
    padding: 6px;
  }
  
  .settings-option {
    padding: 3px 5px;
    font-size: 9px;
  }
  
  .settings-label {
    font-size: 7px;
    margin-bottom: 3px;
  }
  
  .settings-divider {
    margin: 5px 0;
  }
}

/* Thai language body class - apply Athiti font */
body.lang-th {
  font-family: 'Athiti', 'Playfair Display', sans-serif !important;
}

body.lang-th h1,
body.lang-th h2,
body.lang-th h3,
body.lang-th h4,
body.lang-th h5,
body.lang-th h6 {
  font-family: 'Athiti', sans-serif !important;
}

body.lang-th p,
body.lang-th span,
body.lang-th a,
body.lang-th button,
body.lang-th input,
body.lang-th textarea,
body.lang-th label,
body.lang-th li {
  font-family: 'Athiti', sans-serif !important;
}

body.lang-th .nav-tab-btn {
  font-family: 'Athiti', sans-serif !important;
}

body.lang-th .welcome-text,
body.lang-th .subtitle-text,
body.lang-th .excitement-tagline {
  font-family: 'Athiti', sans-serif !important;
}

/* Keep script fonts as-is for brand name */
body.lang-th .logo h1,
body.lang-th h1.shiny-text {
  font-family: 'Birthstone', 'Brush Script MT', cursive !important;
}

/* ============================================
   MOBILE RESPONSIVE FIXES FOR THAI LANGUAGE
   ============================================ */

/* Base mobile nav improvements */
@media (max-width: 768px) {
  .top-nav {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .nav-tab-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  
  .lang-toggle-container {
    margin-left: 0.25rem;
    flex-shrink: 0;
  }
  
  .lang-toggle-btn {
    padding: 5px 10px;
    font-size: 11px;
    min-width: 36px;
    flex-shrink: 0;
  }
}

/* Thai language specific mobile adjustments */
@media (max-width: 768px) {
  /* Make nav more compact for Thai */
  body.lang-th .nav-tab-btn {
    padding: 6px 8px !important;
    font-size: 11px !important;
    letter-spacing: -0.3px;
  }
  
  body.lang-th .nav-tabs {
    gap: 2px !important;
  }
  
  /* Shop page specific */
  body.lang-th .currency-toggle {
    margin-left: 0.25rem;
  }
  
  body.lang-th .currency-btn {
    padding: 0.3rem 0.5rem;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  /* Extra small screens - scroll nav horizontally */
  .nav-tabs {
    gap: 2px !important;
  }
  
  .nav-tab-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }
  
  .lang-toggle-btn {
    padding: 4px 8px;
    font-size: 10px;
    min-width: 32px;
  }
  
  .lang-toggle-container {
    margin-left: 2px;
  }
  
  .top-nav {
    padding: 8px 10px !important;
  }
}

/* Thai specific for extra small screens */
@media (max-width: 480px) {
  body.lang-th .nav-tab-btn {
    padding: 5px 6px !important;
    font-size: 10px !important;
  }
  
  body.lang-th .nav-tabs {
    gap: 1px !important;
  }
}

/* Ensure nav doesn't overflow on mobile */
@media (max-width: 600px) {
  .top-nav {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  
  /* Make sure items don't wrap */
  .nav-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Fix hero text overflow on mobile for Thai */
@media (max-width: 768px) {
  body.lang-th .hero-title {
    font-size: clamp(1.8rem, 8vw, 3rem) !important;
    line-height: 1.3 !important;
  }
  
  body.lang-th .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.25rem) !important;
    line-height: 1.5 !important;
  }
  
  body.lang-th .hero-engraving,
  body.lang-th .hero-desc {
    font-size: clamp(0.85rem, 3.5vw, 1rem) !important;
    line-height: 1.6 !important;
  }
  
  body.lang-th .collection-title {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
  }
  
  body.lang-th .collection-description {
    font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
    line-height: 1.6 !important;
  }
}

/* About page mobile fixes for Thai */
@media (max-width: 768px) {
  body.lang-th .section-text-large {
    font-size: clamp(1rem, 4vw, 1.25rem) !important;
    line-height: 1.7 !important;
  }
  
  body.lang-th .section-text {
    font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
    line-height: 1.7 !important;
  }
  
  body.lang-th .philosophy-card h3 {
    font-size: 1.25rem !important;
  }
  
  body.lang-th .philosophy-card p {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
  }
  
  body.lang-th .tagline-main {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
  }
  
  body.lang-th .tagline-sub {
    font-size: clamp(1rem, 4vw, 1.25rem) !important;
  }
}
