/* Progress Bar CSS */
/* Inspired by NProgress but customized for Buy2Win theme */

#btw-progress {
  pointer-events: none;
}

#btw-progress .bar {
  background: var(--primary-color);
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform: translateX(-100%);
  transition: transform 0.3s ease-out;
}

/* Subtle glow effect under the bar */
#btw-progress .bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  box-shadow: 0 0 10px var(--primary-color), 0 0 5px var(--primary-color);
  opacity: 0.7;
}

/* Spinner */
#btw-progress .spinner {
  display: block;
  position: fixed;
  z-index: 9999;
  top: 15px;
  right: 15px;
}

#btw-progress .spinner-icon {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  
  border: solid 2px transparent;
  border-top-color: var(--primary-color);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  
  animation: btw-progress-spinner 400ms linear infinite;
}

/* Hide spinner on mobile for cleaner look */
@media (max-width: 576px) {
  #btw-progress .spinner {
    display: none;
  }
}

@keyframes btw-progress-spinner {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* States */
#btw-progress.btw-progress-active .bar {
  transform: translateX(0);
  transition: transform 20s cubic-bezier(0.1, 0.3, 0.1, 1);
}

#btw-progress.btw-progress-inc .bar {
  transition: transform 0.5s ease;
}

#btw-progress.btw-progress-done .bar {
  transform: translateX(0) !important;
  transition: transform 0.2s ease-out;
}

#btw-progress.btw-progress-done.btw-progress-hide {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Loading states for specific components */
.btw-loading-container {
  position: relative;
  min-height: 100px;
}

.btw-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out;
}

.btw-loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.btw-loading-overlay .spinner-border {
  width: 2rem;
  height: 2rem;
  border-width: 0.2rem;
}