/* ============================================
   LES GLOUTONNES SEARCH - Styles CSS
   ============================================ */

/* ========== VARIABLES CSS ========== */
:root {
  --primary-color: #6b21a8;
  --primary-dark: #581c87;
  --primary-light: #9333ea;
  --secondary-color: #10b981;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --transition: all 0.3s ease;
}

/* ========== DARK MODE ========== */
.dark-mode {
  --text-color: #f9fafb;
  --text-light: #d1d5db;
  --bg-color: #111827;
  --bg-light: #1f2937;
  --border-color: #374151;
}

.dark-mode body {
  background: linear-gradient(to bottom, #4c1d95 0%, #ea580c 50%, #4c1d95 100%);
  color: var(--text-color);
}

/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(to bottom, #6b21a8 0%, #f97316 50%, #6b21a8 100%);
  background-attachment: fixed;
  background-size: 100% 200%;
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2em 1em;
  width: 100%;
}

/* ========== HEADER ========== */
header {
  text-align: center;
  color: white;
  padding: 2em 1em;
  margin-bottom: 2em;
}

.logo {
  max-width: 500px;
  height: auto;
  margin-bottom: 1em;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.subtitle {
  font-size: 1.1em;
  opacity: 0.95;
  margin-top: 0.5em;
  line-height: 1.5;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-bottom: 2em;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.75em 1.5em;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========== SEARCH SECTION ========== */
.search-section {
  background: white;
  padding: 2em;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2em;
}

.dark-mode .search-section {
  background: var(--bg-light);
  color: var(--text-color);
}

.search-box {
  display: flex;
  gap: 1em;
  margin-bottom: 1.5em;
  flex-wrap: wrap;
}

.search-box input {
  flex: 1;
  min-width: 250px;
  padding: 0.75em 1em;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1em;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.1);
}

.dark-mode .search-box input {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--border-color);
}

button {
  padding: 0.75em 1.5em;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

button.secondary {
  background: var(--text-light);
}

button.secondary:hover {
  background: #4b5563;
}

button.small {
  padding: 0.5em 1em;
  font-size: 0.9em;
}

/* ========== FILTERS ========== */
.filter-toggle {
  width: 100%;
  padding: 1em;
  background: white;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius);
  font-size: 1em;
  font-weight: 700;
  color: var(--primary-color);
  cursor: pointer;
  margin-bottom: 1em;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.filter-toggle:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dark-mode .filter-toggle {
  background: var(--bg-light);
  color: var(--text-color);
  border-color: var(--primary-light);
}

.dark-mode .filter-toggle:hover {
  background: var(--primary-light);
  color: white;
}

.genres-panel,
.filters-panel {
  background: var(--bg-light);
  padding: 1.5em;
  border-radius: var(--radius);
  margin-bottom: 1em;
  transition: var(--transition);
  overflow: hidden;
}

.genres-panel.collapsed,
.filters-panel.collapsed {
  max-height: 0;
  padding: 0 1.5em;
  margin-bottom: 0;
  border: none;
}

.dark-mode .genres-panel,
.dark-mode .filters-panel {
  background: var(--bg-color);
}

.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em;
}

.genre-pill {
  padding: 0.5em 1em;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: var(--transition);
}

.genre-pill:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.genre-pill.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.dark-mode .genre-pill {
  background: var(--bg-light);
  color: var(--text-color);
  border-color: var(--border-color);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1em;
}

.filters select,
.filters input {
  padding: 0.75em;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.95em;
  transition: var(--transition);
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.dark-mode .filters select,
.dark-mode .filters input {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--border-color);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.range-inputs input {
  flex: 1;
}

/* Responsive - Mobile pour les champs prix */
@media (max-width: 768px) {
  .range-inputs {
    flex-direction: column;
    gap: 0.5em;
    align-items: stretch;
  }
  
  .range-inputs span {
    display: none;
  }
  
  .range-inputs .price-input {
    width: 100%;
    max-width: 100%;
    flex: none;
  }
}

/* ========== VIEW TOGGLE ========== */
.view-toggle {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 1.5em;
  background: white;
  padding: 1em;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dark-mode .view-toggle {
  background: var(--bg-light);
}

.view-toggle span {
  font-weight: 600;
  color: var(--text-color);
}

.view-btn {
  padding: 0.5em 1em;
  background: var(--bg-light);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9em;
  cursor: pointer;
  transition: var(--transition);
}

.view-btn:hover {
  background: var(--border-color);
}

.view-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ========== RESULTS ========== */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5em;
  margin-bottom: 2em;
}

.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.dark-mode .product-card {
  background: var(--bg-light);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-light);
}

.product-info {
  padding: 1em;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 0.5em;
  color: var(--text-color);
  line-height: 1.3;
}

.product-source {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.9em;
  color: var(--text-light);
  margin-bottom: 0.75em;
}

.source-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.product-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75em;
}

