/* ============================================================
   PRIX CIGARES — Design luxe & élégant
   Police : Playfair Display (titres) + Inter (corps)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ---- Variables ---- */
:root {
  --bg:          #0b0904;
  --bg-surface:  #161008;
  --bg-card:     #1e1609;
  --bg-card-h:   #26200e;
  --bg-input:    #140e06;
  --gold:        #c9a84c;
  --gold-l:      #e2c97a;
  --gold-d:      #8c6e27;
  --gold-dim:    rgba(201,168,76,.15);
  --text:        #f0ead8;
  --text-muted:  #8a7654;
  --text-hint:   #554433;
  --border:      #2e2310;
  --border-l:    #3d3118;
  --red:         #8b1a1a;
  --green:       #2d6a2d;
  --shadow:      0 8px 32px rgba(0,0,0,.7);
  --shadow-sm:   0 2px 12px rgba(0,0,0,.5);
  --radius:      4px;
  --radius-lg:   8px;
  --transition:  .2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Texture subtile */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%230b0904'/%3E%3Crect x='0' y='0' width='1' height='1' fill='%23120d06' opacity='.4'/%3E%3C/svg%3E");
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-l); }

img { display: block; max-width: 100%; }

/* ============================================================
   MODAL VÉRIFICATION D'ÂGE
   ============================================================ */
#age-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
#age-modal.hidden { display: none; }

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--gold-d);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow), 0 0 80px rgba(201,168,76,.08);
  position: relative;
}

.modal-ornament {
  font-size: 2.8rem;
  margin-bottom: 1.2rem;
  filter: sepia(1) brightness(1.2);
}

.modal-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: .5rem;
  letter-spacing: .04em;
}

.modal-box .modal-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}

.modal-divider {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-d), transparent);
  margin: 0 auto 1.8rem;
}

.modal-box p {
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  font-size: .95rem;
}

.modal-box .modal-question {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: .75rem;
  flex-direction: column;
}

.btn-age-yes {
  background: linear-gradient(135deg, var(--gold-d), var(--gold));
  color: #0b0904;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  padding: .9rem 2rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-age-yes:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,168,76,.35);
}

.btn-age-no {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  padding: .75rem 2rem;
  cursor: pointer;
  font-size: .85rem;
  transition: all var(--transition);
}
.btn-age-no:hover { border-color: var(--text-muted); color: var(--text); }

.modal-legal {
  margin-top: 1.5rem;
  font-size: .75rem;
  color: var(--text-hint);
  font-style: italic;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.site-logo a { color: inherit; display: flex; flex-direction: column; }
.logo-main {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .06em;
}
.logo-sub {
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 5px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.last-update {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: right;
}
.last-update strong { color: var(--gold-d); display: block; font-size: .8rem; }

/* ============================================================
   HERO / BARRE DE RECHERCHE
   ============================================================ */
.hero {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem 3rem;
  text-align: center;
}

.hero-eyebrow {
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: .8rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 2rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 2.5rem;
}

.search-wrapper {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

#search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: .9rem 1.1rem .9rem 2.8rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#search-input:focus {
  border-color: var(--gold-d);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
#search-input::placeholder { color: var(--text-hint); }

.search-clear {
  position: absolute;
  right: .8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: .2rem;
  display: none;
}
.search-clear.visible { display: block; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.main-layout {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  gap: 2rem;
  padding: 2rem;
}

/* ---- Sidebar filtres ---- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
}

.filter-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.filter-title {
  font-family: 'Playfair Display', serif;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

.filter-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
  cursor: pointer;
}
.filter-item input[type="radio"],
.filter-item input[type="checkbox"] {
  accent-color: var(--gold);
  cursor: pointer;
}
.filter-item label {
  font-size: .875rem;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1;
}
.filter-item:hover label { color: var(--text); }
.filter-item.active label { color: var(--gold); font-weight: 500; }

.price-range {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.price-input {
  width: 80px;
  background: var(--bg-input);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .85rem;
  padding: .4rem .6rem;
  outline: none;
}
.price-input:focus { border-color: var(--gold-d); }

.price-sep { color: var(--text-hint); font-size: .8rem; }

.sort-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .875rem;
  padding: .5rem .7rem;
  outline: none;
  cursor: pointer;
  appearance: none;
}
.sort-select:focus { border-color: var(--gold-d); }

/* ---- Zone produits ---- */
.products-area { flex: 1; min-width: 0; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.results-count {
  font-size: .875rem;
  color: var(--text-muted);
}
.results-count strong { color: var(--gold); }

/* ---- Grille produits ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

/* ---- Carte produit ---- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-d), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.product-card:hover {
  border-color: var(--border-l);
  background: var(--bg-card-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm), 0 0 20px rgba(201,168,76,.06);
}
.product-card:hover::before { opacity: 1; }

.card-brand {
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-d);
  font-weight: 500;
}

.card-name {
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}

.card-category {
  font-size: .7rem;
  color: var(--text-hint);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.card-prices {
  margin-top: .4rem;
  padding-top: .8rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .5rem;
}

.price-unit {
  display: flex;
  flex-direction: column;
}
.price-label { font-size: .65rem; color: var(--text-hint); letter-spacing: .08em; text-transform: uppercase; }
.price-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.price-value.secondary { font-size: 1rem; color: var(--text-muted); }
.box-price { display: block; margin-top: .5rem; }

.card-variation {
  font-size: .7rem;
  padding: .2rem .5rem;
  border-radius: 3px;
  font-weight: 500;
  white-space: nowrap;
}
.var-up   { background: rgba(139,26,26,.2); color: #e05c5c; }
.var-down { background: rgba(45,106,45,.2); color: #5cb85c; }
.var-same { background: rgba(90,80,60,.2);  color: var(--text-muted); }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .875rem;
  padding: .4rem .8rem;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 36px;
  text-align: center;
}
.page-btn:hover { border-color: var(--gold-d); color: var(--gold); }
.page-btn.active { background: var(--gold-d); border-color: var(--gold-d); color: #0b0904; font-weight: 600; }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---- États vides / chargement ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-hint);
  grid-column: 1 / -1;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-h) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 180px;
  border-radius: var(--radius-lg);
}

/* ============================================================
   PAGE PRODUIT
   ============================================================ */
.product-page { max-width: 900px; margin: 2.5rem auto; padding: 0 2rem 4rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 2rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--gold); }

.product-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.product-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-d) 30%, var(--gold) 50%, var(--gold-d) 70%, transparent);
}

.product-hero-brand {
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-d);
  margin-bottom: .6rem;
}

