/* Evotic Edge — /que-faire styles
 * Suit STRICTEMENT les variables thème du design-tokens.css (light/dark switch
 * via [data-theme="dark"] sur <html>). Pas d'override prefers-color-scheme.
 */

.qf-body {
  background: var(--bg);
  min-height: 100dvh;
  padding-bottom: 100px;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(255, 102, 0, 0.05), transparent 45%);
  background-attachment: fixed;
  color: var(--text);
}

.qf-shell {
  padding: 12px 14px 0;
  max-width: var(--max-w, 720px);
  margin: 0 auto;
}

/* ── Search section ─────────────────────────────────────────────────────── */
.qf-search { padding: 10px 12px; margin-bottom: 10px; }
.qf-search .search-row { display: flex; gap: 8px; }
.qf-search .search-input-wrap {
  position: relative; flex: 1;
}
.qf-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
}
.qf-search input {
  width: 100%; padding: 10px 12px 10px 36px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: Nunito, sans-serif; font-size: 14px;
  background: var(--card-bg); color: var(--text);
}

/* ── Pills horizontal scroll ────────────────────────────────────────────── */
.qf-pills {
  display: flex; gap: 6px; padding: 8px 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.qf-pills::-webkit-scrollbar { display: none; }

.qf-pill {
  flex: 0 0 auto; white-space: nowrap;
  padding: 7px 14px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  font-family: Nunito, sans-serif; font-weight: 700; font-size: 12px;
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.qf-pill:active { transform: scale(0.96); }
.qf-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}
.qf-pill i { margin-right: 4px; }

/* ── Tabs (catégories) — gradient style cohérent manger/dormir ───────────── */
.qf-tabs {
  display: flex; gap: 8px;
  padding: 10px 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.qf-tabs::-webkit-scrollbar { display: none; }

.qf-tab {
  flex: 0 0 auto; white-space: nowrap;
  padding: 9px 14px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font-family: Nunito, sans-serif; font-weight: 700; font-size: 13px;
  cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s ease;
}
.qf-tab:active { transform: scale(0.96); }
.qf-tab.active {
  background: var(--primary-grad, linear-gradient(135deg, var(--primary), var(--primary-light, var(--primary))));
  color: #fff; border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(255, 102, 0, 0.35);
}

/* ── Meta + list ────────────────────────────────────────────────────────── */
.qf-meta {
  font-size: 12px; color: var(--text-muted);
  font-weight: 700; padding: 6px 4px;
}

.qf-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}

.qf-card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card, 0 2px 10px rgba(0, 0, 0, 0.05));
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.qf-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 6px 18px rgba(0, 0, 0, 0.08)); }
.qf-card:active { transform: scale(0.98); }

.qf-card-cover {
  width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; position: relative;
  background: var(--bg-soft);
}
.qf-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Compact card variant (no image) ────────────────────────────────────── */
.qf-card-compact {
  flex-direction: row;
  align-items: center;
  padding: 10px 12px;
  gap: 12px;
}
.qf-card-compact .qf-card-icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.qf-card-compact .qf-card-body {
  flex: 1; min-width: 0;
  padding: 0;
}
.qf-card-compact .qf-card-head {
  margin-bottom: 4px;
}
.qf-card-compact .qf-card-title {
  font-size: 14px; margin-bottom: 4px;
  -webkit-line-clamp: 2;
}
.qf-card-compact .qf-card-meta-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
}
.qf-card-compact .qf-card-meta-row i { width: 12px; }
.qf-card-compact .qf-card-price {
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
}
.qf-card-compact .qf-card-cat {
  font-size: 10px;
  padding: 2px 8px;
}
.qf-card-compact .qf-card-date-badge {
  font-size: 10px;
  padding: 2px 8px;
}

.qf-card-body { padding: 12px 14px 14px; }

.qf-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}

.qf-card-cat {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
}

