/* =====================================================
   SMILE VAN VIP — PRELOADER 
   ===================================================== */

body.is-loading {
  overflow: hidden;
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b1a35;
  pointer-events: all;

  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#preloader::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(22, 124, 233, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 124, 233, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

#preloader::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(22, 124, 233, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 2.4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

.preloader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.preloader-logo-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(22, 124, 233, 0.35);
  animation: orbitSpin 4s linear infinite;
}

.preloader-logo-wrap::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #167ce9;
  border-right-color: rgba(22, 124, 233, 0.4);
  animation: orbitSpin 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

.preloader-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  animation: logoPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(22, 124, 233, 0.45));
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 14px rgba(22,124,233,0.45)); }
  50%       { transform: scale(1.04); filter: drop-shadow(0 0 22px rgba(22,124,233,0.7));  }
}

.preloader-brand {
  text-align: center;
}

.preloader-brand-name {
  display: block;
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 6px;
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards 0.3s;
}

.preloader-brand-sub {
  display: block;
  font-family: 'Sarabun', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards 0.5s;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.preloader-progress {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards 0.6s;
}

.preloader-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.preloader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #167ce9, #5ba8f5, #167ce9);
  background-size: 200% 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
  animation: shimmer 1.8s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.preloader-pct {
  font-family: 'Sarabun', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: center;
  transition: color 0.3s ease;
}

#lang-preloader {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 26, 53, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#lang-preloader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.lang-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.lang-flag-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-flag-wrap::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #167ce9;
  animation: orbitSpin 0.8s linear infinite;
}

.lang-flag {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(22, 124, 233, 0.5);
}

.lang-preloader-text {
  font-family: 'Sarabun', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.lang-dots {
  display: inline-flex;
  gap: 5px;
}

.lang-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #167ce9;
  animation: dotBounce 1s ease-in-out infinite;
}

.lang-dots span:nth-child(2) { animation-delay: 0.15s; }
.lang-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ── Mobile  ── */
@media (max-width: 480px) {
  .preloader-logo-wrap { width: 88px; height: 88px; }
  .preloader-logo      { width: 64px; height: 64px; }
  .preloader-brand-name { font-size: 13px; letter-spacing: 2px; }
  .preloader-progress   { width: 160px; }
}