.product-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text);
  line-height: 1.25;
  margin-bottom: .6rem;
}

.product-hero-category {
  font-size: .75rem;
  color: var(--text-hint);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.product-prices-row {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.product-price-block { display: flex; flex-direction: column; gap: .2rem; }
.product-price-label {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.product-price-main {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.product-price-main.secondary { font-size: 1.6rem; color: var(--text); }
.product-price-sub { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

.product-meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.meta-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .3rem .8rem;
  font-size: .78rem;
  color: var(--text-muted);
}
.meta-chip strong { color: var(--text); }

/* ---- Graphique historique ---- */
.history-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
}

.chart-container { position: relative; height: 280px; }

.history-table {
  margin-top: 1.5rem;
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.history-table th {
  text-align: left;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.history-table td {
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg-card); }
.history-table .price-col { color: var(--gold); font-weight: 500; }

/* ============================================================
   SOURCE OFFICIELLE
   ============================================================ */
.source-banner {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem;
  text-align: center;
  margin-top: auto;
}
.source-banner p { font-size: .8rem; color: var(--text-muted); line-height: 1.7; }
.source-banner a { color: var(--gold-d); }
.source-banner a:hover { color: var(--gold); }
.source-banner .source-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--text-hint);
  margin-bottom: .4rem;
  letter-spacing: .08em;
}

/* ============================================================
   BANDEAU AVERTISSEMENT SANITAIRE (Loi Évin)
   ============================================================ */
.health-warning {
  background: #111;
  border-top: 2px solid #333;
  text-align: center;
  padding: .55rem 2rem;
}
.health-warning p {
  font-size: .72rem;
  color: #aaa;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--gold-d);
  border-radius: var(--radius);
  padding: .8rem 1.6rem;
  font-size: .875rem;
  color: var(--text);
  z-index: 500;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .main-layout { flex-direction: column; padding: 1rem; }
  .sidebar { width: 100%; }
  .filter-section { padding: 1rem; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 600px) {
  .hero { padding: 2rem 1rem; }
  .header-inner { padding: 0; height: 60px; }
  .logo-main { font-size: 1.2rem; }
  .header-meta { display: none; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .product-card { padding: 1rem; }
  .product-hero { padding: 1.5rem; }
  .product-prices-row { gap: 1.5rem; }
  .history-section { padding: 1.5rem; }
  .product-page { padding: 0 1rem 3rem; }
}

@media (max-width: 600px) {
  .health-warning { padding: .35rem 1rem; }
  .health-warning p { font-size: .6rem; letter-spacing: .02em; }
}

@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr; }
}
