/* ============================================================
   Ma-Degust - DA Carnet de degustation
   Cremes + serif elegant + cartes verticales avec bandeau couleur
   ============================================================ */

:root {
  /* Palette carnet */
  --bg:           #f5efde;
  --bg-dark:      #ebe1c5;
  --paper:        #faf6ed;
  --paper-light:  rgba(255,255,255,0.55);
  --ink:          #3d2e1f;
  --ink-soft:     #5a4730;
  --ink-mute:     #8a6f4a;
  --ink-light:    #a08866;
  --rule:         #d9c9a8;
  --rule-soft:    #e8dcbe;

  /* Wine colors (bandeaux) */
  --wine-red:     linear-gradient(180deg, #8b3a3a 0%, #5a1f1f 100%);
  --wine-white:   linear-gradient(180deg, #e8c45a 0%, #b88a1a 100%);
  --wine-rose:    linear-gradient(180deg, #e8a8a8 0%, #b85a73 100%);
  --wine-effer:   linear-gradient(180deg, #f0e4a8 0%, #c4a83a 100%);
  --wine-other:   linear-gradient(180deg, #6b4a3a 0%, #3d2616 100%);

  /* Accents */
  --accent:       #722d2d;
  --accent-dark:  #5a1f1f;
  --accent-light: #fbe8e8;
  --success:      #5a9050;
  --warning:      #b8860b;
  --danger:       #c0392b;
  --info:         #5a6f90;

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(61,46,31,0.06);
  --shadow-lg: 0 4px 14px rgba(61,46,31,0.10);

  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Georgia", "Cormorant Garamond", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* ============= Layout ============= */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px;
}
.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 22px;
}

/* ============= Topbar (style carnet) ============= */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--accent);
}
.topbar-title a { color: inherit; }
.topbar-actions {
  display: flex; gap: 10px; align-items: center;
  font-size: 0.88rem;
}

/* ============= Cards (papier creme) ============= */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card-light {
  background: var(--paper-light);
  border-color: var(--rule-soft);
}

.card-link {
  display: block; color: inherit; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ink-mute);
}

/* ============= Boutons ============= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
  font-family: inherit;
}
.btn:hover { background: var(--bg-dark); text-decoration: none; border-color: var(--ink-mute); }
.btn-primary {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); color: var(--paper); border-color: var(--accent-dark); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #a4302a; color: white; }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ============= Formulaires ============= */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=date],
.field input[type=number],
.field input[type=url],
.field input[type=file],
.field textarea,
.field select,
input.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 140px; }
.field-hint { font-size: 0.78rem; color: var(--ink-mute); margin-top: 4px; font-style: italic; }

