/* ---------- LAYOUT & HERO ---------- */
.filtrage-section {
  background: linear-gradient(145deg, rgba(244, 246, 250, 0.9), rgba(232, 236, 244, 0.8));
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.site-main {
  padding-top: clamp(1.25rem, 2vw, 2.25rem);
}

.filtrage-layout {
  max-width: 1220px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-sm, 0 20px 45px rgba(31, 41, 55, 0.08));
  padding: clamp(1.75rem, 5vw, 3.25rem);
  display: flex;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: flex-start;
  position: relative;
  overflow: visible;
  padding-right: clamp(1rem, 6vw, 3rem);
}

.scent-search-container {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 1.75rem);
  flex: 1 1 0;
  min-width: 0;
}

.page-header {
  text-align: left;
  display: grid;
  gap: 0.35rem;
}

.page-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0;
}

.page-title {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: #1f2937;
}

.page-subtitle {
  margin: 0;
  color: #4b5563;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  max-width: 52ch;
}

/* ---------- STICKY TOOLBAR ---------- */
.scent-toolbar {
  position: sticky;
  top: calc(var(--site-header-height, 72px) + 0.75rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.92);
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  z-index: 40;
  backdrop-filter: blur(6px);
  width: min(100%, 740px);
  align-self: flex-start;
}

.form-field--inline {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 520px;
  margin: 0;
}

.toolbar-meta {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.results-count {
  font-weight: 600;
  color: #1f2937;
  font-size: 1rem;
}

.reset-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  background: #475569;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.reset-btn:hover,
.reset-btn:focus-visible {
  background: #334155;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.reset-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
}

/* ---------- FILTERS PANEL ---------- */
.filters-meta {
  display: grid;
  gap: 0.65rem;
}

.filters-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: #1d4ed8;
  font-size: 0.95rem;
  padding: 0.4rem 0.9rem;
  border-radius: 14px;
  background: rgba(191, 219, 254, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.6);
}

.filters-drawer {
  --drawer-tab-width: 72px;
  flex: 0 0 280px;
  max-width: 300px;
  min-width: 220px;
  background: radial-gradient(140% 120% at 20% 20%, rgba(59, 130, 246, 0.16), rgba(15, 23, 42, 0.95));
  color: #e5e7eb;
  border-radius: 18px;
  overflow: visible;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.28);
  position: fixed;
  right: 0;
  max-height: calc(100vh - var(--site-header-height, 72px) - 24px);
  margin-left: auto;
  transition: width 0.3s ease, max-width 0.3s ease, box-shadow 0.25s ease, transform 0.35s ease, border-color 0.25s ease, top 0.35s ease;
  will-change: transform, top;
  z-index: 60;
  backdrop-filter: blur(6px);
}

.filters-drawer:not(.filters-drawer--collapsed) {
  top: calc(var(--site-header-height, 72px) + 12px);
  transform: translateX(var(--drawer-shift, 0px));
}

.filters-drawer--dragging {
  transition: none;
}

.filters-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.7));
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.filters-drawer__titles {
  display: grid;
  gap: 0.15rem;
}

.filters-drawer__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.7);
}

.filters-drawer:not(.filters-drawer--collapsed) .filters-drawer__eyebrow {
  display: none;
}

.filters-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  min-height: 1em;
}

.filters-handle {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 82px;
  border: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(226, 232, 240, 0.85));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
  border-radius: 14px 0 0 14px;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  padding: 0;
}

.filters-handle::after {
  content: '';
  display: block;
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.45);
}

.filters-handle:active {
  cursor: grabbing;
}

.filters-btn {
  align-self: flex-start;
  padding: 0.6rem 1.35rem;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.filters-btn:hover,
.filters-btn:focus-visible {
  background: #1d4ed8;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.filters-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 3px;
}


.filters-drawer--collapsed {
  --drawer-shift: calc(100% - var(--drawer-tab-width));
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.28);
  top: 50%;
  transform: translateY(-50%) translateX(var(--drawer-shift, 0px));
  max-height: calc(90vh - 32px);
}

.filters-drawer--collapsed .filters-btn {
  width: 96px;
  min-width: 0;
  margin-left: auto;
  justify-content: center;
  padding-inline: 0.5rem;
}

.filters-drawer--collapsed .filters-drawer__header {
  padding: 0.75rem 0.95rem 0.75rem 1.15rem;
}

.filters-drawer--collapsed .filters-drawer__titles {
  gap: 0.1rem;
}

.filters-drawer--collapsed .filters-drawer__title {
  font-size: 0.95rem;
}

.filters-panel {
  border-radius: 0 0 20px 20px;
  max-height: 0;
  overflow: hidden;
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
  padding: 0 1.1rem;
  opacity: 0;
}

