/*
 * ========================================
 * LOCAMAIS LOADER - COMPONENT STYLES (v12.1.0 - Fixed Rear Wheel Smoke)
 * ========================================
 * Versão com fumaça corrigida saindo da roda traseira
 */

:root {
  --loader-bg: rgba(0, 0, 0, 0.4);
  --loader-blur: 3px;
  --loader-content-bg: linear-gradient(135deg, #4a5568, #2d3748);
  --loader-content-border: rgba(255, 255, 255, 0.15);
  --loader-text-primary: #ffffff;
  --loader-text-secondary: #e2e8f0;
  --loader-text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  --loader-moto-size: 90px;
  --loader-smoke-color: rgba(160, 160, 160, 0.3);
  --loader-smoke-light: rgba(200, 200, 200, 0.5);
  --loader-z-index: 99999;
}

/* === BASE DO OVERLAY === */
.locamais-custom-loader-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: var(--loader-z-index);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: var(--loader-bg);
  backdrop-filter: blur(var(--loader-blur)); -webkit-backdrop-filter: blur(var(--loader-blur));
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.5s;
}

/* === ELEMENTOS INTERNOS === */
.locamais-loader-animation-stage {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  overflow: hidden;
}

.locamais-loader-content {
  position: relative;
  top: -40px;
  text-align: center;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  background: var(--loader-content-bg);
  padding: 32px 40px;
  border-radius: 12px;
  border: 1px solid var(--loader-content-border);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  max-width: 400px;
  min-width: 300px;
}

