/* Catalog Styles */
:where([class^="ri-"])::before {
    content: "\f3c2";
}

/* Custom scrollbar for search suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 4px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Product card hover effects */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Badge styles */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.product-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: fit-content;
    white-space: nowrap;
}

.badge-promo {
    background-color: #ef4444;
}

.badge-nouveau {
    background-color: #10b981;
}

.badge-stock-limite {
    background-color: #f59e0b;
}

.badge-bestseller {
    background-color: #8b5cf6;
}

.badge-default {
    background-color: #fbbf24;
}

/* Modal styles */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* Pagination styles */
.pagination-button {
    transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

.pagination-button.active {
    background-color: #fbbf24;
    color: white;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Grid layout transitions */
.products-grid {
    transition: all 0.3s ease;
}

/* Filter section styles */
.filter-section {
    border-right: 1px solid #e5e7eb;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #222 #e5e7eb;
    transition: box-shadow 0.2s;
}
.filter-section:hover {
    box-shadow: 0 4px 24px -2px #0002;
}
.filter-section::-webkit-scrollbar {
    width: 8px;
    background: #e5e7eb;
}
.filter-section::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .filter-section {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Price range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 4px;
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #fbbf24;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 4px;
    border-radius: 2px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: #fbbf24;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    background: #111 !important;
    height: 4px;
    border-radius: 2px;
}
input[type="range"]::-moz-range-track {
    background: #111 !important;
    height: 4px;
    border-radius: 2px;
}
input[type="range"]::-ms-fill-lower,
input[type="range"]::-ms-fill-upper {
    background: #111 !important;
}

/* Loading animation */
.loading {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .product-card {
        margin-bottom: 1rem;
    }
    
    .filter-section {
        padding: 1rem;
    }
}

/* --- Filtres modernes et pros --- */
.filter-section-modern {
  background: #fff;
  border-radius: 2rem;
  box-shadow: 0 8px 32px -8px #0002, 0 1.5px 8px -2px #fde04733;
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 340px;
  min-width: 260px;
  margin-bottom: 2rem;
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  border: 1.5px solid #f3f4f6;
  transition: box-shadow 0.2s;
}
.filter-section-modern:hover {
  box-shadow: 0 12px 48px -8px #fde04744, 0 2px 12px -2px #fde04733;
}
.filter-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 0.5rem;
}
.filter-header i {
  color: #fde047;
  font-size: 1.5rem;
}
.reset-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #888;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.reset-btn:hover {
  background: #fef08a;
  color: #222;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid #f3f4f6;
}
.filter-group:last-child {
  border-bottom: none;
}
.filter-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: #222;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.filter-title i {
  color: #fde047;
  font-size: 1.2rem;
}
/* Custom checkbox */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  padding: 0.3rem 0.2rem;
  border-radius: 0.7rem;
  transition: background 0.2s;
}
.filter-checkbox:hover {
  background: #f9fafb;
}
.filter-checkbox input[type="checkbox"] {
  accent-color: #fde047;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.3rem;
  border: 1.5px solid #e5e7eb;
  margin-right: 0.5rem;
  transition: border 0.2s;
}
.filter-checkbox input[type="checkbox"]:focus {
  border-color: #fde047;
  outline: 2px solid #fde04744;
}
/* Slider prix moderne */
.price-slider {
  padding: 0.7rem 0.2rem 0.2rem 0.2rem;
  background: #f9fafb;
  border-radius: 1rem;
  box-shadow: 0 1px 4px -2px #fde04722;
}
.price-slider input[type="range"] {
  width: 100%;
  margin: 0.7rem 0 0.2rem 0;
  background: transparent;
  accent-color: #fde047;
}
.price-slider input[type="range"]::-webkit-slider-thumb {
  background: #fde047;
  border: 2px solid #111;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 0 2px 8px #fde04755;
  transition: background 0.2s;
}
.price-slider input[type="range"]:hover::-webkit-slider-thumb {
  background: #fef08a;
}
.price-slider input[type="range"]::-webkit-slider-runnable-track {
  background: #111;
  height: 5px;
  border-radius: 2.5px;
}
.price-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.98rem;
  color: #222;
  font-weight: 500;
  margin-top: 0.2rem;
}
/* Bouton appliquer */
.apply-btn {
  margin-top: 1.5rem;
  background: #fde047;
  color: #111;
  font-weight: 700;
  font-size: 1.08rem;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.7rem;
  box-shadow: 0 2px 8px -2px #fde04733;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.apply-btn:hover {
  background: #fef08a;
  color: #111;
  box-shadow: 0 4px 16px -2px #fde04755;
  transform: scale(1.04);
}

/* Responsive */
@media (max-width: 900px) {
  .filter-section-modern {
    max-width: 100%;
    min-width: 0;
    padding: 1.5rem 1rem;
    border-radius: 1.2rem;
  }
}
@media (max-width: 600px) {
  .filter-section-modern {
    position: static;
    box-shadow: 0 2px 8px -2px #fde04733;
    border-radius: 1rem;
    padding: 1rem 0.5rem;
    gap: 1.2rem;
  }
  .filter-header {
    font-size: 1.1rem;
  }
  .apply-btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 0.8rem 1.2rem;
  }
}

/* CORRECTIONS POUR ÉCRASER LES STYLES BLEUS DU MAIN.CSS */

