@import url('./tokens.css');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--dl-font-sans);
  background-color: #f7f8fa;
  color: var(--dl-ink);
  line-height: 1.5;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- SVG Vector Icons & Status Dots --- */
.ui-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green { background-color: var(--dl-green-dark); }
.dot-amber { background-color: #d97706; }
.dot-red { background-color: var(--dl-wine); }

/* --- Container Application --- */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  background: #f7f8fa;
  position: relative;
}

@media (min-width: 960px) {
  .app-container {
    max-width: 1180px;
  }
}

/* --- Header Charte Divine Loire (Mockups Desktop 1280 & Mobile 390) --- */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  z-index: 100;
  min-height: 56px;
  box-sizing: border-box;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  gap: 8px;
}

.brand-logo-text {
  font-family: var(--dl-font-serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-word-divine { 
  color: #1c1a17;
}

.brand-word-loire { 
  color: var(--dl-green);
}

.brand-app-badge {
  background: var(--dl-green);
  color: #ffffff;
  font-family: var(--dl-font-sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 2.5px 6.5px;
  border-radius: var(--radius-pill);
  line-height: 1.1;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-search-wrap {
  flex: 1;
  max-width: 620px;
  display: none;
}

@media (min-width: 680px) {
  .header-search-wrap {
    display: block;
  }
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13.5px;
  outline: none;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 13px center;
  transition: all 0.2s ease;
  color: var(--dl-ink);
  box-sizing: border-box;
}

.search-input:focus-visible {
  border-color: var(--dl-green);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(62, 201, 154, 0.2);
}

/* Header Right Group */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch-toggle {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 2.5px;
  border-radius: var(--radius-pill);
  border: 1px solid #cbd5e1;
}

.lang-toggle-btn {
  background: none;
  border: none;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dl-muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.lang-toggle-btn.active {
  background: #ffffff;
  color: var(--dl-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.pass-badge {
  background: #ffffff;
  border: 1.5px solid #d97706;
  color: #b45309;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
}

.pass-badge:hover {
  background: #fffbeb;
  transform: translateY(-1px);
}

/* --- Barre de Filtres & Contrôles sur FOND CRÈME DOUX (Mockup 4b) --- */
.controls-panel {
  background: #FAF8F5; /* Fond crème doux remplaçant le trait vert */
  padding: 12px 18px 12px;
  border-bottom: 1px solid #EDE8DF;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}

.mobile-search-box {
  width: 100%;
  display: block;
}

@media (min-width: 680px) {
  .mobile-search-box {
    display: none;
  }
}

.key-filters-row {
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.key-filters-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px 4px 2px;
  width: 100%;
  flex-wrap: nowrap;
}
.key-filters-scroll::-webkit-scrollbar {
  display: none;
}

.chip-filter-btn {
  background: #ffffff;
  border: 1.2px solid #e2e8f0;
  padding: 6.5px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: #1c1a17;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.chip-filter-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.chip-filter-btn.btn-all {
  background: #1c1a17;
  border-color: #1c1a17;
  color: #ffffff;
  font-weight: 700;
}

.chip-filter-btn.btn-gps {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
  font-weight: 700;
}

.chip-filter-btn.active:not(.btn-all):not(.btn-gps) {
  background: #fee2e2;
  border-color: #b91c1c;
  color: #991b1b;
  font-weight: 700;
}

.btn-more-filters-icon {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1c1a17;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.btn-more-filters-icon:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-more-filters-icon.has-active {
  background: #ffffff;
  border-color: var(--dl-wine);
  color: var(--dl-wine);
}

.filter-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--dl-wine);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

/* Ligne Dédiée : Compteur & Toggle Liste/Carte */
.sub-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.results-count-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.results-count-text {
  font-size: 14px;
  color: #475569;
  font-weight: 600;
}

.results-count-text strong {
  color: #1c1a17;
  font-weight: 800;
}

.btn-reset-filters-inline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-reset-filters-inline:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.view-toggle {
  display: flex;
  background: #ede9e1;
  padding: 3px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.toggle-btn {
  border: none;
  background: none;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn.active {
  background: #ffffff;
  color: #1c1a17;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* --- Contenu & Grille de Cartes (Mockup 01) --- */
.content-area {
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding: 16px 18px 80px;
}

.cards-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- CARTE VIGNERON (Vue Liste - Strict Mockup 01 Optimisé Mobile & Desktop) --- */
.winery-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

@media (min-width: 600px) {
  .winery-card {
    padding: 16px 20px;
    gap: 9px;
  }
}

.winery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* --- NOUVELLE CARTE VIGNERON (Mockup Slogan & AOP) --- */
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.card-logo-thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}

.card-logo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-domaine-title {
  font-family: var(--dl-font-serif);
  font-size: 20px;
  font-weight: 800;
  color: #1c1a17;
  line-height: 1.2;
}

.card-commune-green {
  font-size: 13.5px;
  font-weight: 700;
  color: #047857;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.card-header-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.card-stat-price {
  font-size: 15px;
  font-weight: 800;
  color: #1c1a17;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-stat-distance {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* Citation Slogan (Persona Malcolm) */
.card-slogan-quote {
  border-left: 3.5px solid var(--dl-wine);
  padding-left: 12px;
  margin: 10px 0 12px;
  font-family: var(--dl-font-serif);
  font-style: italic;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.42;
  color: #1c1a17;
}

/* Flux Unifié des Tags (AOP, Types de Vins & Badges sur la même ligne) */
.card-tags-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 10px 0 14px;
}

.aop-pill {
  background: #ffffff;
  border: 1.2px solid #fecdd3;
  border-radius: var(--radius-pill);
  padding: 0 8px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #881337;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(136, 19, 55, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
}

.aop-pill:hover {
  background: #fff1f2;
  border-color: #fda4af;
  transform: translateY(-1px);
}

.aop-pill.active {
  background: #881337 !important;
  border-color: #881337 !important;
  color: #ffffff !important;
}

.aop-pill.active .aop-tag-prefix {
  color: #fecdd3 !important;
}

.aop-pill.active .aop-name {
  color: #ffffff !important;
}

.aop-tag-prefix {
  font-size: 9px;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aop-name {
  color: #881337;
  font-weight: 700;
}

.badge-tag-pill,
.dl-wine-pill {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  height: 22px;
  box-sizing: border-box;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  border: none;
  user-select: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.badge-tag-pill:hover,
.dl-wine-pill:hover {
  transform: translateY(-1px);
}

.badge-tag-pill.active,
.dl-wine-pill.active {
  box-shadow: 0 0 0 2px currentColor;
  font-weight: 800;
}

.dl-wine-pill {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.dl-wine-pill:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.dl-wine-pill.active {
  background: #ffffff;
  color: var(--dl-ink);
  box-shadow: 0 0 0 2px var(--dl-ink);
  font-weight: 800;
}

.badge-tag-blue { background: #eef2ff; color: #3730a3; }
.badge-tag-green { background: #ecfdf5; color: #065f46; }
.badge-tag-amber { background: #fef3c7; color: #92400e; }
.badge-tag-orange { background: #fff7ed; color: #c2410c; }
.badge-tag-red { background: #fee2e2; color: #991b1b; }
.badge-tag-purple { background: #f5f3ff; color: #5b21b6; }
.badge-tag-teal { background: #f0fdfa; color: #0f766e; }

.dl-wine-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-blanc-sec { background-color: var(--wine-blanc-sec); }
.dot-tendre { background-color: var(--wine-tendre); }
.dot-moelleux { background-color: var(--wine-moelleux); }
.dot-petillant { background-color: var(--wine-petillant); }
.dot-rose { background-color: var(--wine-rose); }
.dot-rouge { background-color: var(--wine-rouge); }

/* Pied de Carte : Statut & 2 CTAs non compressés */
.card-bottom-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: 2px;
}

.card-status-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}

.card-status-open {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.3;
}

.card-status-details {
  font-size: 12.5px;
  color: var(--dl-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.status-detail-item {
  display: inline-flex;
  align-items: center;
  color: #475569;
  font-weight: 500;
}

.status-detail-sep {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.card-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-actions-row.single-action {
  grid-template-columns: 1fr;
}

.btn-card-call {
  background: #ffffff;
  border: 1.5px solid var(--dl-wine);
  color: var(--dl-wine);
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-card-call:hover {
  background: var(--dl-wine-light);
}

.btn-card-view {
  background: var(--dl-wine);
  border: 1.5px solid var(--dl-wine);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-card-view:hover {
  background: var(--dl-wine-hover);
  border-color: var(--dl-wine-hover);
}

@media (min-width: 580px) {
  .card-bottom-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .card-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .btn-card-call,
  .btn-card-view {
    height: auto;
    padding: 6px 14px;
  }
}

/* --- CARTE VIGNERON SUR CARTE LEAFLET (Vue Map) --- */
.map-winery-card {
  padding: 18px 20px 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.map-domaine-title {
  font-family: var(--dl-font-serif);
  font-size: 21px;
  font-weight: 800;
  color: var(--dl-ink);
  line-height: 1.2;
}

.map-aoc-highlight {
  color: var(--dl-aoc);
  font-weight: 800;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.card-meta-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: #334155;
  line-height: 1.4;
}

.map-meta-lines-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.card-bottom-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn-card-call-full {
  background: #ffffff;
  border: 2px solid var(--dl-wine);
  color: var(--dl-wine);
  font-size: 14.5px;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-card-call-full:hover {
  background: var(--dl-wine-light);
}

.btn-card-view-full {
  background: var(--dl-wine);
  border: 2px solid var(--dl-wine);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-card-view-full:hover {
  background: #731818;
  border-color: #731818;
}

.map-winery-card {
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 18px 20px 16px !important;
  background: #ffffff !important;
}

/* --- MODALE DE DÉTAIL / FICHE DOMAINE (Alignement Haut Sécurisé) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(28, 26, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: flex-start; /* ALIGNÉ SUR LE HAUT DU VIEWPORT */
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 20px)) 12px calc(24px + env(safe-area-inset-bottom, 16px));
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .modal-overlay {
    padding: 36px 20px;
  }
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 580px;
  height: auto;
  max-height: calc(100dvh - max(44px, env(safe-area-inset-top, 44px)) - 24px);
  max-height: calc(100vh - 68px);
  border-radius: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 24px;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.35);
  animation: fadeInModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 24px;
    padding: 0 24px 30px;
  }
}

@keyframes fadeInModal {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-top-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 14px 0 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-drag-handle {
  width: 42px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
}

.modal-close-btn {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dl-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.modal-close-btn:hover,
.modal-close-btn:active {
  background: #e2e8f0;
  border-color: var(--dl-ink);
  color: var(--dl-ink);
  transform: scale(1.05);
}

.btn-modal-close-bottom {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--dl-ink);
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.15s ease;
}

.btn-modal-close-bottom:hover,
.btn-modal-close-bottom:active {
  background: #f1f5f9;
  border-color: var(--dl-ink);
  color: var(--dl-ink);
  transform: translateY(-1px);
}

#modal-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 4px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.badge-tag-blue { background: #eef2ff; color: #3730a3; }
.badge-tag-green { background: #ecfdf5; color: #065f46; }
.badge-tag-amber { background: #fef3c7; color: #92400e; }
.badge-tag-orange { background: #fff7ed; color: #c2410c; }
.badge-tag-purple { background: #f5f3ff; color: #5b21b6; }
.badge-tag-red { background: #fee2e2; color: #991b1b; }
.badge-tag-teal { background: #ecfdf5; color: #065f46; }
.badge-tag-cyan { background: #e0f2fe; color: #0369a1; }
.badge-tag-slate { background: #f1f5f9; color: #334155; }
.badge-tag-rose { background: #ffe4e6; color: #be123c; }

/* Badges dans la Modale (Fond bleu clair officiel & cartes blanches) */
.modal-dvl-badges-block {
  background: #F0F6FC;
  border: 1px solid #D0E1F2;
  border-radius: 14px;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-dvl-badges-grid,
.modal-badge-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

@media (max-width: 540px) {
  .modal-dvl-badges-grid,
  .modal-badge-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.modal-badge-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.badge-circle-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
}

.badge-circle-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.badge-wrap-blue { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.badge-wrap-green { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-wrap-red { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-wrap-orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge-wrap-purple { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.badge-wrap-cyan { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge-wrap-slate { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-wrap-rose { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }

.badge-card-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--dl-ink);
  line-height: 1.2;
}

.badge-card-desc {
  font-size: 12px;
  color: var(--dl-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* Encarts Info & Avertissements Contextuels (Harmonieux selon le conteneur) */
.modal-schedule-extra-box {
  font-size: 12px;
  line-height: 1.4;
  color: #92400e;
  background: #fffdf5;
  border: 1px dashed #f3d59b;
  padding: 9px 12px;
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 2px;
}

.modal-schedule-warning-box {
  font-size: 12px;
  line-height: 1.4;
  color: #78716c;
  background: #faf7f2;
  border: 1px dashed #d8cfc4;
  padding: 9px 12px;
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.modal-badges-notice-box,
.modal-badges-notice-footer,
.modal-certification-notice {
  font-size: 12px;
  line-height: 1.4;
  color: #334155;
  background: rgba(255, 255, 255, 0.95);
  border: 1px dashed #bfd7f0;
  padding: 9px 12px;
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* En-tête Modale */
.modal-header-section {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 28px;
}

.modal-logo-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fafafa;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}
.modal-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.modal-domaine-title {
  font-family: var(--dl-font-serif);
  font-size: 23px;
  font-weight: 700;
  color: var(--dl-ink);
  line-height: 1.15;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  color: #334155;
  margin: 3px 0 6px;
}

.modal-vigneron-name {
  font-weight: 800;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-vigneron-name svg {
  color: #1e293b;
}

.modal-meta-sep {
  color: #94a3b8;
  font-weight: 400;
  font-size: 14px;
}

.modal-hectares-pill {
  background: #f0f4f8;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
}

.modal-fondation-txt {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.modal-aoc-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--dl-aoc);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.modal-address-line {
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Bloc Présentation du Domaine */
.modal-presentation-box {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 16px 18px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-box-header-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.modal-editorial-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--dl-ink);
}

/* Bloc Visite du Domaine (Horaires & Activités) */
.modal-horaires-activites-box {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-schedule-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--dl-ink);
  line-height: 1.35;
}

.modal-activities-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.modal-activities-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-activity-pill {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: default;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

/* 3 Boutons d'Action Harmonisé (Mockup 02 & Pilules Propres) */
.modal-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-action-primary {
  background: var(--dl-wine);
  color: #ffffff;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-action-primary:hover {
  background: var(--dl-wine-hover);
}

.btn-action-outline {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--dl-ink);
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-action-outline:hover {
  border-color: var(--dl-ink);
  background: #f8fafc;
}

/* Note Ouvertures Exceptionnelles / Saisonnières */
.modal-schedule-extra-pill {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #92400e;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
  margin: 4px 0 3px;
}

/* Avertissement Bienveillant Horaires Vignerons */
.modal-schedule-warning-box {
  background: #faf7f2;
  border: 1px dashed #d6ccc0;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  color: #78716c;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.35;
  margin-top: 8px;
}

/* --- PANNEAU DE FILTRES REPLIABLE (Mockup 05) --- */
.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 23, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .filter-drawer-overlay {
    align-items: center;
    padding: 20px;
  }
}

.filter-drawer-content {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  padding: 24px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .filter-drawer-content {
    border-radius: 20px;
  }
}

.filter-group-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.filter-group-header {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--dl-ink);
}

.filter-group-desc {
  font-size: 12px;
  color: var(--dl-muted);
  margin-top: -3px;
}

.filter-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Format standard des tags du tiroir (Convention de design unifiée) */
.filter-chip-btn {
  background: #ffffff;
  border: 1.5px solid var(--dl-border);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--dl-ink);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-chip-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.filter-chip-btn.active {
  background: var(--dl-wine-light);
  border-color: var(--dl-wine);
  color: var(--dl-wine);
  font-weight: 700;
}

.filter-chip-btn svg {
  color: inherit;
}

/* --- VUE CARTE LEAFLET (Mockup 04) --- */
#map-view-container {
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 520px;
  position: relative;
  display: none;
}

#map-view {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border-radius: var(--radius-md);
}

/* Légende Dynamique des Statuts & Filtre Interactif Carte */
.map-legend-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 800;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-pill);
  padding: 4px 8px 4px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dl-ink);
  pointer-events: auto;
}

.legend-filter-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dl-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.legend-filter-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.legend-filter-btn.active {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
}

.legend-dot {
  width: 8.5px;
  height: 8.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot.dot-open { background-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25); }
.legend-dot.dot-rdv { background-color: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25); }
.legend-dot.dot-closed { background-color: #8b1e2f; box-shadow: 0 0 0 2px rgba(139, 30, 47, 0.25); }

/* Bouton Flottant Recenter GPS */
.map-recenter-btn {
  position: absolute;
  bottom: 24px;
  right: 14px;
  z-index: 800;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dl-ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-recenter-btn:hover {
  background: #f8fafc;
  border-color: var(--dl-ink);
  transform: scale(1.06);
}

/* User Location Pulsing Dot */
.user-gps-marker {
  width: 16px;
  height: 16px;
  background: #2563eb;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
  animation: pulseUserGps 2s infinite;
}

@keyframes pulseUserGps {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Clusters Leaflet personnalisés aux couleurs Divine Loire */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(62, 201, 154, 0.25) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: #3EC99A !important;
  color: #ffffff !important;
  font-family: var(--dl-font-sans) !important;
  font-weight: 800 !important;
  font-size: 12px !important;
}

.map-floating-card {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 460px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.25), 0 6px 12px -4px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--dl-border);
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: slideUpCard 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpCard {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.map-card-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1f5f9;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dl-muted);
  z-index: 10;
  transition: all 0.15s ease;
}

.map-card-close-btn:hover {
  background: #e2e8f0;
  color: var(--dl-ink);
}
