/* ================================
   AVENTICO GUIDE STYLES - VERSION OPTIMISÉE
   ================================ */

/* Smooth scroll global */
html {
  scroll-behavior: smooth;
}

/* Box sizing global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ================================
   LAYOUT PRINCIPAL
   ================================ */

.guide {
  background: var(--c-surface);
  min-height: 100vh;
}

.guide__container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
  width: 100%;
}

.guide__layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-10);
  align-items: start;
  margin: var(--space-8) 0;
  background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
  border-radius: 20px;
  padding: var(--space-8);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 6px rgba(0, 0, 0, 0.04);
}

/* ================================
   HEADER
   ================================ */

.guide__header {
  margin-bottom: var(--space-8);
}

.guide__breadcrumb {
  margin-bottom: var(--space-4);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: var(--c-muted);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__item:not(:last-child)::after {
  content: "→";
  margin-left: var(--space-2);
  color: var(--c-muted);
}

.breadcrumb__link {
  color: var(--c-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.breadcrumb__link:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.breadcrumb__item--current {
  color: var(--c-text);
  font-weight: 500;
}

/* Hero Image */
.guide__hero {
  position: relative;
  margin: var(--space-6) 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 21/9;
  background: linear-gradient(135deg, var(--c-bg) 0%, #f1f5f9 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.guide__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: contrast(1.05) saturate(1.1) brightness(0.95);
}

.guide__hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(16, 185, 129, 0.06) 35%,
    rgba(0, 0, 0, 0.2) 70%,
    rgba(0, 0, 0, 0.4) 100%
  );
  opacity: 0.8;
  pointer-events: none;
}

/* Header Content */
.guide__header-content {
  text-align: left;
}

.guide__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.guide__category-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--c-primary);
  color: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.guide__category-tag:hover {
  background: var(--c-primary);
  opacity: 0.9;
  text-decoration: none;
}

.guide__title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  background: linear-gradient(
    135deg,
    var(--c-text) 0%,
    var(--c-primary) 50%,
    #3b82f6 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.guide__excerpt {
  margin-bottom: var(--space-6);
}

.guide__excerpt p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--c-muted);
  margin: 0;
}

/* Categories & Meta */
.guide__categories-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.guide__meta-inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--c-muted);
}

.guide__meta-inline .guide__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.guide__meta-inline .guide__meta-label {
  font-weight: 500;
}

.guide__meta-inline .guide__meta-value {
  font-weight: 600;
  color: var(--c-text);
}

.guide__meta-separator {
  color: var(--c-text-muted);
  font-weight: bold;
}

/* ================================
   SIDEBAR STICKY
   ================================ */

.guide__sidebar {
  position: sticky;
  top: calc(80px + var(--space-4));
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ================================
   SIDEBAR CARDS - IDENTIQUE À MATERIEL
   ================================ */

.guide__sidebar-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: var(--space-5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 260px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.guide__toc-wrapper {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: var(--space-6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 260px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.toc {
  width: 100%;
}

.toc__header {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--c-primary), #3b82f6);
  color: white;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toc__list li {
  margin: 0;
  padding: 0;
}

.toc__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--c-text);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1.4;
  font-size: 14px;
  border-left: 3px solid transparent;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

.toc__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(135deg, var(--c-primary), #3b82f6);
  transition: width 0.3s ease;
  border-radius: 8px 0 0 8px;
}

.toc__link:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--c-primary);
  text-decoration: none;
  border-left-color: var(--c-primary);
  transform: translateX(2px);
}

.toc__link:hover::before {
  width: 4px;
}

.toc__link.active {
  background: var(--c-primary);
  color: white;
  font-weight: 600;
  border-left-color: var(--c-primary);
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.toc__link.active::before {
  width: 4px;
  background: rgba(255, 255, 255, 0.9);
}

/* ================================
   CONTENU PRINCIPAL
   ================================ */

.guide__content {
  max-width: 100%;
  background: white;
  border-radius: 16px;
  padding: var(--space-8);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow-x: hidden;
  word-wrap: break-word;
}

.guide__body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-text);
  max-width: 65ch;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Correction pour les H2/H3 - toujours visibles après clic */
.guide__body h2,
.guide__body h3 {
  scroll-margin-top: 120px;
  padding-top: 20px;
  margin-top: -20px;
  position: relative;
}

/* Style des H2 */
.guide__body h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide__body h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--c-primary);
}

/* ================================
   PRODUCTS CAROUSEL - IDENTIQUE À MATERIEL
   ================================ */

.products-carousel {
  margin: var(--space-8) 0;
  padding: 0;
}

.products-carousel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.products-carousel__title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--c-text);
  position: relative;
  padding-bottom: var(--space-2);
}

.products-carousel__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, var(--c-primary), #3b82f6);
  border-radius: 2px;
}

.products-carousel__controls {
  display: flex;
  gap: var(--space-2);
}

.products-carousel__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.2);
  background: white;
  color: var(--c-primary);
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.products-carousel__btn:hover {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.products-carousel__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.products-carousel__btn:disabled:hover {
  background: white;
  color: var(--c-primary);
  border-color: rgba(59, 130, 246, 0.2);
}

.products-carousel__wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: var(--space-4);
}

.products-carousel__track {
  display: flex;
  transition: transform 0.3s ease-out;
  gap: var(--space-4);
}

.products-carousel__slide {
  flex: 0 0 100%;
  min-width: 100%;
}

/* PRODUCT CARD HORIZONTAL COMPLETE - IDENTIQUE À MATERIEL */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.15s ease-out;
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 150px;
  width: 100%;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-color: rgba(59, 130, 246, 0.2);
}

