/**
 * Bahous - Estilos adicionales para componentes dinámicos
 * Estos estilos complementan los de style.css para elementos generados por JS
 *
 * @package Bahous
 * @since 1.0.0
 */

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.bahous-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: var(--bahous-radius-full);
  background: var(--bahous-secondary);
  color: var(--bahous-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--bahous-transition);
  z-index: 999;
  box-shadow: var(--bahous-shadow-md);
}

.bahous-back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bahous-back-to-top:hover {
  background: var(--bahous-secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--bahous-shadow-lg);
}

/* ============================================================
   LOADING STATE
   ============================================================ */
.bahous-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.bahous-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--bahous-white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: bahous-spin 0.6s linear infinite;
}

@keyframes bahous-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   ADDED TO CART FEEDBACK
   ============================================================ */
.bahous-added {
  background: var(--bahous-accent) !important;
}

/* ============================================================
   HEADER SCROLL STATES
   ============================================================ */
.bahous-header--scrolled {
  box-shadow: var(--bahous-shadow-md);
}

.bahous-header--hidden {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
.bahous-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.bahous-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--bahous-primary);
  transition: all var(--bahous-transition-fast);
  border-radius: 2px;
}

.bahous-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.bahous-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.bahous-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .bahous-menu-toggle {
    display: flex;
  }

  .bahous-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bahous-primary);
    z-index: 1000;
    transition: left var(--bahous-transition);
    padding-top: 70px;
    overflow-y: auto;
  }

  .bahous-nav--open {
    left: 0;
  }

  .bahous-nav__list {
    flex-direction: column;
  }

  .bahous-nav__link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .bahous-nav__dropdown {
    position: static;
    display: none;
    box-shadow: none;
    background: var(--bahous-primary-dark);
    border-radius: 0;
  }

  .bahous-nav__item:hover .bahous-nav__dropdown {
    display: block;
  }

  .bahous-nav__dropdown a {
    color: rgba(255, 255, 255, 0.75);
    padding-left: 2rem;
  }

  /* Overlay behind menu */
  .bahous-menu-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

/* ============================================================
   QUANTITY BUTTONS
   ============================================================ */
.bahous-qty-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--bahous-border);
  background: var(--bahous-white);
  color: var(--bahous-text);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bahous-radius-sm);
  transition: all var(--bahous-transition-fast);
}

.bahous-qty-btn:hover {
  background: var(--bahous-bg-light);
  border-color: var(--bahous-secondary);
  color: var(--bahous-secondary);
}

/* ============================================================
   FREE SHIPPING BADGE
   ============================================================ */
.bahous-free-shipping-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E8F5E9;
  color: var(--bahous-accent);
  padding: 6px 12px;
  border-radius: var(--bahous-radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: var(--bahous-space-sm);
}

.bahous-free-shipping-badge svg {
  flex-shrink: 0;
}

/* ============================================================
   CONTINUE SHOPPING LINK
   ============================================================ */
.bahous-continue-shopping {
  margin-top: var(--bahous-space-lg);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes bahous-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bahous-animate-in {
  animation: bahous-fadeInUp 0.6s ease forwards;
}
