/* Barre de filtres haut + panneau gauche — quasi pleine largeur */

.offers-page {
  --container: min(1920px, 100%);
}

.offers-page .container,
.offers-page .site-header .container,
.offers-page .site-footer .container {
  width: min(100% - 0.75rem, 1920px);
}

.bk-filter-wrap {
  position: relative;
  z-index: 40;
  width: 100%;
  max-width: none;
}

.bk-filter-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bk-filter-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid rgba(16, 22, 18, 0.12);
  border-radius: 999px;
  box-shadow:
    0 2px 8px rgba(16, 22, 18, 0.08),
    0 12px 32px rgba(16, 22, 18, 0.12);
  color: var(--ink);
}

.bk-filter-wrap.is-stuck .bk-filter-bar {
  position: fixed;
  top: calc(var(--nav-h, 64px) + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(1920px, calc(100vw - 0.75rem));
  z-index: 90;
  border-radius: 1rem;
  box-shadow:
    0 4px 16px rgba(16, 22, 18, 0.12),
    0 18px 40px rgba(16, 22, 18, 0.16);
}

.bk-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.bk-field:hover,
.bk-field:focus-within {
  background: rgba(14, 61, 46, 0.06);
}

.bk-field label,
.bk-field .bk-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.2;
}

.bk-field input,
.bk-field select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0;
  width: 100%;
  min-width: 0;
  appearance: none;
  cursor: pointer;
}

.bk-field input::placeholder {
  color: var(--mute);
  font-weight: 400;
}

.bk-field-q { flex: 1.6 1 240px; }
.bk-field-cat { flex: 1 1 160px; }
.bk-field-dest { flex: 2.2 1 320px; }

.bk-dest-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.bk-dest-row select {
  flex: 1;
  font-size: 0.86rem;
}

.bk-sep {
  width: 1px;
  align-self: stretch;
  margin: 0.55rem 0;
  background: rgba(16, 22, 18, 0.12);
  flex: 0 0 1px;
}

.bk-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  margin: 0.15rem;
  padding: 0.9rem 1.45rem;
  border: 0;
  border-radius: 999px;
  background: var(--forest, #0e3d2e);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 14px rgba(14, 61, 46, 0.28);
}

.bk-search-btn:hover {
  background: #12503c;
  transform: translateY(-1px);
}

.market-top-inner { gap: 1rem; }
.market-top .offers-lead { margin-bottom: 0.35rem; }
.market-search { display: none; }

.market-browse {
  padding: 1rem 0 2.5rem;
  background: var(--paper, #f3f1ec);
}

.market-browse-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: min(100% - 0.75rem, 1920px);
}

.bk-sidebar {
  position: sticky;
  top: calc(var(--nav-h, 64px) + 0.75rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h, 64px) - 1.25rem);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(16, 22, 18, 0.1);
  border-radius: 0.4rem;
  box-shadow: 0 1px 3px rgba(16, 22, 18, 0.06);
}

.bk-sidebar-form {
  padding: 1rem 1.05rem 1.15rem;
}

.bk-sidebar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(16, 22, 18, 0.1);
}

.bk-sidebar-head h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.bk-sidebar-reset {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--forest, #0e3d2e);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bk-side-block {
  border: 0;
  margin: 0 0 0.95rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid rgba(16, 22, 18, 0.08);
}

.bk-side-block legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.bk-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.bk-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--forest, #0e3d2e);
}

.bk-side-label {
  display: block;
  margin: 0.4rem 0 0.22rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mute);
}

.bk-side-block select,
.bk-side-block input[type="search"],
.bk-side-block input[type="text"],
.bk-side-block input:not([type="radio"]):not([type="checkbox"]) {
  width: 100%;
  border: 1px solid rgba(16, 22, 18, 0.16);
  background: #fff;
  color: var(--ink);
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.88rem;
  border-radius: 0.25rem;
}