.qf-card-date-badge {
  color: #fff;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
  animation: qf-pulse 1.6s ease-in-out infinite;
}

@keyframes qf-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.qf-card-title {
  font-size: 16px; font-weight: 800; margin: 0 0 6px;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.qf-card-meta {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--text-soft);
}
.qf-card-meta span {
  display: inline-flex; align-items: center; gap: 6px;
}
.qf-card-meta i { width: 14px; color: var(--text-muted); }

.qf-card-price {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800;
  color: var(--primary);
  padding: 4px 10px; background: var(--primary-bg); border-radius: 8px;
  width: fit-content;
}

/* ── Add button bottom ──────────────────────────────────────────────────── */
.qf-add-btn {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 10px;
  padding: 14px 16px;
  background: var(--primary-bg-soft, rgba(255, 102, 0, 0.05));
  border: 2px dashed var(--primary);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-family: Nunito, sans-serif;
}
.qf-add-btn:active { transform: scale(0.98); }
.qf-add-btn > i:first-child { font-size: 22px; color: var(--primary); }
.qf-add-btn > span { flex: 1; font-size: 14px; }
.qf-add-btn small { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.qf-add-btn > i:last-child { color: var(--primary); }

.qf-disclaimer {
  text-align: center;
  font-size: 11px; color: var(--text-muted);
  margin: 14px 0 24px;
}
.qf-disclaimer a { color: var(--primary); font-weight: 700; text-decoration: none; }
.qf-disclaimer i { margin-right: 4px; }

.empty-state {
  text-align: center; padding: 24px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
}
.empty-icon { font-size: 36px; color: var(--text-muted); margin-bottom: 8px; }
.empty-state .hint { color: var(--text-muted); font-size: 12px; }

/* ── Sheet detail ───────────────────────────────────────────────────────── */
.qf-sheet {
  position: fixed; inset: 0; z-index: 1050;
  pointer-events: none;
}
.qf-sheet[aria-hidden="false"] { pointer-events: auto; }
.qf-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0; transition: opacity .25s;
}
.qf-sheet.open .qf-sheet-backdrop { opacity: 1; }

.qf-sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card-bg);
  color: var(--text);
  border-radius: 20px 20px 0 0;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg, 0 -8px 30px rgba(0, 0, 0, 0.15));
}
.qf-sheet.open .qf-sheet-card { transform: translateY(0); }

.qf-sheet-handle {
  width: 40px; height: 4px;
  background: var(--border-strong); border-radius: 2px;
  margin: 8px auto 0;
}

.qf-sh-cover {
  width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
  margin-top: 8px;
}
.qf-sh-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qf-sh-cover-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}

.qf-sh-body { padding: 16px 18px 24px; }

.qf-sh-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}

.qf-sh-cat, .qf-sh-date-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
}
.qf-sh-date-badge { color: #fff; }

.qf-sh-title {
  font-size: 22px; font-weight: 900; margin: 0 0 12px;
  color: var(--text);
  line-height: 1.2;
}

.qf-sh-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
}
.qf-sh-row i { color: var(--text-muted); width: 18px; }
.qf-sh-when { font-weight: 700; color: var(--primary); }
.qf-sh-when i { color: var(--primary); }
.qf-sh-price { font-weight: 800; color: var(--primary); }
.qf-sh-price i { color: var(--primary); }

.qf-sh-desc {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 13px; line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.qf-sh-map {
  width: 100%; height: 180px;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  background: var(--bg-soft);
}

.qf-sh-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px;
}

.qf-sh-btn {
  flex: 1 1 calc(50% - 4px); min-width: 140px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: Nunito, sans-serif; font-weight: 700; font-size: 13px;
  cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.qf-sh-btn:active { transform: scale(0.97); }
.qf-sh-btn.primary {
  background: var(--primary-grad, linear-gradient(135deg, var(--primary), var(--primary-light, var(--primary))));
  color: #fff; border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(255, 102, 0, 0.35);
}