.locamais-loader-main-text {
  font-size: 1.25em;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--loader-text-primary);
  text-shadow: var(--loader-text-shadow);
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.locamais-loader-animated-text {
  font-size: 1rem;
  color: var(--loader-text-secondary);
  text-shadow: var(--loader-text-shadow);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.locamais-loader-moto-img {
  width: var(--loader-moto-size);
  height: var(--loader-moto-size);
  object-fit: contain;
  position: absolute;
  top: 50%;
  z-index: 15;
  opacity: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transform: translateY(-50%);
}

/* === SISTEMA DE FUMAÇA DA RODA TRASEIRA (CORRIGIDO) === */
.locamais-loader-smoke-trail {
  position: absolute;
  top: 50%;
  width: 180px;
  height: 100px;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none;
}

/* === FUMAÇA NATURAL E REALISTA === */
.locamais-smoke-puff {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(
    circle,
    var(--loader-smoke-light) 0%,
    var(--loader-smoke-color) 40%,
    rgba(140, 140, 140, 0.15) 70%,
    transparent 100%
  );
  filter: blur(2px);
}

/* === POSICIONAMENTO CORRETO - RODA TRASEIRA === */
/* Assumindo que a moto está virada para a direita, a roda traseira fica à esquerda */
/* Fumaça começando na roda traseira */
.locamais-smoke-puff.puff1 {
  width: 14px; height: 14px;
  bottom: 32px; left: 2px;
  filter: blur(1.5px);
}

.locamais-smoke-puff.puff2 {
  width: 18px; height: 18px;
  bottom: 38px; left: 5px;
  filter: blur(2px);
}

.locamais-smoke-puff.puff3 {
  width: 22px; height: 22px;
  bottom: 30px; left: 8px;
  filter: blur(2.5px);
}

.locamais-smoke-puff.puff4 {
  width: 20px; height: 20px;
  bottom: 42px; left: 1px;
  filter: blur(2.2px);
}

/* Fumaça se espalhando para trás */
.locamais-smoke-puff.puff5 {
  width: 26px; height: 26px;
  bottom: 35px; left: 15px;
  filter: blur(3px);
}

.locamais-smoke-puff.puff6 {
  width: 28px; height: 28px;
  bottom: 40px; left: 25px;
  filter: blur(3.5px);
}

.locamais-smoke-puff.puff7 {
  width: 30px; height: 30px;
  bottom: 28px; left: 35px;
  filter: blur(4px);
}

.locamais-smoke-puff.puff8 {
  width: 32px; height: 32px;
  bottom: 45px; left: 45px;
  filter: blur(4.5px);
}

/* === CONTROLE DE ESTADOS E ANIMAÇÕES === */
.locamais-custom-loader-overlay.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.locamais-custom-loader-overlay.is-active .locamais-loader-content {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition:
    opacity 0.6s 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.locamais-custom-loader-overlay.is-active .locamais-loader-moto-img {
  opacity: 1;
  animation: locamais-moto-drive-in 0.8s 0.1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.locamais-custom-loader-overlay.is-active .locamais-loader-smoke-trail {
  animation: locamais-smoke-trail-move 0.8s 0.1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* === ANIMAÇÕES DA FUMAÇA NATURAL === */
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff1 {
  animation: locamais-rear-smoke-1 1.8s 0.3s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff2 {
  animation: locamais-rear-smoke-2 2.2s 0.5s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff3 {
  animation: locamais-rear-smoke-3 2.6s 0.7s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff4 {
  animation: locamais-rear-smoke-4 2.0s 0.9s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff5 {
  animation: locamais-rear-smoke-5 2.4s 1.1s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff6 {
  animation: locamais-rear-smoke-6 2.8s 1.3s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff7 {
  animation: locamais-rear-smoke-7 2.5s 1.5s ease-out infinite;
}
.locamais-custom-loader-overlay.is-active .locamais-smoke-puff.puff8 {
  animation: locamais-rear-smoke-8 3.0s 1.7s ease-out infinite;
}

.locamais-custom-loader-overlay.is-hiding {
  opacity: 0;
  transition: opacity 0.6s 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 1.1s;
}

.locamais-custom-loader-overlay.is-hiding .locamais-loader-moto-img {
  animation: locamais-moto-drive-out 0.6s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.locamais-custom-loader-overlay.is-hiding .locamais-loader-smoke-trail {
  animation: locamais-smoke-trail-out 0.6s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.locamais-custom-loader-overlay.is-hiding .locamais-loader-content {
  opacity: 0;
  transform: scale(0.95) translateY(-20px);
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.locamais-custom-loader-overlay.is-hiding .locamais-smoke-puff {
  animation: none;
}

/* === KEYFRAMES DA MOTO === */
@keyframes locamais-moto-drive-in {
  from { left: -100px; opacity: 0; }
  to   { left: calc(50% - var(--loader-moto-size) / 2); opacity: 1; }
}

@keyframes locamais-smoke-trail-move {
  from { left: -150px; opacity: 0; }
  to   { left: calc(50% - var(--loader-moto-size) / 2 - 20px); opacity: 1; }
}

@keyframes locamais-moto-drive-out {
  from { left: calc(50% - var(--loader-moto-size) / 2); opacity: 1; }
  to   { left: calc(100% + 50px); opacity: 0; }
}

@keyframes locamais-smoke-trail-out {
  from { left: calc(50% - var(--loader-moto-size) / 2 - 20px); opacity: 1; }
  to   { left: calc(100% + 50px); opacity: 0; }
}

/* === KEYFRAMES PARA FUMAÇA DA RODA TRASEIRA === */
@keyframes locamais-rear-smoke-1 {
  0%   { transform: translateX(0) translateY(0) scale(0.1); opacity: 0; }
  10%  { opacity: 0.7; }
  25%  { transform: translateX(20px) translateY(-8px) scale(0.6); opacity: 0.8; }
  50%  { transform: translateX(45px) translateY(-15px) scale(1.1); opacity: 0.6; }
  75%  { transform: translateX(70px) translateY(-25px) scale(1.6); opacity: 0.3; }
  100% { transform: translateX(95px) translateY(-35px) scale(2.0); opacity: 0; }
}

@keyframes locamais-rear-smoke-2 {
  0%   { transform: translateX(0) translateY(0) scale(0.2); opacity: 0; }
  8%   { opacity: 0.6; }
  22%  { transform: translateX(25px) translateY(-10px) scale(0.7); opacity: 0.7; }
  45%  { transform: translateX(50px) translateY(-18px) scale(1.2); opacity: 0.5; }
  70%  { transform: translateX(75px) translateY(-28px) scale(1.7); opacity: 0.3; }
  100% { transform: translateX(100px) translateY(-40px) scale(2.2); opacity: 0; }
}

@keyframes locamais-rear-smoke-3 {
  0%   { transform: translateX(0) translateY(0) scale(0.15); opacity: 0; }
  12%  { opacity: 0.8; }
  28%  { transform: translateX(30px) translateY(-12px) scale(0.8); opacity: 0.7; }
  52%  { transform: translateX(55px) translateY(-22px) scale(1.3); opacity: 0.4; }
  78%  { transform: translateX(80px) translateY(-32px) scale(1.8); opacity: 0.2; }
  100% { transform: translateX(105px) translateY(-45px) scale(2.3); opacity: 0; }
}

@keyframes locamais-rear-smoke-4 {
  0%   { transform: translateX(0) translateY(0) scale(0.18); opacity: 0; }
  15%  { opacity: 0.7; }
  30%  { transform: translateX(22px) translateY(-9px) scale(0.65); opacity: 0.8; }
  55%  { transform: translateX(48px) translateY(-16px) scale(1.15); opacity: 0.5; }
  80%  { transform: translateX(72px) translateY(-26px) scale(1.65); opacity: 0.2; }
  100% { transform: translateX(90px) translateY(-38px) scale(2.1); opacity: 0; }
}

@keyframes locamais-rear-smoke-5 {
  0%   { transform: translateX(0) translateY(0) scale(0.22); opacity: 0; }
  10%  { opacity: 0.6; }
  26%  { transform: translateX(28px) translateY(-11px) scale(0.75); opacity: 0.7; }
  48%  { transform: translateX(52px) translateY(-20px) scale(1.25); opacity: 0.5; }
  72%  { transform: translateX(78px) translateY(-30px) scale(1.75); opacity: 0.3; }
  100% { transform: translateX(102px) translateY(-42px) scale(2.2); opacity: 0; }
}

@keyframes locamais-rear-smoke-6 {
  0%   { transform: translateX(0) translateY(0) scale(0.25); opacity: 0; }
  8%   { opacity: 0.5; }
  24%  { transform: translateX(32px) translateY(-13px) scale(0.85); opacity: 0.6; }
  46%  { transform: translateX(58px) translateY(-24px) scale(1.35); opacity: 0.4; }
  68%  { transform: translateX(85px) translateY(-35px) scale(1.85); opacity: 0.2; }
  100% { transform: translateX(110px) translateY(-48px) scale(2.4); opacity: 0; }
}

@keyframes locamais-rear-smoke-7 {
  0%   { transform: translateX(0) translateY(0) scale(0.2); opacity: 0; }
  12%  { opacity: 0.7; }
  28%  { transform: translateX(26px) translateY(-10px) scale(0.7); opacity: 0.8; }
  50%  { transform: translateX(50px) translateY(-19px) scale(1.2); opacity: 0.6; }
  74%  { transform: translateX(76px) translateY(-29px) scale(1.7); opacity: 0.3; }
  100% { transform: translateX(98px) translateY(-41px) scale(2.1); opacity: 0; }
}

@keyframes locamais-rear-smoke-8 {
  0%   { transform: translateX(0) translateY(0) scale(0.3); opacity: 0; }
  6%   { opacity: 0.4; }
  20%  { transform: translateX(35px) translateY(-14px) scale(0.9); opacity: 0.5; }
  42%  { transform: translateX(62px) translateY(-26px) scale(1.4); opacity: 0.3; }
  64%  { transform: translateX(88px) translateY(-38px) scale(1.9); opacity: 0.2; }
  100% { transform: translateX(115px) translateY(-52px) scale(2.5); opacity: 0; }
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
  .locamais-loader-content {
    padding: 24px 32px;
    min-width: 280px;
    max-width: 320px;
  }

  .locamais-loader-main-text {
    font-size: 1.1em;
  }

  .locamais-loader-animated-text {
    font-size: 0.9em;
  }

  :root {
    --loader-moto-size: 75px;
  }
}

@media (max-width: 480px) {
  .locamais-loader-content {
    padding: 20px 24px;
    min-width: 260px;
    max-width: 300px;
  }

  .locamais-loader-main-text {
    font-size: 1em;
  }

  .locamais-loader-animated-text {
    font-size: 0.85em;
  }

  :root {
    --loader-moto-size: 65px;
  }
}

/* === MELHORIAS DE ACESSIBILIDADE === */
@media (prefers-reduced-motion: reduce) {
  .locamais-custom-loader-overlay,
  .locamais-loader-content,
  .locamais-loader-moto-img,
  .locamais-loader-smoke-trail {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
  }

  .locamais-smoke-puff {
    animation: none !important;
  }
}