.product-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-card__badge--essentiel {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
}
.product-card__badge--meilleur {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
}
.product-card__badge--premium {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: white;
}
.product-card__badge--budget {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
}
.product-card__badge--design {
  background: linear-gradient(135deg, #0073aa, #005a87);
  color: white;
}
.product-card__badge--robuste {
  background: linear-gradient(135deg, #374151, #1f2937);
  color: white;
}
.product-card__badge--top {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.product-card__image {
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  background: white;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.product-card__image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 25%,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 50%,
    transparent 75%,
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 12px 12px;
  opacity: 0.3;
  z-index: 1;
}

.product-card__image img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  object-position: center;
  transition: all 0.15s ease-out;
  z-index: 2;
  position: relative;
}

.product-card:hover .product-card__image img {
  transform: scale(1.05);
}

.product-card__image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--c-muted);
  z-index: 2;
  position: relative;
}

.product-card__image-placeholder svg {
  width: 32px;
  height: 32px;
}

.product-card__image-placeholder::after {
  content: "Image à venir";
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.7;
  font-weight: 500;
}

.product-card__content {
  flex: 1;
  padding: 12px 15px 12px 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.product-card__top {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__middle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.product-card__bottom {
  flex-shrink: 0;
  margin-top: auto;
}

.product-card__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--c-text);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  hyphens: auto;
}

.product-card__desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-muted);
  margin: 0;
  word-wrap: break-word;
  hyphens: auto;
  flex: 1;
  max-height: none;
  overflow: visible;
}

.product-card__price {
  font-size: 16px;
  font-weight: 800;
  color: var(--c-primary);
  margin: 0;
}

.product-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #ff9500, #ff6b00);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s ease-out;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
  align-self: flex-start;
}

.product-card__btn:hover {
  background: linear-gradient(135deg, #ff6b00, #e55a00);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
  text-decoration: none;
  color: white;
}

.product-card__btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.15s ease-out;
}

.product-card__btn:hover svg {
  transform: translate(1px, -1px);
}

/* Product rating dans le carousel */
.product-card .product-rating {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.product-card .product-rating .rating-stars {
  font-size: 11px;
}

.product-card .product-rating .rating-text {
  font-size: 11px;
  color: var(--c-muted);
  white-space: nowrap;
}

/* Points de navigation */
.products-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.products-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.products-carousel__dot.active {
  background: var(--c-primary);
  transform: scale(1.2);
}

.products-carousel__dot:hover {
  background: var(--c-primary);
}

/* ================================
   PRODUCTS CAROUSEL DOTS - SPÉCIFIQUE
   ================================ */

.products-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) 0;
}

.products-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.products-carousel__dot.active {
  background: var(--c-primary);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.products-carousel__dot:hover {
  background: var(--c-primary);
  transform: scale(1.1);
}

/* Responsive pour les dots de produits */
@media (max-width: 768px) {
  .products-carousel__dots {
    gap: var(--space-1);
    margin-top: var(--space-3);
  }

  .products-carousel__dot {
    width: 8px;
    height: 8px;
  }

  .products-carousel__dot.active {
    transform: scale(1.2);
  }
}

/* ================================
   RESPONSIVE - IDENTIQUE À MATERIEL
   ================================ */

@media (max-width: 1024px) {
  .guide__layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
    margin: var(--space-6) 0;
  }

  .guide__content {
    padding: var(--space-6);
  }

  .guide__sidebar {
    position: static;
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  .guide__toc-wrapper {
    max-width: 280px;
    margin: 0;
    padding: var(--space-4);
  }

  .guide__hero {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 768px) {
  .guide__container {
    padding: 0 var(--space-3);
  }

  .guide__layout {
    padding: var(--space-4);
    margin: var(--space-4) 0;
    border-radius: 12px;
  }

  .guide__sidebar {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .guide__toc-wrapper {
    max-width: 90%;
    margin: 0;
    padding: var(--space-4);
    border-radius: 12px;
  }

  .guide__content {
    padding: var(--space-5);
    border-radius: 12px;
  }

  .guide__body {
    font-size: 16px;
    max-width: none;
  }

  .guide__title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .guide__categories-meta {
    flex-direction: column;
    gap: var(--space-2);
  }

  .guide__hero {
    aspect-ratio: 16/9;
    margin: var(--space-4) 0;
  }
}

@media (max-width: 480px) {
  .guide__container {
    padding: 0 var(--space-2);
  }

  .guide__body {
    font-size: 15px;
  }

  .guide__toc-wrapper {
    max-width: 95%;
    margin: 0;
    padding: var(--space-3);
    border-radius: 8px;
  }

  .breadcrumb {
    font-size: 13px;
  }

  .guide__categories {
    justify-content: center;
  }

  /* Product cards responsive */
  .product-card {
    min-height: 140px;
  }

  .product-card__image {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    margin: 8px;
  }

  .product-card__content {
    padding: 8px 12px 8px 0;
    gap: 4px;
  }

  .product-card__title {
    font-size: 14px;
    line-height: 1.1;
  }

  .product-card__desc {
    font-size: 12px;
    line-height: 1.2;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .product-card__price {
    font-size: 14px;
    margin: 2px 0;
  }

  .product-card__btn {
    padding: 6px var(--space-2);
    font-size: 11px;
    gap: 4px;
  }

  .product-card__badge {
    top: 6px;
    left: 6px;
    padding: 3px 6px;
    font-size: 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
  }

  .products-carousel__header {
    flex-direction: column;
    gap: var(--space-3);
    align-items: center;
    text-align: center;
  }

  .products-carousel__title {
    font-size: 22px;
  }
}
