/* ==========================================
   Shop / Boutique Custom Styles
   La Miellerie Belfortaine
   ========================================== */

/* ==========================================
   1. HEADER & NAVIGATION - COULEURS MARRON
   ========================================== */

/* Override du navbar pour couleurs marron */
.miellerie-nav {
  background-color: var(--white-color) !important;
  box-shadow: 0 2px 20px rgba(139, 90, 43, 0.1);
}

/* Texte de navigation en marron */
.miellerie-nav .nav-link {
  color: var(--secondary-color) !important;
  font-weight: 500;
}

.miellerie-nav .nav-link:hover,
.miellerie-nav .nav-link.active {
  color: var(--primary-color) !important;
}

.miellerie-nav .nav-link .text {
  color: inherit !important;
}

/* Ligne de hover */
.miellerie-nav.hover-line-left .nav-link::before {
  background-color: var(--primary-color) !important;
}

/* Toggler mobile en marron */
.miellerie-nav .navbar-toggler-icon .line {
  background-color: var(--secondary-color) !important;
}

/* Navbar Action Items - Icones et boutons du header */
.navbar-action-items {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Icones de navigation (compte, panier) en marron */
.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  color: var(--secondary-color) !important;
  transition: all 0.3s ease;
  position: relative;
}

.nav-icon-link:hover {
  color: var(--primary-color) !important;
  transform: scale(1.1);
}

/* Badge du panier */
.nav-cart-link {
  position: relative;
}

.nav-cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  background: var(--primary-color);
  color: var(--white-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  animation: cartBadgePulse 2s infinite;
}

@keyframes cartBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Bouton Boutique dans le header - texte blanc sur fond marron */
.navbar-action-items .button.small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background-color: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
}

.navbar-action-items .button.small:hover {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 160, 23, 0.3);
}

.navbar-action-items .button .button-text,
.navbar-action-items .button .button-icon {
  color: var(--white-color) !important;
}

/* ==========================================
   2. MEGAMENU STYLES
   ========================================== */

/* Titre des colonnes du megamenu */
.megamenu-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--secondary-color);
  letter-spacing: 0.5px;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-15-color);
}

/* CTA Image dans le megamenu */
.megamenu-cta {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.megamenu-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.megamenu-cta img {
  transition: transform 0.4s ease;
}

.megamenu-cta:hover img {
  transform: scale(1.1);
}

.megamenu-cta-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(139, 90, 43, 0.9), transparent);
  display: flex;
  flex-direction: column;
}

/* Liens du megamenu en marron */
.megamenu .nav-link {
  padding: 0.4rem 0;
  color: var(--secondary-color) !important;
  transition: all 0.2s ease;
}

.megamenu .nav-link:hover {
  color: var(--primary-color) !important;
  padding-left: 0.5rem;
}

/* ==========================================
   3. PRODUCT CARDS avec micro-interactions
   ========================================== */

.product-card {
  position: relative;
  padding: 1rem;
  background: var(--white-color);
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--tertiary-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(139, 90, 43, 0.2);
}

.product-card .image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  display: block;
}

/* Taille fixe pour les images produits */
.product-card .image-wrapper.product-image-fixed {
  height: 250px;
  aspect-ratio: unset;
}

.product-card .image-wrapper img,
.product-card .image-wrapper .image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

/* Placeholder pour produits sans image */
.product-placeholder {
  background: linear-gradient(135deg, #D4A017, #8B6914);
  min-height: 250px;
  height: 100%;
}

.product-card:hover .image-wrapper img {
  transform: scale(1.08);
}

/* Product Badge */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--white-color);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-badge.primary { background: var(--primary-color); }
.product-badge.secondary { background: var(--secondary-color); }
.product-badge.tertiary { background: var(--tertiary-color); color: var(--secondary-color); }
.product-badge.accent { background: var(--accent-color); }

/* Price Styling */
.price-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.price {
  font-weight: 700;
  font-size: 1.25rem;
}

.price.old-price {
  text-decoration: line-through;
  opacity: 0.5;
  font-size: 1rem;
}

/* Add to Cart Button - texte blanc sur fond marron/or */
.add-to-cart {
  width: 100%;
  justify-content: center;
  background-color: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
  transition: all 0.3s ease;
}

.add-to-cart .button-text,
.add-to-cart .button-icon {
  color: var(--white-color) !important;
}