.filters-panel.open {
  max-height: calc(90vh - 120px);
  padding: 1.1rem 1.25rem 1.35rem;
  opacity: 1;
  overflow-y: auto;
}

.filters-drawer--collapsed .filters-panel {
  max-height: 0;
  padding: 0 1.25rem;
  opacity: 0;
  pointer-events: none;
}

.filters-panel__intro {
  margin: 0 0 1rem;
  color: #475569;
  font-size: 0.95rem;
}

.filters-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}

.filter-heading {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.filters-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  border: 1.6px solid rgba(96, 165, 250, 0.35);
  background: rgba(191, 219, 254, 0.35);
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  width: 100%;
  justify-content: flex-start;
}

.filter-badge.is-active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

.filter-badge__icon {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
  line-height: 1;
}

.filter-badge.is-active .filter-badge__icon {
  background: rgba(255, 255, 255, 0.92);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.filter-badge__text {
  line-height: 1.2;
}

.filter-badge:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
  transform: translateY(-1px);
}

.filter-badge:hover {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.15);
}

.filter-badge.is-active:hover {
  background: #1e3a8a;
  border-color: #1e3a8a;
}

/* ---------- ACTIVE FILTERS ---------- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
  color: #1f2937;
  min-height: 2.25rem;
}

.active-filters--empty {
  color: #6b7280;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1e3a8a;
  border: 1px solid rgba(37, 99, 235, 0.35);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.active-filter-chip:hover,
.active-filter-chip:focus-visible {
  background: rgba(37, 99, 235, 0.2);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.active-filter-chip:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 3px;
}

.active-filter-chip__icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.12);
  color: #1e3a8a;
  font-size: 0.75rem;
  line-height: 1;
}

/* ---------- RESULTS GRID ---------- */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vw, 1.2rem);
}

.scent-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2vw, 1rem);
  padding-bottom: 0.75rem;
  align-items: stretch;
  transition: opacity 0.25s ease;
}

.scent-grid[aria-busy="true"] {
  opacity: 0.55;
}

.scent-item {
  width: 110px;
  height: 120px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  -webkit-transform: translateY(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  position: relative;
  perspective: 1100px;
  -webkit-perspective: 1100px;
}

.scent-item.show {
  opacity: 1;
  transform: translateY(0);
  -webkit-transform: translateY(0);
}

.scent-item:hover,
.scent-item:focus-within {
  transform: translateY(-5px);
  -webkit-transform: translateY(-5px);
}

.scent-item:hover .scent-item__card,
.scent-item:focus-within .scent-item__card {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.scent-item__link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.scent-item__card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background: #fff;
  overflow: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s ease;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.scent-item.is-flipped .scent-item__card {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.scent-item__face {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  gap: 0.45rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.scent-item__face--front {
  background: #fff;
  text-align: center;
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  opacity: 1;
}

.scent-item__icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 0.4rem;
}

.scent-item__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #0f172a;
}

.scent-item__face--back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  background: #0f172a;
  overflow: hidden;
  position: relative;
  padding: 0;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  opacity: 0;
}

.scent-item.is-flipped .scent-item__face--front {
  opacity: 0;
}

.scent-item.is-flipped .scent-item__face--back {
  opacity: 1;
}

.scent-item__image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
  display: block;
}

.scent-item__face--empty {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(30, 64, 175, 0.7));
  color: rgba(203, 213, 225, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  height: 100%;
}

.scent-item__empty {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 0.75rem;
  line-height: 1.2;
}

.scent-item--no-image .scent-item__card {
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.15);
}

.scent-results__empty-note {
  flex-basis: 100%;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  color: #475569;
  background: rgba(241, 245, 249, 0.65);
  font-weight: 600;
}

/* ---------- ACCESSIBILITY & MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .scent-item {
    transition-duration: 0.01ms !important;
  }

  .scent-item__card {
    transition-duration: 0.01ms !important;
  }

  .scent-item.is-flipped .scent-item__card {
    transform: none;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .filtrage-layout {
    flex-direction: column;
  }

  .filters-drawer {
    position: static;
    width: 100%;
    max-width: none;
    flex-basis: auto;
    transform: none !important;
    --drawer-shift: 0px !important;
    top: auto;
    right: auto;
    max-height: none;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  }

  .filters-drawer--collapsed {
    transform: none !important;
    --drawer-shift: 0px !important;
  }
}

@media (max-width: 720px) {
  .scent-toolbar {
    position: static;
  }

  .filters-btn {
    width: 100%;
    text-align: center;
  }

  .filters-summary {
    width: 100%;
  }

  .toolbar-meta {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .results-count {
    font-size: 0.95rem;
  }
}

@media (max-width: 600px) {
  .scent-item {
    width: 80px;
  }
}
