/* ========================================
   VARIABLES CSS
   ======================================== */
:root {
  --page-w: 794px;
  --text: #111;
  --muted: #666;
  --thumb-w: 80px;
  --thumb-pad: 0px;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f4f6;
}

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */
.tarifs-page {
  width: var(--page-w);
  margin: 0 auto;
  background: #fff;
  padding: 24px 28px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

/* ========================================
   EN-TÊTE
   ======================================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
  text-align: left;
}

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-logo {
  width: 160px;
  height: auto;
  display: block;
}

.header-slogan {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.header-right {
  text-align: right;
  margin-top: 0;
  padding-top: 0;
}

.header-right h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.header-right p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ========================================
   SECTIONS
   ======================================== */
.tarifs-section-title {
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 0;
}

/* ========================================
   RANGÉES DE TARIFS
   ======================================== */
.tarifs-row {
  display: flex;
  gap: 12px;
  border: 1.5px solid #111;
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0;
  align-items: stretch;
}

.avoid-break {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Vignette d'étiquette */
.thumb {
  width: var(--thumb-w);
  flex: 0 0 var(--thumb-w);
  align-self: stretch;
  height: auto;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  padding: var(--thumb-pad);
  box-sizing: border-box;
  margin-top: 0;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contenu principal de la rangée */
.tarifs-main {
  flex: 1;
  min-width: 0;
}

/* ========================================
   INFORMATIONS CUVÉE (haut de rangée)
   ======================================== */
.row-top {
  display: grid;
  grid-template-columns: 18ch auto minmax(0, 1fr);
  gap: 4px;
  align-items: baseline;
  margin-bottom: 6px;
}

.cuvee {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.millesime {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.appelation {
  font-weight: 700;
  text-align: right;
  justify-self: end;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 11px;
}

/* ========================================
   TARIFS ET INFORMATIONS (bas de rangée)
   ======================================== */
.row-bottom {
  display: grid;
  grid-template-columns: auto 280px;
  column-gap: 12px;
  align-items: stretch;
}

.row-bottom .formats {
  align-self: start;
}

/* ========================================
   TABLEAU DE PRIX
   ======================================== */
.price-table {
  width: auto;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.price-table th,
.price-table td {
  padding: 2px 10px 2px 0;
  white-space: nowrap;
}

/* En-têtes de colonnes */
.price-table thead th {
  padding-top: 2px;
  padding-bottom: 2px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  text-align: right;
  font-weight: 600;
  color: var(--muted);
}

.price-table thead th:first-child {
  text-align: left;
  padding-left: 0;
  padding-right: 14px;
}

/* Labels de formats (75cl, 150cl) */
.price-table tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding-left: 0;
  padding-right: 14px;
}

/* Cellules de prix */
.price-table tbody td {
  text-align: right;
  font-weight: 700;
}

/* Largeurs de colonnes */
.price-table col.c-format {
  width: 52px;
}

.price-table col.c-p1 {
  width: 80px;
}

.price-table col.c-p2 {
  width: 80px;
}

.price-table col.c-p3 {
  width: 80px;
}

/* Masquage des colonnes inutilisées */
.price-table[data-cols="1"] col.c-p2,
.price-table[data-cols="1"] col.c-p3 {
  width: 1px;
}

.price-table[data-cols="2"] col.c-p3 {
  width: 1px;
}

.price-table td.empty,
.price-table td:empty {
  padding-left: 0;
  padding-right: 0;
}

/* En-têtes spéciaux selon le nombre de colonnes */
.price-table[data-cols="1"] thead th {
  padding: 0;
  height: 6px;
  line-height: 6px;
  font-size: 0;
}

.price-table[data-cols="3"] thead th:nth-child(n+2) {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-align: right;
}

/* ========================================
   INFORMATIONS COMPLÉMENTAIRES (cépages)
   ======================================== */
.row-bottom .informations {
  width: 280px;
  min-width: 0;
  text-align: left;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 14px;
  color: #222;
}

.row-bottom .informations .cepages {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   PIED DE PAGE
   ======================================== */
.tarifs-footer-box {
  margin-top: 16px;
  border: 1.5px solid #111;
  border-radius: 12px;
  padding: 12px;
  font-size: 11px;
}

.footer {
  margin-top: 14px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

/* ========================================
   BLOC INFORMATIONS COMPLÉMENTAIRES
   ======================================== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;  /* Ajoutez cette ligne */
}

.info-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: baseline;
}

.info-label {
  font-weight: 700;
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
  width: 200px;  /* Largeur fixe pour aligner tous les liens */
  flex-shrink: 0;  /* Empêche le label de rétrécir */
}

.info-content {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}

.info-content a {
  color: #0066cc;
  text-decoration: none;
}

.info-content a:hover {
  text-decoration: underline;
}

.info-note {
  color: var(--muted);
  font-style: italic;
  font-size: 10px;
  margin-left: 4px;
}

.info-right {
  display: flex;
  align-items: start;
}

.colisage-box {
  padding: 0;  /* Supprimez le padding */
  border-radius: 8px;
  text-align: left;
  font-size: 11px;
  line-height: 1.6;
}

.colisage-box strong {
  font-weight: 700;
  font-size: 12px;
}

/* ========================================
   BOUTON IMPRESSION PDF
   ======================================== */
.btn-export-pdf {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: #111;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-export-pdf:hover {
  background: #333;
}

/* Masquer le bouton à l'impression */
@media print {
  .btn-export-pdf {
    display: none;
  }
}

/* ========================================
   IMPRESSION (format A4)
   ======================================== */
@page {
  size: A4 portrait;
  margin: 5mm;
}

@media print {
  .tarifs-page {
    padding: 14px 24px;
  }

  .tarifs-row {
    margin: 3px 0;
    padding: 7px;
  }

  .tarifs-section-title {
    margin: 6px 0 3px;
    font-size: 13px;
  }

  .header {
    margin-bottom: 6px;
  }

  .tarifs-footer-box {
    margin-top: 8px;
    padding: 7px;
  }

  .footer {
    margin-top: 6px;
    font-size: 9px;
  }

  .price-table th,
  .price-table td {
    padding: 1px 8px 1px 0;
  }

  .row-bottom {
    margin-top: 3px;
  }
}
