/* ── Variables ── */
:root {
  --bg:           #f2f4f7;
  --surface:      #ffffff;
  --surface2:     #f7f8fa;
  --border:       #e3e6ec;
  --text:         #1c1e24;
  --text-muted:   #6b7280;
  --blue:         #2563eb;
  --red:          #ef4444;
  --green:        #16a34a;
  --orange:       #f97316;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --radius:       10px;
  --transition:   all 0.25s ease;
}
.dark-mode {
  --bg:           #111318;
  --surface:      #1c1f26;
  --surface2:     #23272f;
  --border:       #2e323c;
  --text:         #e8eaf0;
  --text-muted:   #9ca3af;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,.4);
}

/* ── Reset base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0; padding: 0;
  font-size: 15px;
  transition: var(--transition);
}

/* ── Layout 3 colonnes ── */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 14px;
  align-items: start;
  margin-top: 1.5rem;
  padding: 0 12px 3rem;
}
.center-column { min-width: 30%;
                }

/* ── Titre section ── */
.section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .6rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--border);
}

/* ── Carousel principal ── */
.promo-carousel {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Card principale ── */
.carousel-slide {
  display: grid;
  grid-template-columns: 110px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
  position: relative;
  user-select: none;
}
.carousel-slide:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}
/* 1er clic : card sélectionnée */
.carousel-slide.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18), var(--shadow-md);
  background: rgba(37,99,235,.03);
}
/* Indice double-clic */
.slide-hint {
  font-size: .58rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .2s;
  margin-top: .15rem;
}
.carousel-slide.is-selected .slide-hint {
  opacity: 1;
}

/* Thumbnail */
.image-container {
  position: relative;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.carousel-slide img {
  width: 145px;
  height: 100px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0; padding: 0;
  transition: transform .25s ease;
}
.carousel-slide:hover img { transform: scale(1.04); }

.nom-commerce {
  font-size: .62rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(37,99,235,.08);
  border: none;
  box-shadow: none;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: background .15s, color .15s;
}
.nom-commerce:hover {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

.nom-utilisateur {
  font-size: .58rem;
  color: var(--text-muted);
  border: none;
  box-shadow: none;
  background: none;
  padding: 2px 4px;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: background .15s, color .15s;
}
.nom-utilisateur:hover  {
      background: var(--orange);
  color: #fff;
  text-decoration: none;
}


/* Body card */
.post-details {
  padding: .5rem .65rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
}
.titre-container {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  min-width: 0;
}
.titre-container h3 {
  flex: 1;
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}
.duree {
  font-size: .62rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.post-details > p {
  font-size: .75rem;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Prix */
.prix-container {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.prix-promo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
}
.prix-habituel {
  font-size: .78rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.reduction {
  font-size: .72rem;
  font-weight: 700;
  color: var(--red);
  background: rgba(239,68,68,.1);
  border-radius: 4px;
  padding: 1px 5px;
}
.livraison {
  font-size: .72rem;
  color: var(--green);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Boutons */
.boutons-container {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.btn-sauvegarde, .btn-validation, .btn-signalement,
.btn-partager, .btn-commenter, .btn-site {
  font-size: .90rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: none;
  transition: background .15s, color .15s, transform .15s;
  display: flex;
  align-items: center;
  gap: 3px;
}
.btn-sauvegarde:hover, .btn-validation:hover, .btn-commenter:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-signalement:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-partager:hover    { background: var(--green);  color: #fff; border-color: var(--green); }
.btn-site:hover        { background: var(--blue);   color: #fff; border-color: var(--blue); }
.btn-sauvegarde:hover, .btn-validation:hover, .btn-signalement:hover,
.btn-partager:hover, .btn-commenter:hover, .btn-site:hover { transform: scale(1.06); }

/* ── Encart publicitaire ── */
.pub-encart {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border-radius: var(--radius);
  padding: 1rem;
  color: #fff;
  text-align: center;
  font-size: .8rem;
  box-shadow: var(--shadow-md);
  border: none;
  position: relative;
  overflow: hidden;
}
.pub-encart::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}
.pub-encart::after {
  content: '';
  position: absolute;
  bottom: -20px; left: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.pub-encart .pub-label {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: .4rem;
}
.pub-encart .pub-titre {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .5rem;
}
.pub-encart .pub-sous {
  font-size: .72rem;
  opacity: .85;
  margin-bottom: .75rem;
}
.pub-encart .pub-btn {
  display: inline-block;
  background: #fff;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 700;
  padding: .4rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  transition: transform .2s;
  position: relative;
  z-index: 1;
}
.pub-encart .pub-btn:hover { transform: scale(1.05); text-decoration: none; }

/* ── Contrôles nav ── */
.carousel-controls {
  margin-top: .75rem;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.carousel-controls .prev,
.carousel-controls .next {
  font-size: .78rem;
  font-weight: 600;
  padding: .4rem 1.1rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.carousel-controls .prev:hover,
.carousel-controls .next:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ── Sidebars ── */
.similar-carousel, .commerce-carousel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.similar-slide, .commerce-slide {
  display: grid;
  grid-template-columns: 72px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.similar-slide:hover, .commerce-slide:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text);
  text-decoration: none;
}
.similar-slide img, .commerce-slide img {
  width: 72px;
  height: 56px;
  object-fit: cover;
  display: block;
  margin: 0; padding: 0;
  border-radius: 0;
}
.similar-slide .details,
.commerce-slide .details {
  padding: .3rem .45rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.similar-slide .details h5,
.commerce-slide .details h5 {
  font-size: .7rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.similar-slide .details .prix-promo,
.commerce-slide .details .prix-promo {
  font-size: .8rem;
  font-weight: 700;
  color: var(--blue);
}
.commerce-slide .details .nomcommerce {
  font-size: .62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 180px 1fr 180px; }
}
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 0 8px 2rem;
  }
  .left-column, .right-column { display: none; }
  .carousel-slide { grid-template-columns: 90px 1fr; }
  .carousel-slide img { width: 100px; height: 80px; }
}
.btn-sauvegarde, .btn-validation, .btn-signalement,
.btn-partager, .btn-commenter, .btn-site {
  font-size: .85rem;
   padding: 4px 8px;
   gap: 6px;
}

@media (max-width: 480px) {
  .carousel-slide { grid-template-columns: 75px 1fr; }
  .carousel-slide img { width: 90px; height: 70px; }
  .titre-container h3 { font-size: .8rem; }
  .prix-promo { font-size: .95rem; }
  .boutons-container { gap: 3px; }
  .btn-sauvegarde, .btn-validation, .btn-signalement,
  .btn-partager, .btn-commenter, .btn-site { padding: 5px 9px; font-size: .75rem; gap: 3px;}
}