/* ============= Alerts ============= */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.92rem;
  border: 1px solid;
}
.alert-success { background: #e8f0d8; border-color: #b8c98a; color: #4a6020; }
.alert-error   { background: #fbe8e8; border-color: #f0b8b8; color: #8a1f1f; }
.alert-warning { background: #fbf2d8; border-color: #d9c08a; color: #7a5a0c; }
.alert-info    { background: #e8edf5; border-color: #b8c4d9; color: #2a3a5a; }

/* ============= Badges ============= */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 500;
  background: var(--bg-dark);
  color: var(--ink-mute);
  letter-spacing: 0.03em;
}
.badge-open   { background: #dbe8c8; color: #4a6020; }
.badge-closed { background: var(--bg-dark); color: var(--ink-mute); }

/* Color badges (rouge/blanc/rose/effervescent/autre) */
.color-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.color-rouge        { background: rgba(250,246,237,0.92); color: #5a1f1f; }
.color-blanc        { background: rgba(250,246,237,0.92); color: #6a4a0a; }
.color-rose         { background: rgba(250,246,237,0.92); color: #722d3e; }
.color-effervescent { background: rgba(250,246,237,0.92); color: #6a4a0a; }
.color-autre        { background: rgba(250,246,237,0.92); color: #3d2616; }

/* ============= Wine card horizontale (vue compacte) ============= */
.wine-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.wine-card-img {
  width: 70px; height: 100px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.wine-card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  color: var(--ink-light);
  background: linear-gradient(180deg, #6b4a3a 0%, #3d2616 100%);
}
.wine-card-img-placeholder::after {
  content: "\1F377";
  filter: grayscale(0.4) brightness(1.3);
}
.wine-card-body { flex: 1; min-width: 0; }
.wine-card-title { font-family: var(--font-serif); font-weight: 500; margin: 0 0 2px; font-size: 1.05rem; }
.wine-card-domain { color: var(--ink-mute); font-size: 0.9rem; margin-bottom: 4px; }
.wine-card-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.84rem; color: var(--ink-mute); align-items: center; }

/* ============= GRILLE CATALOGUE - cartes verticales ============= */
.wine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

/* 3 colonnes de tags (cepages / certifs / options) */
.triple-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.tag-col h3 { margin-bottom: 2px; }
.tag-col p { margin-top: 0; margin-bottom: 8px; }

/* Bouton filtres mobile (masque sur desktop) */
.filter-toggle-mobile { display: none; }

.wine-tile {
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.wine-tile:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ink-mute);
}

.wine-tile-banner {
  height: 210px;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 10px;
  background: var(--paper);
}
/* Bandeau colore uniquement quand PAS d'image (placeholder) */
.wine-tile-banner.no-img.rouge        { background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%); }
.wine-tile-banner.no-img.blanc        { background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%); }
.wine-tile-banner.no-img.rose         { background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%); }
.wine-tile-banner.no-img.effervescent { background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%); }
.wine-tile-banner.no-img.autre        { background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%); }

.wine-tile-banner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 1;
  padding: 8px;
}

/* Bouteille dessinee (fallback) */
.bottle-svg {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  height: 86%;
  width: auto;
  z-index: 1;
}

.wine-tile-color {
  position: absolute; top: 10px; left: 10px;
  z-index: 2;
}

.wine-tile-score {
  position: relative; z-index: 2;
  background: rgba(250,246,237,0.95);
  color: var(--accent);
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-serif);
}
.wine-tile-score.empty { color: var(--ink-mute); font-weight: 500; }

.wine-tile-body {
  padding: 13px 15px;
}
.wine-tile-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.wine-tile-domain {
  font-size: 0.92rem;
  color: var(--ink-mute);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wine-tile-grapes {
  font-size: 0.76rem;
  color: var(--ink-light);
  font-style: italic;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wine-tile-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
  font-size: 0.76rem;
  color: var(--ink-mute);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.wine-tile-prices {
  text-align: right;
  font-weight: 500;
  color: var(--accent-dark);
}
.wine-tile-prices small { color: var(--ink-mute); font-weight: 400; }

/* ============= Score display ============= */
.score-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 4px 11px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.88rem;
  font-family: var(--font-serif);
}
.score-pill-big {
  font-size: 1.3rem;
  padding: 7px 16px;
}

/* ============= Slider de note ============= */
.score-slider { width: 100%; margin: 14px 0 8px; }
.score-slider input[type=range] {
  width: 100%;
  -webkit-appearance: none; appearance: none;
  height: 8px;
  background: linear-gradient(to right, var(--accent-light), var(--accent));
  border-radius: 999px; outline: none;
}
.score-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px;
  background: var(--accent); border: 3px solid var(--paper);
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.score-slider input[type=range]::-moz-range-thumb {
  width: 28px; height: 28px;
  background: var(--accent); border: 3px solid var(--paper);
  border-radius: 50%; cursor: pointer;
}
.score-slider-value {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  font-family: var(--font-serif);
  font-size: 2.3rem; font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.score-slider-value-max {
  font-size: 1rem; color: var(--ink-mute); font-weight: 400;
}

/* ============= Commentaires ============= */
.comment {
  padding: 10px 12px;
  border-left: 3px solid var(--rule);
  background: var(--paper-light);
  border-radius: 0 4px 4px 0;
  margin-bottom: 10px;
}
.comment-meta {
  font-size: 0.78rem; color: var(--ink-mute);
  margin-bottom: 4px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.comment-body {
  font-size: 0.93rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}

/* ============= Live indicator ============= */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 1.5s infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ============= Catalog layout (sidebar filters + grid) ============= */
.catalog-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 20px;
}
.catalog-sidebar {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 80px;
}
.filter-group { margin-bottom: 18px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--rule);
}
.filter-option {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.filter-option:hover { color: var(--ink); }
.filter-option input[type=checkbox] {
  accent-color: var(--accent);
}
.filter-option .count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ink-light);
}

/* Boutons couleur (toggles) */
.color-btn-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.color-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper-light);
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.12s;
  position: relative;
  overflow: hidden;
}
.color-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.color-btn-rouge::before        { background: linear-gradient(180deg, #8b3a3a 0%, #5a1f1f 100%); }
.color-btn-blanc::before        { background: linear-gradient(180deg, #e8c45a 0%, #b88a1a 100%); }
.color-btn-rose::before         { background: linear-gradient(180deg, #e8a8a8 0%, #b85a73 100%); }
.color-btn-effervescent::before { background: linear-gradient(180deg, #f0e4a8 0%, #c4a83a 100%); }
.color-btn-autre::before        { background: linear-gradient(180deg, #6b4a3a 0%, #3d2616 100%); }
.color-btn:hover {
  text-decoration: none;
  border-color: var(--ink-mute);
  background: var(--paper);
}
.color-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.color-btn.active:hover { background: var(--ink-soft); }
.color-btn-count {
  font-size: 0.74rem;
  opacity: 0.7;
  font-weight: 400;
}

@media (max-width: 800px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar {
    position: static;
    display: none;
    margin-bottom: 14px;
  }
  .catalog-sidebar.open { display: block; }
  .filter-toggle-mobile { display: inline-flex; }
}
@media (max-width: 900px) {
  .triple-cols { grid-template-columns: 1fr; gap: 14px; }
  .triple-cols .tag-col { padding-bottom: 14px; border-bottom: 1px dashed var(--rule); }
  .triple-cols .tag-col:last-child { border-bottom: none; padding-bottom: 0; }
}

/* ============= Search bar ============= */
.search-bar {
  display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.search-bar input { flex: 1; min-width: 160px; }

/* ============= Tabs ============= */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs a {
  padding: 10px 14px;
  color: var(--ink-mute);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* ============= Tables admin ============= */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--rule);
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.92rem;
}
.table th {
  background: var(--bg-dark);
  font-weight: 500;
  color: var(--ink-mute);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table tr:last-child td { border-bottom: none; }

/* ============= Topnav (menu) ============= */
.topnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.topnav a {
  padding: 8px 16px;
  color: var(--ink-mute);
  font-weight: 600;
  font-size: 1.02rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.01em;
}
.topnav a:hover { text-decoration: none; color: var(--ink); background: var(--bg-dark); }
.topnav a.active { color: var(--accent); background: var(--accent-light); }
.topnav a.topnav-admin {
  color: var(--paper);
  background: var(--accent);
}
.topnav a.topnav-admin:hover { background: var(--accent-dark); color: var(--paper); }
.topnav a.topnav-admin.active { background: var(--accent-dark); color: var(--paper); }

/* Container large (plus de place) */
.container-wide {
  max-width: 1340px;
  margin: 0 auto;
  padding: 22px;
}

/* ============= Recherche large (catalogue) ============= */
.search-hero {
  display: flex;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.search-hero-input {
  flex: 1;
  padding: 12px 16px !important;
  font-size: 1.05rem !important;
  border-radius: var(--radius-sm);
}
.search-hero .btn { padding: 12px 22px; }

/* ============= Tags actifs ============= */
.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
}
.tag-chip:hover { background: var(--accent-dark); text-decoration: none; color: var(--paper); }
.tag-chip span { font-size: 1rem; opacity: 0.8; }

/* ============= Accordeons de filtre ============= */
.filter-acc {
  border-bottom: 1px dashed var(--rule);
  padding: 10px 0;
}
.filter-acc:last-child { border-bottom: none; }
.filter-acc summary {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.filter-acc summary::-webkit-details-marker { display: none; }
.filter-acc summary::before {
  content: '+';
  margin-right: 8px;
  font-family: var(--font-sans);
  color: var(--ink-mute);
  font-weight: 400;
}
.filter-acc[open] summary::before { content: '\2212'; }
.acc-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 99px;
  text-transform: none;
}

/* ============= Certif tags ============= */
.cert-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 3px;
  background: #dbe8c8;
  color: #4a6020;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ============= Page d'accueil ============= */
.home-hero {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.home-hero-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--ink);
}
.home-hero-sub {
  font-size: 1.05rem;
  color: var(--ink-mute);
  margin: 0;
  max-width: 560px;
}
.home-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .home-cols { grid-template-columns: 1fr; }
  .home-hero { padding: 24px 20px; }
  .home-hero-title { font-size: 1.6rem; }
}

/* Rank badges (classements) */
.rank-badge {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-dark);
  color: var(--ink-mute);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.rank-badge.rank-1 { background: #e8c45a; color: #5a3f0a; }
.rank-badge.rank-2 { background: #d0cdc4; color: #4a4640; }
.rank-badge.rank-3 { background: #d8a878; color: #5a3a1a; }

/* Ligne de classement (linaire) */
.rank-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  text-decoration: none;
  color: inherit;
}
.rank-line:last-of-type { border-bottom: none; }
.rank-line:hover { text-decoration: none; }
a.rank-line:hover .rank-name { color: var(--accent); }
.rank-name {
  font-size: 1.02rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-color-dot {
  width: 28px; height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Mini banner couleur (accueil) */
.wine-mini-banner.rouge        { background: var(--wine-red); }
.wine-mini-banner.blanc        { background: var(--wine-white); }
.wine-mini-banner.rose         { background: var(--wine-rose); }
.wine-mini-banner.effervescent { background: var(--wine-effer); }
.wine-mini-banner.autre        { background: var(--wine-other); }

/* Liste des vins dans la page degustations */
.degust-wines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.degust-wine-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.degust-wine-chip:hover {
  text-decoration: none;
  border-color: var(--ink-mute);
  background: var(--paper);
}
.dwc-dot {
  width: 16px; height: 24px;
  border-radius: 3px;
  flex-shrink: 0;
}
.dwc-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.dwc-text strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dwc-text .text-muted {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Switch tabs (dashboard) */
.switch-tabs {
  display: inline-flex;
  background: var(--bg-dark);
  border-radius: 99px;
  padding: 3px;
}
.switch-tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-mute);
  font-family: inherit;
}
.switch-tab.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: var(--shadow);
}

/* Bouton favori */
.fav-btn {
  border: 1px solid var(--rule);
  background: var(--paper);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.fav-btn .fav-star {
  font-size: 1.3rem;
  color: var(--rule);
  line-height: 1;
}
.fav-btn:hover { border-color: var(--accent); }
.fav-btn.is-fav {
  background: var(--accent-light);
  border-color: var(--accent);
}
.fav-btn.is-fav .fav-star { color: var(--accent); }

/* ============= Hero d'une fiche cuvee ============= */
.wine-hero {
  display: flex;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.wine-hero-banner {
  flex: 0 0 280px;
  min-height: 360px;
  position: relative;
  background: linear-gradient(160deg,#faf6ed 55%,#f1e6d4 100%);
  border-right: 1px solid var(--rule);
}
.wine-hero-banner.no-img { background: linear-gradient(160deg,#faf6ed 55%,#f1e6d4 100%); }
.wine-hero-banner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 1;
  padding: 22px;
}
.wine-hero-body {
  flex: 1;
  min-width: 0;
  padding: 26px 28px;
}

/* ============= Numbering circles (carnet) ============= */
.wine-numero {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  flex-shrink: 0;
}
.wine-numero.rouge { background: var(--accent); }
.wine-numero.blanc { background: #b88a1a; }
.wine-numero.rose  { background: #b85a73; }
.wine-numero.effervescent { background: #c4a83a; }

/* ============= Auto-complete dropdown ============= */
.ac-dropdown {
  position: absolute;
  z-index: 1000;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  min-width: 180px;
}
.ac-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.92rem;
}
.ac-item:hover, .ac-item.active { background: var(--accent-light); }

/* ============= Utility ============= */
.text-muted { color: var(--ink-mute); }
.text-sm { font-size: 0.84rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.serif { font-family: var(--font-serif); }
.dashed-rule {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 18px 0;
}

/* ============= Responsive ============= */
@media (max-width: 680px) {
  .topbar-inner { padding: 10px 14px; gap: 8px; }
  .topbar-title { font-size: 1.4rem; width: 100%; }
  .topnav { width: 100%; gap: 4px; order: 3; }
  .topnav a { padding: 6px 10px; font-size: 0.9rem; flex: 1; text-align: center; }
  .topbar-actions { width: 100%; order: 2; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .wine-hero { flex-direction: column; }
  .wine-hero-banner {
    flex: none;
    width: 100%;
    min-height: 240px;
    height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.3rem; }
  .field-row { flex-direction: column; gap: 0; }
  .container, .container-narrow, .container-wide { padding: 14px; }
  .wine-card-img { width: 56px; height: 80px; }
  .wine-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .wine-tile-banner { height: 170px; }
  .wine-tile-body { padding: 11px 12px; }
  .wine-tile-name { font-size: 1rem; min-height: 2.5em; }
  .wine-hero-banner { min-height: 220px; height: 220px; }
  .wine-hero-body { padding: 18px 18px; }
  .search-hero { flex-direction: column; }
  .search-hero .btn { width: 100%; }
  .home-hero-title { font-size: 1.5rem; }
  .score-slider-value { font-size: 1.9rem; }
  .table { font-size: 0.86rem; }
  .table th, .table td { padding: 7px 8px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 420px) {
  .wine-grid { grid-template-columns: 1fr 1fr; }
  .topnav a { font-size: 0.8rem; padding: 6px 5px; }
}

/* ============= Liste utilisateurs ============= */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.user-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-card-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.user-card-link:hover { text-decoration: none; }
.user-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  flex-shrink: 0;
}
.user-card-body { flex: 1; min-width: 0; }
.user-card-name {
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.follow-btn.is-following {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Mini-bouteille (top sur l'accueil) */
.rank-bottle {
  width: 32px;
  height: 64px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%);
  border-radius: 4px;
  overflow: hidden;
}
.rank-bottle img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.rank-bottle .bottle-svg {
  position: static;
  transform: none;
  height: 90%;
  width: auto;
}

/* Mini-bouteille dans la liste des degustations */
.dwc-bottle {
  width: 26px;
  height: 52px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg,#faf6ed 60%,#f1e6d4 100%);
  border-radius: 3px;
  overflow: hidden;
}
.dwc-bottle img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.dwc-bottle .bottle-svg {
  position: static;
  transform: none;
  height: 92%;
  width: auto;
}

/* Onglet notification et badge */
.topnav-notif {
  padding: 6px 10px !important;
  font-size: 1.15rem !important;
  position: relative;
}
.topnav-notif:hover { background: var(--bg-dark); }
.notif-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
  vertical-align: super;
  margin-left: 2px;
}
.card-unread {
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
}