.bk-side-price {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bk-side-price input {
  flex: 1;
  min-width: 0;
}

.bk-side-price span {
  color: var(--mute);
  font-weight: 600;
}

.bk-side-submit {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: 0.3rem;
  background: var(--forest, #0e3d2e);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bk-side-submit:hover { background: #12503c; }

.bk-side-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.bk-cat-hint {
  margin: 0.15rem 0 0.45rem 1.55rem;
  font-size: 0.78rem;
  color: var(--mute, #666);
  line-height: 1.35;
}

.bk-filter-extra {
  margin-bottom: 0.65rem;
}

.bk-filter-extra:last-child {
  margin-bottom: 0;
}

.bk-results .offers-grid,
.bk-results .offers-grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}

.bk-sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.bk-filters-close {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line, #ddd);
  background: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink, #111);
}

.bk-mobile-toolbar {
  display: none;
}

.bk-filters-backdrop {
  display: none;
}

@media (max-width: 980px) {
  .bk-filter-bar {
    flex-wrap: wrap;
    border-radius: 1.15rem;
    padding: 0.45rem;
  }
  .bk-sep { display: none; }
  .bk-field {
    flex: 1 1 calc(50% - 0.5rem);
    border-radius: 0.85rem;
  }
  .bk-field-q,
  .bk-field-dest { flex: 1 1 100%; }
  .bk-search-btn {
    flex: 1 1 100%;
    margin-top: 0.25rem;
    min-height: 48px;
  }

  .market-browse-layout {
    grid-template-columns: 1fr;
  }

  .bk-filter-wrap.is-stuck .bk-filter-bar {
    width: min(100vw - 0.75rem, 1920px);
    border-radius: 0.85rem;
  }

  .bk-mobile-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: sticky;
    top: calc(var(--nav-h, 64px) + 0.35rem);
    z-index: 50;
    margin-bottom: 0.75rem;
    padding: 0.45rem;
    background: rgba(243, 241, 236, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line, #d4d0c8);
  }

  .bk-filters-open {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--ink, #101612);
    background: var(--ink, #101612);
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
  }

  .bk-mobile-count {
    margin: 0;
    font-size: 0.82rem;
    color: var(--mute, #5e6a63);
    font-weight: 600;
  }

  .bk-filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 22, 18, 0.45);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .bk-filters-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .bk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(92vw, 360px);
    max-height: none;
    z-index: 100;
    margin: 0;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--line, #d4d0c8);
    background: #fff;
    box-shadow: 8px 0 32px rgba(16, 22, 18, 0.18);
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem 0.85rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .bk-sidebar.is-open {
    transform: translateX(0);
  }

  .bk-filters-close { display: inline-flex; align-items: center; justify-content: center; }

  .bk-side-submit {
    position: sticky;
    bottom: 0.35rem;
    z-index: 2;
    min-height: 48px;
    box-shadow: 0 -8px 16px #fff;
  }

  .bk-results .market-strip-head-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .market-sort {
    width: 100%;
    justify-content: space-between;
  }
  .market-sort select {
    flex: 1;
    min-height: 44px;
  }
}

@media (max-width: 760px) {
  /* reserved for tighter phone tweaks if needed */
}

@media (max-width: 640px) {
  .offers-page .container,
  .market-browse-layout {
    width: min(100% - 0.7rem, 1920px);
  }

  .bk-field { flex: 1 1 100%; }
  .bk-dest-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .bk-dest-row select {
    min-height: 40px;
    font-size: 16px; /* évite zoom iOS */
  }
  .bk-field input,
  .bk-field select {
    font-size: 16px;
  }

  .bk-filter-bar {
    border-radius: 0.85rem;
  }

  .bk-filter-wrap.is-stuck .bk-filter-bar {
    top: calc(var(--nav-h, 60px) + 0.25rem);
    width: calc(100vw - 0.7rem);
  }

  /* Cartes horizontales — scan rapide au pouce */
  .bk-results .offers-grid,
  .bk-results .offers-grid-featured {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .bk-results .offer-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
  }
  .bk-results .offer-card:hover { transform: none; }
  .bk-results .offer-card-media {
    width: 36%;
    min-width: 112px;
    max-width: 140px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
  }
  .bk-results .offer-card-body {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.65rem 0.6rem;
    justify-content: space-between;
  }
  .bk-results .offer-card-body h3 {
    font-size: 0.92rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .bk-results .offer-meta {
    font-size: 0.72rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .bk-results .offer-card-foot {
    margin-top: 0.35rem;
    gap: 0.35rem;
  }
  .bk-results .offer-price { font-size: 0.88rem; }
  .bk-results .offer-card-foot .btn {
    min-height: 36px;
    padding: 0.35rem 0.55rem;
  }
  .bk-results .offer-chip {
    font-size: 0.62rem;
    padding: 0.15rem 0.35rem;
  }

  .pagination {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .pagination .btn {
    min-height: 44px;
    flex: 1;
    text-align: center;
  }

  .offers-map {
    height: 260px;
    border-radius: 0;
  }
}
