/* === Lavanty.mg — Styles partagés === */

:root {
  --color-brand-blue: #004a99;
  --color-brand-blue-dark: #003d80;
  --color-brand-accent: #f8f9fa;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-brand-accent);
  color: #1f2937;
  margin: 0;
}

.font-display { font-family: 'Figtree', 'Inter', sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.font-brush { font-family: 'Permanent Marker', cursive; }

/* === Navbar === */
.nav-link { position: relative; transition: color 0.2s; }
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--color-brand-blue);
  transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--color-brand-blue); }

header.site-header { transition: padding 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease; }
header.site-header.is-scrolled { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* === Boutons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; border-radius: 0.5rem; font-weight: 600;
  transition: transform 0.15s ease, background-color 0.2s, box-shadow 0.2s;
  cursor: pointer; border: none; font-family: inherit; font-size: 0.95rem;
}
.btn-primary { background: var(--color-brand-blue); color: white; }
.btn-primary:hover { background: var(--color-brand-blue-dark); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,74,153,0.25); }
.btn-secondary { background: white; color: var(--color-brand-blue); border: 1.5px solid var(--color-brand-blue); }
.btn-secondary:hover { background: var(--color-brand-blue); color: white; }
.btn-ghost { background: transparent; color: #374151; }
.btn-ghost:hover { background: #f3f4f6; }
/* Variante bordée discrète (quick-picks, Annuler) — token --lv-border, jamais de bordure inline (NT-13). */
.btn-outline { background: transparent; color: #374151; border: 1px solid var(--lv-border); }
.btn-outline:hover { background: #f3f4f6; }
.btn:focus-visible { outline: 2px solid var(--lv-brand); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bidPop { 0% { transform: scale(1); } 40% { transform: scale(1.15); color: #16a34a; } 100% { transform: scale(1); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); } 70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }

.fade-in { animation: fadeIn 0.4s ease both; }
.slide-up { animation: slideUp 0.5s ease both; }
.slide-down { animation: slideDown 0.4s ease both; }
.bid-pop { animation: bidPop 0.6s ease both; }
.pulse-ring { animation: pulse-ring 1.5s infinite; }

/* === Modales === */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn 0.2s ease both;
}
.modal-card {
  background: white; border-radius: 1rem; max-width: 480px; width: 100%;
  max-height: 90vh; overflow-y: auto; animation: slideUp 0.3s ease both;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.modal-card.lg { max-width: 640px; }

/* === Accordéon FAQ === */
.accordion-item { border-bottom: 1px solid #e5e7eb; }
.accordion-trigger {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 0; background: none; border: none; cursor: pointer;
  font-weight: 600; font-size: 1.05rem; color: #111827; font-family: inherit; text-align: left;
}
.accordion-trigger i[data-lucide="chevron-down"] { transition: transform 0.3s ease; }
.accordion-item.open .accordion-trigger i[data-lucide="chevron-down"] { transform: rotate(180deg); }
.accordion-content {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease;
}
.accordion-item.open .accordion-content { grid-template-rows: 1fr; }
.accordion-content > div { overflow: hidden; }
.accordion-content p { padding-bottom: 1.25rem; color: #4b5563; line-height: 1.6; margin: 0; }

/* === Carrousel hero === */
.hero-carousel { position: relative; overflow: hidden; border-radius: 1rem; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease;
  background-size: cover; background-position: center; pointer-events: none;
}
.hero-slide.active { opacity: 1; z-index: 1; pointer-events: auto; }
.hero-slide::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(0,32,64,0.85), rgba(0,74,153,0.55) 60%, rgba(0,0,0,0.3));
}
.hero-dot {
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5);
  cursor: pointer; transition: all 0.3s; border: none;
}
.hero-dot.active { background: white; width: 28px; border-radius: 5px; }

/* === Cartes lot === */
.lot-card {
  background: white; border-radius: 0.75rem; overflow: hidden;
  border: 1px solid #e5e7eb; transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex; flex-direction: column;
}
.lot-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.1); border-color: var(--color-brand-blue); }
.lot-card .lot-image { aspect-ratio: 4/3; background-size: cover; background-position: center; position: relative; }
.lot-badge { position: absolute; top: 0.75rem; left: 0.75rem; background: rgba(0,0,0,0.7); color: white; font-size: 0.7rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.lot-heart { position: absolute; top: 0.75rem; right: 0.75rem; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; border: none; }
.lot-heart:hover { background: white; transform: scale(1.1); }
.lot-heart.active { background: #dc2626; }
.lot-heart.active i { color: white; fill: white; }

/* === Countdown === */
.countdown { display: inline-flex; gap: 0.4rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.countdown.urgent { color: #dc2626; }
.countdown-large { display: flex; gap: 0.75rem; }
.countdown-large .cd-block { background: #111827; color: white; padding: 0.75rem 1rem; border-radius: 0.5rem; min-width: 70px; text-align: center; }
.countdown-large .cd-val { font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-large .cd-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; margin-top: 0.25rem; }
.countdown-large.urgent .cd-block { background: #dc2626; }

/* === Toast === */
.toast-container { position: fixed; top: 5rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast {
  background: white; border-radius: 0.75rem; padding: 0.85rem 1.1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 0.75rem;
  animation: toastIn 0.3s ease both; max-width: 360px; pointer-events: auto;
  border-left: 4px solid var(--color-brand-blue);
}
.toast.success { border-left-color: #16a34a; }
.toast.error { border-left-color: #dc2626; }
.toast.info { border-left-color: var(--color-brand-blue); }

/* === Tableaux admin / compte === */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 0.75rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.data-table th { background: #f9fafb; padding: 0.85rem 1rem; text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; font-weight: 600; border-bottom: 1px solid #e5e7eb; }
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid #f3f4f6; font-size: 0.92rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
/* Responsive : défilement horizontal des tables sur mobile (évite le débordement
   quand le partial parent n'a pas de wrapper overflow-x-auto). */
@media (max-width: 768px) {
    .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

/* Pastilles : composant unique .lv-pill (lavanty-ui.css) — legacy .badge-* supprimé. */

/* === Sous-onglets === */
.subtab { white-space: nowrap; flex-shrink: 0; padding: 0.75rem 1.25rem; border: none; background: none; cursor: pointer; font-weight: 600; color: #6b7280; border-bottom: 3px solid transparent; font-family: inherit; transition: all 0.2s; }
.subtab:hover { color: var(--color-brand-blue); }
.subtab.active { color: var(--color-brand-blue); border-bottom-color: var(--color-brand-blue); }

/* Sous-onglets de 2e niveau (pilules) — distincts du souligne de 1er niveau,
   imbriques DANS un panneau d'onglet (cf partial sub-tabs.blade.php). */
.sub-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; margin-bottom: 1.25rem; background: #f3f4f6; border-radius: 0.6rem; }
.sub-tab { padding: 0.45rem 1rem; border: none; background: none; cursor: pointer; font-weight: 600; font-size: 0.875rem; color: #6b7280; border-radius: 0.45rem; font-family: inherit; transition: all 0.18s; }
.sub-tab:hover { color: var(--color-brand-blue); }
.sub-tab.active { color: var(--color-brand-blue); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* === Inputs === */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.7rem 0.9rem; border: 1.5px solid #d1d5db; border-radius: 0.5rem;
  font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--color-brand-blue);
  box-shadow: 0 0 0 3px rgba(0,74,153,0.1);
}
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; color: #374151; }

/* === Footer === */
footer.site-footer { background: #111827; color: #d1d5db; padding: 3rem 1rem 1.5rem; margin-top: 4rem; }
footer.site-footer a:hover { color: white; }
/* Input newsletter (fond sombre) : états centralisés ici, anneau de focus conservé (NT-13). */
.footer-input {
  flex: 1; min-width: 0; padding: 0.5rem 0.75rem;
  background: #1f2937; border: 1px solid #374151; border-radius: 0.5rem;
  color: #fff; font-family: inherit; transition: border-color 0.2s;
}
.footer-input::placeholder { color: #9ca3af; }
.footer-input:focus-visible { outline: 2px solid var(--lv-brand); outline-offset: 2px; border-color: #9ca3af; }

/* === Notification dot === */
.notif-dot { position: absolute; top: -3px; right: -3px; width: 18px; height: 18px; background: #dc2626; color: white; border-radius: 50%; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid white; }

/* === Utils === */
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
  .countdown-large { gap: 0.5rem; }
  .countdown-large .cd-block { flex: 1 1 0; min-width: 0; padding: 0.5rem 0.25rem; }
  .countdown-large .cd-val { font-size: 1.25rem; }
}

/* iOS zoome la page au focus d'un champ dont la police est sous 16 px : plancher à 16 px sur téléphone et petite tablette. */
@media (max-width: 767px) {
  .form-input, .form-select, .form-textarea, .lv-input, .topbar-search, input[type="search"] { font-size: 16px !important; }
}

/* 100vh ignore la barre d'adresse des navigateurs mobiles : 100dvh quand il est disponible. */
@supports (height: 100dvh) {
  .h-screen { height: 100dvh !important; }
  .min-h-screen { min-height: 100dvh !important; }
}