.product-price {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary-color);
}

.price-badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 0.5em;
}

.price-badge.baisse {
  background: #dcfce7;
  color: #166534;
}

.price-badge.hausse {
  background: #fee2e2;
  color: #991b1b;
}

.price-badge.stable {
  background: #f3f4f6;
  color: #374151;
}

.price-badge.nouveau {
  background: #dbeafe;
  color: #1e40af;
}

.stock-badge {
  padding: 0.25em 0.75em;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.stock-badge.stock-in {
  background: #dcfce7;
  color: #166534;
}

.stock-badge.stock-out {
  background: #fee2e2;
  color: #991b1b;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 0.75em;
}

.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
}

.badge-exclusive {
  background: #fef3c7;
  color: #92400e;
}

.badge-quality {
  background: #dbeafe;
  color: #1e40af;
}

.badge-type {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-pro {
  background: #fce7f3;
  color: #9f1239;
}

.product-actions {
  display: flex;
  gap: 0.5em;
  margin-top: auto;
  padding-top: 0.75em;
  border-top: 1px solid var(--border-color);
}

.btn-link {
  flex: 1;
  padding: 0.5em 1em;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius);
  font-size: 0.9em;
  font-weight: 600;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-link:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-chart,
.btn-alert {
  padding: 0.5em;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1em;
}

.btn-chart:hover,
.btn-alert:hover {
  background: var(--border-color);
}

.dark-mode .btn-chart,
.dark-mode .btn-alert {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ========== TABLE VIEW ========== */
/* ========== TABLE VIEW ========== */
.results-table,
.table-container {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2em;
}

.dark-mode .results-table,
.dark-mode .table-container {
  background: var(--bg-light);
}

.results-table table,
.table-container table,
.products-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
}

.dark-mode .results-table table,
.dark-mode .table-container table,
.dark-mode .products-table {
  background: var(--bg-light);
  color: var(--text-color);
}

.results-table thead,
.table-container thead,
.products-table thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.results-table th,
.table-container th,
.products-table th {
  padding: 1.25em 1em;
  text-align: left;
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.results-table th:first-child,
.table-container th:first-child,
.products-table th:first-child {
  padding-left: 1.5em;
}

.results-table th:last-child,
.table-container th:last-child,
.products-table th:last-child {
  padding-right: 1.5em;
}

.results-table td,
.table-container td,
.products-table td {
  padding: 1.25em 1em;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  background: white;
  vertical-align: middle;
}

.results-table td:first-child,
.table-container td:first-child,
.products-table td:first-child {
  padding-left: 1.5em;
}

.results-table td:last-child,
.table-container td:last-child,
.products-table td:last-child {
  padding-right: 1.5em;
}

.dark-mode .results-table td,
.dark-mode .table-container td,
.dark-mode .products-table td {
  color: var(--text-color);
  border-bottom-color: var(--border-color);
  background: var(--bg-light);
}

.results-table tbody tr,
.table-container tbody tr,
.products-table tbody tr {
  transition: var(--transition);
}

.results-table tbody tr:last-child td,
.table-container tbody tr:last-child td,
.products-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tbody tr:hover,
.table-container tbody tr:hover,
.products-table tbody tr:hover {
  background: rgba(107, 33, 168, 0.05);
  transform: scale(1.01);
}

.dark-mode .results-table tbody tr:hover,
.dark-mode .table-container tbody tr:hover,
.dark-mode .products-table tbody tr:hover {
  background: rgba(147, 51, 234, 0.1);
}

.table-name {
  font-weight: 600;
  color: var(--text-color);
}

.table-category {
  color: var(--primary-color);
  font-weight: 500;
}

.dark-mode .table-category {
  color: var(--primary-light);
}

.table-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1em;
}

.table-stock {
  padding: 0.25em 0.75em;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.table-stock.in-stock {
  background: #dcfce7;
  color: #166534;
}

.table-stock.out-of-stock {
  background: #fee2e2;
  color: #991b1b;
}

.table-details-actions {
  display: flex;
  gap: 0.5em;
}

.table-btn {
  padding: 0.5em 1em;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.table-btn.primary {
  background: var(--primary-color);
  color: white;
}

.table-btn.primary:hover {
  background: var(--primary-dark);
}

.table-btn.icon {
  padding: 0.5em;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
}

.table-btn.icon:hover {
  background: var(--border-color);
}

.dark-mode .table-btn.icon {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ========== MODAL ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
  padding: 2em 1em;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  padding: 2em;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.dark-mode .modal-content {
  background: var(--bg-light);
  color: var(--text-color);
}

.modal-close {
  position: absolute;
  top: 1em;
  right: 1em;
  background: none;
  border: none;
  font-size: 2em;
  cursor: pointer;
  color: var(--text-light);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--text-color);
}

.dark-mode .modal-close:hover {
  background: var(--bg-color);
}

.price-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1em;
  margin-bottom: 2em;
}

.price-stat {
  text-align: center;
  padding: 1em;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.dark-mode .price-stat {
  background: var(--bg-color);
}

.price-stat-label {
  font-size: 0.85em;
  color: var(--text-light);
  margin-bottom: 0.5em;
}

.price-stat-value {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary-color);
}

.chart-container {
  margin-top: 2em;
  position: relative;
  height: 400px;
}

/* ========== ALERT FORM ========== */
.alert-form {
  margin-top: 1em;
}

.alert-form h3 {
  margin-bottom: 0.5em;
  color: var(--text-color);
}

.form-group {
  margin-bottom: 1.5em;
}

.form-group label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 0.75em;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1em;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.dark-mode .form-group input {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--border-color);
}

/* ========== TENDANCES ========== */
.tendances-section {
  background: white;
  padding: 2em;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dark-mode .tendances-section {
  background: var(--bg-light);
}

.tendances-section h2 {
  margin-bottom: 1.5em;
  color: var(--text-color);
}

.tendances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
}

.tendance-section h3 {
  margin-bottom: 1em;
  color: var(--text-color);
}

.tendance-item {
  padding: 1em;
  background: var(--bg-light);
  border-radius: var(--radius);
  margin-bottom: 0.75em;
  display: flex;
  gap: 1em;
  align-items: flex-start;
  transition: var(--transition);
}

.tendance-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dark-mode .tendance-item {
  background: var(--bg-color);
}

.tendance-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.tendance-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.tendance-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95em;
  line-height: 1.3;
  margin-bottom: 0.25em;
}