/* Correction des boutons de produits - écraser les styles bleus */
.product-card button:hover,
.product-card .hover\:bg-blue-700:hover,
.product-card .bg-primary:hover {
    background: #fbbf24 !important;
    color: #1f2937 !important;
    box-shadow: 0 4px 16px -2px rgba(251, 191, 36, 0.4) !important;
}

/* Correction des liens de navigation */
.nav-link:hover,
.nav-link.active {
    color: #fbbf24 !important;
}

.nav-link::after {
    background: #fbbf24 !important;
}

/* Correction des éléments avec classe primary */
.text-primary {
    color: #fbbf24 !important;
}

.bg-primary {
    background-color: #fbbf24 !important;
}

.bg-primary:hover {
    background-color: #f59e0b !important;
}

.border-primary {
    border-color: #fbbf24 !important;
}

/* Correction des focus et ring */
.focus\:ring-primary:focus {
    --tw-ring-color: rgba(251, 191, 36, 0.5) !important;
}

.focus\:border-primary:focus {
    border-color: #fbbf24 !important;
}

/* Correction des checkboxes et inputs */
input[type="checkbox"]:checked {
    background-color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

input:focus {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2) !important;
}

/* Correction des boutons hover génériques */
button:hover,
.btn:hover {
    background-color: #fbbf24 !important;
    color: #1f2937 !important;
}

/* Correction spécifique pour les boutons du catalogue */
#checkoutBtn:hover {
    background-color: #f59e0b !important;
}

/* Correction des éléments de comparaison */
.compare-btn i.text-yellow-500 {
    color: #fbbf24 !important;
}

/* Correction des sliders modernes */
.price-slider input[type="range"]::-webkit-slider-thumb {
    background: #fbbf24 !important;
    border: 2px solid #111 !important;
}

.price-slider input[type="range"]:hover::-webkit-slider-thumb {
    background: #f59e0b !important;
}

/* Correction des boutons d'application des filtres */
.apply-btn {
    background: #fbbf24 !important;
}

.apply-btn:hover {
    background: #f59e0b !important;
}

/* Correction des icônes et éléments de filtre */
.filter-header i,
.filter-title i {
    color: #fbbf24 !important;
}

.filter-checkbox input[type="checkbox"] {
    accent-color: #fbbf24 !important;
}

.filter-checkbox input[type="checkbox"]:focus {
    border-color: #fbbf24 !important;
    outline: 2px solid rgba(251, 191, 36, 0.3) !important;
}

.reset-btn:hover {
    background: #fef3cd !important;
}

/* Correction des ombres et effets */
.filter-section-modern:hover {
    box-shadow: 0 12px 48px -8px rgba(251, 191, 36, 0.3), 0 2px 12px -2px rgba(251, 191, 36, 0.2) !important;
}

.price-slider {
    box-shadow: 0 1px 4px -2px rgba(251, 191, 36, 0.1) !important;
}

.apply-btn {
    box-shadow: 0 2px 8px -2px rgba(251, 191, 36, 0.2) !important;
}

.apply-btn:hover {
    box-shadow: 0 4px 16px -2px rgba(251, 191, 36, 0.4) !important;
}
/* ===== RESPONSIVE DESIGN (MOBILE-FIRST TAILWIND) =====
   Nous laissons désormais Tailwind gérer la majorité du responsive grâce
   aux classes utilitaires dans le HTML.  Tout excès de styles spécifiques
   < 768 px est supprimé pour éviter les conflits et garantir un rendu
   cohérent sur tous les mobiles.  Ajoutez vos ajustements ponctuels ici
   uniquement si une classe Tailwind ne suffit pas. */
/* Styles pour les très petits écrans (en dessous de 480px) */
@media (max-width: 480px) {
    
    /* --- Top Bar Très Petit --- */
    #top-bar {
        font-size: 0.75rem;
    }

    #top-bar .container > div {
        gap: 0.5rem;
    }

    #top-bar span {
        font-size: 0.75rem;
    }

    /* --- Header Très Petit --- */
    header .h-14 {
        height: 3rem;
    }

    header img {
        height: 1.75rem;
    }

    /* --- Filters Très Petit --- */
    .filter-section-modern {
        padding: 1rem 0.75rem;
        border-radius: 0.75rem;
    }

    .filter-header {
        font-size: 1rem;
    }

    .filter-title {
        font-size: 0.95rem;
    }

    .filter-checkbox {
        font-size: 0.9rem;
    }

    /* --- Product Cards Très Petit --- */
    .product-card img {
        height: 180px;
    }

    /* --- Toolbar Très Petit --- */
    .bg-white.rounded-lg.shadow-sm.border.border-gray-200.p-4.mb-6 {
        padding: 0.75rem;
    }

    .text-sm {
        font-size: 0.8rem;
    }

    /* --- Buttons Très Petit --- */
    button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .apply-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    /* --- Footer Très Petit --- */
    footer .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    footer h3 {
        font-size: 1rem;
    }

    footer .text-sm {
        font-size: 0.8rem;
    }

    footer .text-xs {
        font-size: 0.7rem;
    }
}

/* Styles pour les écrans moyens (tablettes) */
@media (min-width: 769px) and (max-width: 1024px) {
    
    /* --- Layout Tablette --- */
    .filter-section-modern {
        max-width: 280px;
        min-width: 240px;
    }

    /* --- Products Grid Tablette --- */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* --- Toolbar Tablette --- */
    .flex.items-center.justify-between {
        gap: 1rem;
    }
}