.add-to-cart:hover {
  transform: scale(1.03);
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 5px 20px rgba(212, 160, 23, 0.4);
}

.add-to-cart:hover .button-text,
.add-to-cart:hover .button-icon {
  color: var(--white-color) !important;
}

/* Quick View on Hover */
.product-card .quick-view {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.product-card:hover .quick-view {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================
   4. CATEGORY STYLES
   ========================================== */

/* Category Card */
.category-card {
  text-align: center;
  transition: all 0.3s ease;
}

.category-card:hover {
  transform: translateY(-8px);
}

.category-image-wrapper {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(212, 160, 23, 0.2);
  transition: all 0.4s ease;
  border: 3px solid transparent;
}

.category-card:hover .category-image-wrapper {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 10px 35px rgba(212, 160, 23, 0.35);
  border-color: var(--primary-color);
}

.category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s ease;
}

.category-card:hover .category-image {
  transform: scale(1.1);
}

/* Category Filter Tabs */
.shuffle .horizontal-tab .nav-tabs {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.shuffle .horizontal-tab .nav-link {
  border-radius: 25px;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
}

/* ==========================================
   5. CART SIDEBAR & COMPONENTS
   ========================================== */

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--white-color);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: right 0.3s ease;
  padding: 2rem;
  overflow-y: auto;
}

.cart-sidebar.open { right: 0; }

.cart-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-25-color);
  margin-bottom: 1rem;
}

.cart-sidebar-title {
  margin: 0;
  font-weight: 700;
  color: var(--secondary-color);
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-50-color);
  cursor: pointer;
  transition: color 0.2s ease;
}

.cart-close:hover { color: var(--secondary-color); }

/* Cart Item */
.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-15-color);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-item-details { flex: 1; }
.cart-item-title { font-weight: 600; color: var(--secondary-color); }
.cart-item-price { color: var(--primary-color); font-weight: 700; }

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cart-item-quantity button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-25-color);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-item-quantity button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white-color);
}

.cart-item-remove {
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--gray-50-color);
  cursor: pointer;
  transition: color 0.2s ease;
}

.cart-item-remove:hover { color: #dc3545; }

/* Cart Total */
.cart-total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--primary-color);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cart-total-label { color: var(--gray-75-color); }
.cart-total-value { font-weight: 700; color: var(--secondary-color); }
.cart-total-value.final { font-size: 1.5rem; color: var(--primary-color); }

.checkout-btn {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  background-color: var(--secondary-color) !important;
}

.checkout-btn .button-text {
  color: var(--white-color) !important;
}

/* Empty Cart */
.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.cart-empty-icon {
  font-size: 4rem;
  color: var(--gray-25-color);
  margin-bottom: 1rem;
}

.cart-empty-text { color: var(--gray-50-color); }

/* Cart Badge Legacy */
.cart-count, .cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white-color);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================
   6. ANIMATIONS & MICRO-INTERACTIONS
   ========================================== */

@keyframes addToCartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.add-to-cart.added {
  animation: addToCartPulse 0.3s ease;
  background: var(--accent-color) !important;
}

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Ripple effect for buttons */
.button-ripple {
  position: relative;
  overflow: hidden;
}