.tendance-price {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0.25em 0;
}

.tendance-change {
  font-weight: 700;
  font-size: 0.9em;
  margin-top: 0.25em;
}

.tendance-change.positive {
  color: #166534;
}

.tendance-change.negative {
  color: #991b1b;
}

.tendance-variation {
  font-weight: 700;
}

.tendance-variation.positive {
  color: #166534;
}

.tendance-variation.negative {
  color: #991b1b;
}

/* ========== STATS ========== */
.stats-section {
  background: white;
  padding: 2em;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dark-mode .stats-section {
  background: var(--bg-light);
}

.stats-section h2 {
  margin-bottom: 1.5em;
  color: var(--text-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5em;
}

.stat-card {
  background: var(--bg-light);
  padding: 1.5em;
  border-radius: var(--radius);
  text-align: center;
}

.dark-mode .stat-card {
  background: var(--bg-color);
}

.stat-card-label {
  font-size: 0.9em;
  color: var(--text-light);
  margin-bottom: 0.5em;
}

.stat-card-value {
  font-size: 2em;
  font-weight: 700;
  color: var(--primary-color);
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 2em;
  right: 2em;
  background: var(--text-color);
  color: white;
  padding: 1em 1.5em;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 2000;
  max-width: 400px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--secondary-color);
}

.toast.error {
  background: #ef4444;
}

/* ========== LOADING & NO RESULTS ========== */
.loading {
  text-align: center;
  padding: 3em;
  color: var(--text-light);
}

.spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1em;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.no-results {
  text-align: center;
  padding: 3em;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dark-mode .no-results {
  background: var(--bg-light);
}

.no-results h3 {
  margin-bottom: 0.5em;
  color: var(--text-color);
}

.no-results p {
  color: var(--text-light);
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5em;
  margin-top: 2em;
  flex-wrap: wrap;
}

.pagination button {
  padding: 0.5em 1em;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .page-info {
  padding: 0.5em 1em;
  color: var(--text-color);
  font-weight: 600;
}

.dark-mode .pagination button {
  background: var(--bg-light);
  color: var(--text-color);
  border-color: var(--border-color);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .container {
    padding: 1em 0.75em;
  }

  header {
    padding: 1.5em 0.75em;
    margin-bottom: 1.5em;
  }

  .logo {
    max-width: 100%;
    width: 100%;
    max-width: 400px;
  }

  .subtitle {
    font-size: 0.95em;
    padding: 0 0.5em;
  }

  .tabs {
    gap: 0.5em;
    margin-bottom: 1.5em;
    padding: 0 0.5em;
  }

  .tab-btn {
    padding: 0.6em 1em;
    font-size: 0.9em;
    flex: 1;
    min-width: 0;
  }

  .search-section {
    padding: 1.5em 1em;
    margin-bottom: 1.5em;
  }

  .search-box {
    flex-direction: column;
    gap: 0.75em;
  }

  .search-box input {
    width: 100%;
    min-width: 0;
    font-size: 16px; /* Évite le zoom sur iOS */
  }

  .search-box > div {
    width: 100%;
    display: flex;
    gap: 0.5em;
  }

  .search-box button {
    flex: 1;
    min-height: 44px; /* Taille minimale pour le tactile */
  }

  .filter-toggle {
    font-size: 0.9em;
    padding: 0.875em;
  }

  .genres-panel,
  .filters-panel {
    padding: 1em;
  }

  .genre-pills {
    gap: 0.5em;
  }

  .genre-pill {
    font-size: 0.85em;
    padding: 0.4em 0.8em;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 0.75em;
  }

  .filters select,
  .filters input {
    font-size: 16px; /* Évite le zoom sur iOS */
    min-height: 44px;
  }

  .view-toggle {
    padding: 0.75em;
    margin-bottom: 1em;
    flex-wrap: wrap;
  }

  .view-toggle span {
    width: 100%;
    margin-bottom: 0.5em;
  }

  .view-btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
  }

  .results {
    grid-template-columns: 1fr;
    gap: 1em;
  }

  .product-card {
    margin-bottom: 0;
  }

  .product-image {
    height: 180px;
  }

  .product-info {
    padding: 0.875em;
  }

  .product-name {
    font-size: 1em;
  }

  .product-price {
    font-size: 1.3em;
  }

  .product-actions {
    flex-direction: column;
    gap: 0.5em;
  }

  .btn-link {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-chart,
  .btn-alert {
    min-width: 44px;
    min-height: 44px;
  }

  .tendances-grid {
    grid-template-columns: 1fr;
    gap: 1.5em;
  }

  .tendance-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .tendance-image {
    width: 100px;
    height: 100px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1em;
  }

  .stat-card {
    padding: 1.25em;
  }

  .stat-card-value {
    font-size: 1.75em;
  }

  .modal {
    padding: 0.5em;
    align-items: flex-start;
    padding-top: 2em;
  }

  .modal-content {
    padding: 1.25em;
    margin: 0.5em;
    max-width: calc(100% - 1em);
    max-height: calc(100vh - 4em);
    border-radius: 12px;
  }

  .modal-close {
    top: 0.5em;
    right: 0.5em;
    width: 36px;
    height: 36px;
    font-size: 1.5em;
  }

  .price-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75em;
  }

  .price-stat {
    padding: 0.875em;
  }

  .price-stat-value {
    font-size: 1.25em;
  }

  .chart-container {
    height: 300px;
    margin-top: 1.5em;
  }

  .results-table,
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    position: relative;
  }

  .results-table::before,
  .table-container::before {
    content: '← Faites glisser →';
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    font-size: 0.75em;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25em 0.5em;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
  }

  .dark-mode .results-table::before,
  .dark-mode .table-container::before {
    background: rgba(31, 41, 55, 0.9);
    color: var(--text-light);
  }

  .results-table table,
  .table-container table,
  .products-table {
    min-width: 700px;
    font-size: 0.85em;
  }

  .results-table th,
  .table-container th,
  .products-table th {
    padding: 0.875em 0.75em;
    font-size: 0.8em;
  }

  .results-table td,
  .table-container td,
  .products-table td {
    padding: 0.875em 0.75em;
  }

  .table-details-actions {
    flex-direction: column;
    gap: 0.5em;
  }

  .table-btn {
    width: 100%;
    min-height: 40px;
  }

  .pagination {
    gap: 0.25em;
    margin-top: 1.5em;
  }

  .pagination button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5em 0.75em;
    font-size: 0.9em;
  }

  .toast {
    bottom: 1em;
    right: 1em;
    left: 1em;
    max-width: calc(100% - 2em);
    padding: 1em;
  }

  footer {
    padding: 2em 1em;
    margin-top: 2em;
  }

  footer > div {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
  }

  footer a {
    display: block;
    width: 100%;
    margin: 0.25em 0;
    padding: 0.75em;
    text-align: center;
  }

  footer p {
    font-size: 0.85em;
    padding: 0 0.5em;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5em;
  }

  header {
    padding: 1em 0.5em;
  }

  .logo {
    max-width: 100%;
  }

  .subtitle {
    font-size: 0.85em;
  }

  .tabs {
    gap: 0.25em;
  }

  .tab-btn {
    padding: 0.5em 0.75em;
    font-size: 0.8em;
  }

  .search-section {
    padding: 1em 0.75em;
  }

  .search-box > div {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

  .product-price {
    font-size: 1.2em;
  }

  .price-stats {
    grid-template-columns: 1fr;
  }

  .results-table table,
  .table-container table,
  .products-table {
    min-width: 600px;
    font-size: 0.8em;
  }

  .results-table th,
  .table-container th,
  .products-table th {
    padding: 0.75em 0.5em;
  }

  .results-table td,
  .table-container td,
  .products-table td {
    padding: 0.75em 0.5em;
  }

  footer p {
    font-size: 0.75em;
  }
}

/* ========== SPONSOR SLOT ========== */
.sponsor-slot {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  padding: 1.5em;
  border-radius: var(--radius);
  margin-bottom: 2em;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.sponsor-slot h3 {
  margin-bottom: 0.5em;
  font-size: 1.2em;
}

.sponsor-slot p {
  margin-bottom: 1em;
  opacity: 0.95;
}

.sponsor-slot a {
  display: inline-block;
  padding: 0.75em 1.5em;
  background: white;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
}

.sponsor-slot a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ========== NAVIGATION ========== */
/* Styles de navigation déplacés dans nav.css pour une meilleure cohérence */

/* ========== DARK MODE TOGGLE BUTTON ========== */
.dark-mode-toggle {
  position: fixed;
  bottom: 2em;
  right: 2em;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid var(--primary-color);
  padding: 0.75em;
  border-radius: 50%;
  font-size: 1.5em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.dark-mode-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  background: white;
  border-color: var(--primary-dark);
}

.dark-mode .dark-mode-toggle {
  background: rgba(31, 41, 55, 0.95);
  border-color: var(--primary-light);
  color: white;
}

.dark-mode .dark-mode-toggle:hover {
  background: rgba(31, 41, 55, 1);
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .dark-mode-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.3em;
    bottom: 1.5em;
    right: 1.5em;
    min-width: 50px;
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  .dark-mode-toggle {
    width: 48px;
    height: 48px;
    font-size: 1.2em;
    bottom: 1em;
    right: 1em;
  }
}
