/**
 * components.css — Styles additionnels page-spécifiques
 * Complète main.css avec les composants non couverts
 */

/* ── Listing gallery ─────────────────────────────────────────── */
.listing-gallery { position: relative; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
.listing-gallery .swiper { height: 280px; }
.listing-gallery .swiper-slide img { width: 100%; height: 280px; object-fit: cover; }
.listing-gallery .swiper-slide { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.listing-gallery .swiper-pagination-bullet-active { background: var(--accent); }

/* ── Amenity chip (wizard ajout annonce) ─────────────────────── */
.amenity-chip { transition: border-color .15s, background .15s; }
.amenity-chip.active { border-color: var(--accent) !important; background: var(--accent-soft); }

/* ── Payment option ──────────────────────────────────────────── */
.payment-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-2);
  cursor: pointer;
  transition: border-color .15s;
}
.payment-option:hover,
.payment-option.active { border-color: var(--accent); }
.payment-option__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.payment-option__body { flex: 1; min-width: 0; }
.payment-option__name { font-size: 15px; font-weight: 600; }
.payment-option__desc { font-size: 13px; color: var(--ink-faint); }
.payment-option__check { flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.payment-option.active .payment-option__check { opacity: 1; color: var(--accent); }

/* ── Step bar ────────────────────────────────────────────────── */
.step-bar {
  display: flex;
  align-items: center;
  overflow-x: auto;
  gap: 0;
  padding-bottom: 4px;
}
.step-bar__item {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
  padding: 4px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}
.step-bar__item--active {
  color: var(--accent);
  background: var(--accent-soft);
}
.step-bar__item--done {
  color: #2E7D32;
}
.step-bar__sep {
  height: 2px;
  flex: 1;
  background: var(--border);
  min-width: 12px;
}
.step-bar__sep--done { background: #2E7D32; }

/* ── Calendar ────────────────────────────────────────────────── */
.calendar { user-select: none; }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── Chat bubble ─────────────────────────────────────────────── */
.chat-bubble {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: 85%;
}
.chat-bubble--out {
  margin-left: auto;
  flex-direction: row-reverse;
}
.chat-bubble__text {
  padding: var(--space-2) var(--space-3);
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
}
.chat-bubble--out .chat-bubble__text {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chat-bubble__time {
  font-size: 10px;
  color: var(--ink-faint);
  padding: 0 4px;
  flex-shrink: 0;
}

/* ── Service item row ────────────────────────────────────────── */
.service-item-row { transition: box-shadow .15s; }
.service-item-row:focus-within { box-shadow: 0 0 0 2px var(--accent); }

/* ── Photo thumb (upload) ────────────────────────────────────── */
.photo-thumb { aspect-ratio: 1; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-2);
  font-size: 14px;
  line-height: 1.5;
}
.alert--danger  { background: #FFEBEE; border: 1px solid #EF9A9A; color: #C62828; }
.alert--success { background: #E8F5E9; border: 1px solid #A5D6A7; color: #2E7D32; }

/* ── Badge variants ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge--sponsorise { background: var(--accent-soft); color: var(--accent); }
.badge--verifie    { background: #E8F5E9; color: #2E7D32; }
.badge--premium    { background: #FFF8E1; color: #F57F17; }
.badge--nouveau    { background: #E3F2FD; color: #1565C0; }

/* ── Stat card block ─────────────────────────────────────────── */
.stat-card--block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
}

/* ── Icon button ─────────────────────────────────────────────── */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: none;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .15s;
}
.icon-btn--active svg { color: var(--accent); fill: var(--accent); }
.icon-btn:hover { background: var(--surface); }

/* ── Bottom sheet ────────────────────────────────────────────── */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-3) var(--radius-3) 0 0;
  padding: var(--space-3) var(--page-px) var(--space-8);
  z-index: 200;
  transition: transform .3s cubic-bezier(.25,.46,.45,.94);
  max-height: 90vh;
  overflow-y: auto;
}
.bottom-sheet.open { transform: translateX(-50%) translateY(0); }
.bottom-sheet__handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto var(--space-4);
}

/* ── Overlay ─────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.overlay.open { opacity: 1; pointer-events: all; }

/* ── Price row ───────────────────────────────────────────────── */
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) 0;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.tabs__item {
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: color .15s, border-color .15s;
}
.tabs__item.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Filter chip ─────────────────────────────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.filter-chip.active,
.filter-chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  color: var(--ink-faint);
  box-shadow: var(--shadow-sm);
}
.search-bar svg { flex-shrink: 0; color: var(--ink-faint); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--page-px);
  text-align: center;
  gap: var(--space-3);
}
.empty-state__icon { color: var(--ink-faint); }
.empty-state__title { font-size: 18px; font-weight: 700; color: var(--ink); }
.empty-state__text  { font-size: 14px; color: var(--ink-faint); line-height: 1.6; max-width: 300px; }

/* ── Qty selector ────────────────────────────────────────────── */
.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-1);
  overflow: hidden;
}
.qty-selector__btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink);
}
.qty-selector__btn:hover { background: var(--surface-alt); }
.qty-selector__input {
  width: 48px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  height: 40px;
}

/* ── Switch ──────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s;
}
.switch__slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.switch input:checked + .switch__slider { background: var(--accent); }
.switch input:checked + .switch__slider::before { transform: translateX(22px); }

/* ── Star rating ─────────────────────────────────────────────── */
.stars { display: flex; gap: 2px; }

/* ── Page login ──────────────────────────────────────────────── */
.page-login { background: var(--bg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Input with icon ─────────────────────────────────────────── */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon > svg {
  position: absolute;
  left: 12px;
  color: var(--ink-faint);
  pointer-events: none;
}
.input-with-icon > .input { padding-left: 40px; }

/* ── Checkbox row ────────────────────────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Responsive: centrer sur desktop ─────────────────────────── */
@media (min-width: 481px) {
  .bottom-sheet,
  .bottom-bar { max-width: 480px; }
  .app-shell  { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