.button-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.button-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Toast notification */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  background: var(--secondary-color);
  color: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification .toast-icon {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

/* ==========================================
   7. TESTIMONIALS SECTION
   ========================================== */

.testimonials-section {
  background: linear-gradient(135deg, #FDF8F0 0%, #FAF3E8 100%);
  position: relative;
  overflow: hidden;
}

.testimonials-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4A017' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  opacity: 0.5;
}

.testimonial-card {
  background: var(--white-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(139, 90, 43, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(139, 90, 43, 0.15);
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 4rem;
  color: var(--primary-color);
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-text {
  font-style: italic;
  color: var(--gray-color);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.testimonial-name {
  font-weight: 700;
  color: var(--secondary-color);
  margin: 0;
}

.testimonial-location {
  font-size: 0.85rem;
  color: var(--gray-50-color);
  margin: 0;
}

.testimonial-stars {
  color: var(--primary-color);
  margin-top: 0.25rem;
}

/* ==========================================
   8. LAZY LOADING & SHIMMER CONFIGURABLE
   ========================================== */

/* Background neutre par défaut pour les images lazy */
img[loading="lazy"] {
  background-color: #f5f5f5;
}

/* Animation Shimmer - Activée via classe sur le body ou section */
@keyframes shimmer-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Variantes de couleur shimmer (configurables via admin) */
:root {
  --shimmer-light: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  --shimmer-gold: linear-gradient(90deg, #f5f0e6 25%, #e8d9b5 50%, #f5f0e6 75%);
  --shimmer-white: linear-gradient(90deg, #ffffff 25%, #f0f0f0 50%, #ffffff 75%);
}

/* Shimmer activé globalement via body.shimmer-enabled */
body.shimmer-enabled img[loading="lazy"] {
  background: var(--shimmer-bg, var(--shimmer-light));
  background-size: 200% 100%;
  animation: shimmer-loading var(--shimmer-duration, 1.5s) infinite;
}

/* Shimmer par section - Classes spécifiques (toutes les images) */
.shimmer-hero img,
.shimmer-products img,
.shimmer-gallery img,
.shimmer-cards img,
.shimmer-team img,
.shimmer-testimonials img,
.shimmer-features img,
.shimmer-history img,
.shimmer-ruchers img,
.shimmer-blog img,
.shimmer-footer img {
  background: var(--shimmer-bg, var(--shimmer-light));
  background-size: 200% 100%;
  animation: shimmer-loading var(--shimmer-duration, 1.5s) infinite;
}

/* Désactiver shimmer quand l'image est chargée */
body.shimmer-enabled img.loaded,
.shimmer-hero img.loaded,
.shimmer-products img.loaded,
.shimmer-gallery img.loaded,
.shimmer-cards img.loaded,
.shimmer-team img.loaded,
.shimmer-testimonials img.loaded,
.shimmer-features img.loaded,
.shimmer-history img.loaded,
.shimmer-ruchers img.loaded,
.shimmer-blog img.loaded,
.shimmer-footer img.loaded {
  animation: none;
  background: none;
}

/* ==========================================
   9. SLIDE IMAGES (Index)
   ========================================== */

/* Images dans les slides */
.swiper-slide .image-wrapper img {
  box-shadow: 0 20px 60px rgba(139, 90, 43, 0.25);
}

/* ==========================================
   10. CATEGORY FILTER TRANSITIONS
   ========================================== */

/* Transitions fluides pour filtres */
.filter-container {
  transition: all 0.4s ease;
}

.filter-item {
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.filter-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.filter-item.visible {
  opacity: 1;
  transform: scale(1);
}

/* Tabs de filtrage avec animation */
.horizontal-tab .nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.horizontal-tab .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.horizontal-tab .nav-link.active::after,
.horizontal-tab .nav-link:hover::after {
  width: 80%;
}

/* ==========================================
   11. RESPONSIVE STYLES
   ========================================== */

@media (max-width: 991px) {
  /* Header actions en mobile */
  .navbar-action-items {
    flex-direction: row;
    justify-content: center;
    padding: 1rem 0;
    border-top: 1px solid var(--gray-15-color);
    margin-top: 1rem;
    width: 100%;
  }

  .navbar-action-items .nav-item {
    margin: 0 0.5rem !important;
  }

  .navbar-action-items .button.small {
    padding: 0.6rem 1.2rem;
  }

  /* Texte menu mobile en marron */
  .miellerie-nav .nav-link {
    color: var(--secondary-color) !important;
  }

  /* Testimonials */
  .testimonial-card {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .product-card {
    padding: 0.75rem;
  }

  .shuffle .horizontal-tab .nav-link {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  /* Megamenu en mobile */
  .megamenu-cta {
    margin-top: 1rem;
  }

  .testimonial-card {
    padding: 1.5rem;
  }
}

/* ==========================================
   12. UTILITY CLASSES
   ========================================== */

/* Shuffle container */
.shuffle-container { margin-top: 1rem; }
.shuffle-item { margin-bottom: 2rem; }

/* Category banner in boutique */
.category-banner {
  position: relative;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.category-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-banner .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.6), rgba(0,0,0,0.2));
}

.category-banner .content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
}

.category-banner h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

/* Boutons globaux - texte blanc sur fond coloré */
.button.filled .button-text,
.button.filled .button-icon {
  color: var(--white-color) !important;
}

/* Hover states pour tous les boutons */
.button.filled:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
