/**
 * CORRECTIONS LAYOUT & UX
 * Fixes pour header superposition, notifications, cart badge
 */

/* ===========================================
   1. FIX HEADER SUPERPOSITION
   =========================================== */

/* Compense la hauteur du header sticky */
body {
  padding-top: 0 !important;
}

.template-index main#main-content,
main[role="main"] {
  padding-top: 0;
}

/* Assure que le hero ne se superpose pas au header */
.hero-section-breslev {
  margin-top: 0;
  padding-top: 4rem;
}

/* ===========================================
   2. FIX NOTIFICATION "AJOUT AU PANIER"
   =========================================== */

.cart-notification {
  position: fixed;
  top: 90px; /* Juste en dessous du header */
  right: -400px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 1.25rem 1.75rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
  z-index: 9999;
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  min-width: 320px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.cart-notification.show {
  right: 20px;
  animation: slideInBounce 0.5s ease-out;
}

@keyframes slideInBounce {
  0% {
    right: -400px;
    opacity: 0;
  }
  60% {
    right: 30px;
    opacity: 1;
  }
  80% {
    right: 15px;
  }
  100% {
    right: 20px;
  }
}

.cart-notification-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-notification-content i,
.cart-notification-content .icon {
  color: white;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.cart-notification-text {
  flex: 1;
}

.cart-notification-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.cart-notification-text span {
  font-size: 0.875rem;
  opacity: 0.95;
}

/* ===========================================
   3. FIX CART BADGE (COMPTEUR PANIER)
   =========================================== */

.cart-count,
.cart-badge {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  min-width: 22px !important;
  height: 22px !important;
  padding: 0 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  color: white !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 11px !important;
  border: 2px solid white !important;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4) !important;
  line-height: 1 !important;
  animation: cartBadgePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cartBadgePop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Assure que le bouton panier est positionné relativement */
.cart-btn,
.header-icon-btn.cart-btn {
  position: relative !important;
}

/* ===========================================
   4. RESPONSIVE MOBILE - FIXES
   =========================================== */

@media (max-width: 768px) {
  /* Header mobile spacing */
  .hero-section-breslev {
    padding-top: 2rem;
  }

  /* Notification mobile */
  .cart-notification {
    top: 70px;
    right: -100%;
    min-width: 280px;
    max-width: calc(100% - 32px);
    left: auto;
  }

  .cart-notification.show {
    right: 16px;
  }

  .cart-notification-content {
    gap: 0.75rem;
  }

  .cart-notification-content i,
  .cart-notification-content .icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
  }

  /* Cart badge mobile */
  .cart-count,
  .cart-badge {
    min-width: 20px !important;
    height: 20px !important;
    font-size: 0.7rem !important;
    top: -4px !important;
    right: -4px !important;
  }

  /* Menu mobile z-index */
  .mobile-menu {
    z-index: 9998;
  }

  /* Mini cart mobile */
  .mini-cart {
    z-index: 9997;
  }
}

@media (max-width: 640px) {
  .cart-notification {
    top: 60px;
    padding: 1rem 1.25rem;
  }

  .cart-notification-text strong {
    font-size: 0.95rem;
  }

  .cart-notification-text span {
    font-size: 0.8rem;
  }
}

/* ===========================================
   5. AMÉLIORATIONS UX GLOBALES
   =========================================== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Compense le header sticky */
}

/* Focus visible pour accessibilité */
*:focus-visible {
  outline: 2px solid #d4af37;
  outline-offset: 2px;
}

/* Transitions fluides */
.btn,
button,
a {
  transition: all 0.3s ease;
}

/* Hover states améliorés */
.btn:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active,
button:active {
  transform: translateY(0);
}

/* Loading states */
.btn.loading,
button.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.loading::after,
button.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
}

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

/* ===========================================
   6. PRINT STYLES (BONUS)
   =========================================== */

@media print {
  .header-main,
  .mini-cart,
  .cart-notification,
  .mobile-menu,
  .footer-main {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }

  * {
    background: white !important;
    color: black !important;
  }
}
