/* ==========================================================================
   CATALOGUE - Grille optimisée selon normes UX/UI 2025
   Palette couleurs : #015769 (vert), #f8f8d9 (jaune paille), #f8f8d9 (crème)
   Design premium pour catalogue d'art artisanal
   ========================================================================== */

/* PAGE HEADER */
.page-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 2rem 0;
  background: linear-gradient(135deg, rgba(255, 251, 233, 0.3), transparent);
}

.page-title {
  font-family: "Abhaya Libre", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: #015769;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

/* PAGE INTRO */
.page-intro {
  background: linear-gradient(135deg, #f8f8d9, #f8f4d0);
  padding: 2rem;
  border-radius: 12px;
  border: 2px solid #f8f8d9;
  margin-bottom: 2.5rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(240, 225, 136, 0.25);
}

.page-intro p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.6;
  color: #015769;
  margin-bottom: 0.8rem;
  font-weight: 400;
}

.page-intro p:last-child {
  margin-bottom: 0;
}

/* CATALOGUE GRID - Optimisé normes 2025 pour art */
.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 0;
}

/* PRODUCT CARD - Design premium 2025 */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(1, 87, 105, 0.06), 0 1px 3px rgba(1, 87, 105, 0.1),
    0 0 0 1px rgba(240, 225, 136, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  opacity: 0;
  isolation: isolate;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Éliminer tous les espaces parasites dans les cartes */
.product-card * {
  box-sizing: border-box;
}

.product-card::before,
.product-card::after {
  display: none; /* Supprimer tout pseudo-élément */
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(1, 87, 105, 0.12),
    0 4px 8px rgba(1, 87, 105, 0.08), 0 0 0 1px rgba(240, 225, 136, 0.4);
}

.product-card:focus-within {
  outline: 2px solid rgba(240, 225, 136, 0.8);
  outline-offset: 2px;
}

/* PRODUCT CARD MEDIA - Ratio optimal pour art décoratif */
.product-card__media {
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  /* background: linear-gradient(135deg, #f8f8d9, #f8f4d0); */
  margin-top: -10%;
  padding: 0;
  border-radius: 12px 12px 0 0;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(1.02) saturate(1.03);
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: top;
  line-height: 0;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.product-card__image[src$=".webp"] {
  image-rendering: auto;
}

.product-card:hover .product-card__image {
  transform: scale(1.02);
  filter: brightness(1.04) saturate(1.1);
}

.product-card__no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #f8f8d9, #f8f8d9);
  color: #015769;
  font-style: italic;
  font-size: 1rem;
  font-weight: 500;
}

/* PRODUCT CARD NAVIGATION - Discret et élégant */
.product-card__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card:hover .product-card__nav,
.product-card:focus-within .product-card__nav {
  opacity: 1;
  pointer-events: auto;
}

.product-card__nav-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #015769;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: #015769;
  box-shadow: 0 3px 8px rgba(1, 87, 105, 0.15);
  z-index: 10;
  backdrop-filter: blur(6px);
}

.product-card__nav-btn:hover,
.product-card__nav-btn:focus {
  background: #f8f8d9;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(1, 87, 105, 0.25);
  outline: none;
}

.product-card__nav-btn svg {
  width: 16px;
  height: 16px;
}

/* PRODUCT CARD CONTENT - Layout optimisé */
.product-card__content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* PRODUCT CARD HEADER - Hiérarchie claire */
.product-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0;
}

.product-card__title {
  font-family: "Abhaya Libre", serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
  color: #015769;
  margin: 0;
  line-height: 1.2;
  flex: 1;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PRODUCT CARD THUMBNAILS - Minimalistes et fonctionnelles */
.product-card__thumbnails {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
  align-items: center;
}

.product-card__thumbnail {
  position: relative;
  width: 32px;
  height: 24px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-card__thumbnail:hover,
.product-card__thumbnail:focus {
  transform: scale(1.15);
  border-color: #015769;
  box-shadow: 0 3px 8px rgba(1, 87, 105, 0.25);
  z-index: 5;
  outline: none;
}

.product-card__thumbnail--active {
  border-color: #015769;
  background: #f8f8d9;
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(1, 87, 105, 0.2);
}

.product-card__thumbnail--active:hover,
.product-card__thumbnail--active:focus {
  transform: scale(1.2);
}

.product-card__thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

/* PRODUCT CARD EXCERPT - Concise */
.product-card__excerpt {
  color: #666;
  line-height: 1.4;
  font-size: 0.85rem;
  font-weight: 400;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PRODUCT CARD DETAILS - Informations essentielles */
.product-card__details {
  background: linear-gradient(
    135deg,
    rgba(255, 251, 233, 0.5),
    rgba(248, 244, 208, 0.3)
  );
  padding: 0.8rem;
  border-radius: 8px;
  border-left: 3px solid #f8f8d9;
  backdrop-filter: blur(2px);
  margin: 0;
}

.product-card__detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.product-card__detail:last-child {
  margin-bottom: 0;
}

.product-card__detail-label {
  font-weight: 500;
  color: #666;
}

.product-card__detail-value {
  color: #333;
  font-weight: 600;
  text-align: right;
}

.product-card__detail--price .product-card__detail-value {
  font-weight: 700;
  color: #015769;
  font-size: 0.95rem;
}

/* NO PRODUCTS STATE */
.no-products {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #f8f8d9, #f8f4d0);
  border-radius: 16px;
  border: 2px solid #f8f8d9;
  margin-top: 2rem;
  box-shadow: 0 8px 24px rgba(240, 225, 136, 0.2);
  grid-column: 1 / -1;
}

.no-products__title {
  font-family: "Abhaya Libre", serif;
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  color: #015769;
  margin-bottom: 1rem;
  font-weight: 600;
}

.no-products__text {
  color: #666;
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* ANIMATIONS */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.product-card--animate {
  animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* RESPONSIVE DESIGN - Grille adaptative optimisée */

/* Large Desktop (1400px+) : 5 cartes */
@media (min-width: 1400px) {
  .catalogue-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
  }
}

/* Desktop (1200-1400px) : 4 cartes */
@media (min-width: 1200px) and (max-width: 1399px) {
  .catalogue-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* Medium Desktop (900-1199px) : 3 cartes */
@media (min-width: 900px) and (max-width: 1199px) {
  .catalogue-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

/* Tablet (600-899px) : 2 cartes */
@media (min-width: 600px) and (max-width: 899px) {
  .catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-card__content {
    padding: 1rem;
  }
}

/* Mobile (< 600px) : 1 carte */
@media (max-width: 599px) {
  .catalogue-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .page-header {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }

  .page-intro {
    margin-bottom: 2rem;
    padding: 1.5rem;
  }

  .product-card__content {
    padding: 1rem;
    gap: 0.6rem;
  }

  .product-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .product-card__thumbnails {
    align-self: flex-end;
  }

  .product-card__nav-btn {
    width: 32px;
    height: 32px;
  }

  .product-card__nav-btn svg {
    width: 14px;
    height: 14px;
  }

  .product-card__thumbnail {
    width: 28px;
    height: 21px;
  }

  .product-card__detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    font-size: 0.75rem;
  }

  .product-card__detail--price .product-card__detail-value {
    font-size: 0.85rem;
  }
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card__nav-btn,
  .product-card__thumbnail,
  .product-card__image {
    transition: none;
  }

  .product-card--animate {
    animation: none;
    opacity: 1;
  }

  .product-card:hover .product-card__image {
    transform: none;
  }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
  .product-card {
    border: 2px solid #015769;
  }

  .product-card__thumbnail {
    border-width: 2px;
  }
}

/* TOUCH DEVICES */
@media (hover: none) and (pointer: coarse) {
  .product-card__nav {
    opacity: 1;
    pointer-events: auto;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 251, 233, 0.9) 100%
    );
    padding: 0.5rem 1rem 0.3rem;
    border-radius: 0 0 8px 8px;
    backdrop-filter: blur(4px);
  }

  .product-card__nav-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
  }

  .product-card__thumbnail {
    min-height: 44px;
    min-width: 44px;
  }

  .product-card:hover {
    transform: none;
  }
}

/* PRINT STYLES */
@media print {
  .product-card__nav,
  .product-card__thumbnails {
    display: none;
  }

  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================================================================
   LIGHTBOX MODERNE 2025 - Visualisation premium des œuvres
   ========================================================================== */

/* LIGHTBOX CONTAINER */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* Background plus subtil et neutre */
  backdrop-filter: blur(20px) saturate(180%); /* Blur intense et saturation */
  -webkit-backdrop-filter: blur(20px) saturate(180%); /* Support Safari */
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.lightbox--active {
  opacity: 1;
}

/* LIGHTBOX CONTENT */
.lightbox__content {
  background: white;
  border-radius: 16px;
  border: 2px solid #f8f8d9;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(1, 87, 105, 0.3),
    0 8px 20px rgba(1, 87, 105, 0.2);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox--active .lightbox__content {
  transform: scale(1);
}

/* LIGHTBOX CLOSE BUTTON */
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.25); /* Plus opaque pour visibilité */
  border: 2px solid rgba(255, 255, 255, 0.6); /* Border plus visible */
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  color: white; /* Blanc pour contraster avec le blur */
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Ombres multiples pour visibilité */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Ombre du texte */
}

.lightbox__close:hover,
.lightbox__close:focus {
  background: rgba(240, 225, 136, 0.4); /* Plus opaque au hover */
  border-color: rgba(240, 225, 136, 0.8);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(240, 225, 136, 0.3);
  outline: none;
  color: #015769; /* Vert foncé au hover */
  text-shadow: none; /* Pas d'ombre si fond coloré */
}

/* LIGHTBOX MEDIA */
.lightbox__media {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f8d9, #f8f4d0);
  overflow: hidden;
  min-height: 400px;
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  cursor: zoom-in;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(1, 87, 105, 0.15);
  /* Rendu optimal pour haute qualité */
  image-rendering: auto;
  image-rendering: high-quality;
}

/* LIGHTBOX NAVIGATION */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  pointer-events: none;
}

.lightbox__nav-btn {
  background: rgba(255, 255, 255, 0.25); /* Plus opaque pour visibilité */
  border: 2px solid rgba(255, 255, 255, 0.6); /* Border plus visible */
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white; /* Blanc pour contraster */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Ombres multiples */
  z-index: 10;
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  pointer-events: auto;
}

.lightbox__nav-btn:hover,
.lightbox__nav-btn:focus {
  background: rgba(240, 225, 136, 0.4); /* Plus opaque au hover */
  border-color: rgba(240, 225, 136, 0.8);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(240, 225, 136, 0.3);
  outline: none;
  color: #015769; /* Vert foncé au hover */
}

.lightbox__nav-btn:active {
  transform: scale(1.05);
}

.lightbox__nav-btn svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); /* Ombre pour visibilité */
}

/* ZOOM HINT */
.lightbox__zoom-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.3); /* Plus subtil */
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lightbox__media:hover .lightbox__zoom-hint {
  opacity: 1;
}

/* LIGHTBOX INFO */
.lightbox__info {
  padding: 2rem;
  background: white;
  border-top: 1px solid rgba(240, 225, 136, 0.3);
}

.lightbox__title {
  font-family: "Abhaya Libre", serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
  color: #015769;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lightbox__details {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.lightbox__detail {
  font-size: 1rem;
  color: #666;
  font-weight: 500;
}

.lightbox__detail--price {
  color: #015769;
  font-weight: 700;
  font-size: 1.2rem;
}

.lightbox__counter {
  background: linear-gradient(
    135deg,
    rgba(255, 251, 233, 0.6),
    rgba(248, 244, 208, 0.4)
  );
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid #f8f8d9;
  display: inline-block;
  font-size: 0.9rem;
  color: #015769;
  font-weight: 600;
}

/* RESPONSIVE LIGHTBOX */
@media (max-width: 768px) {
  .lightbox {
    padding: 1rem;
  }

  .lightbox__content {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 12px;
  }

  .lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .lightbox__media {
    min-height: 300px;
  }

  .lightbox__nav {
    padding: 0 1rem;
  }

  .lightbox__nav-btn {
    width: 48px;
    height: 48px;
  }

  .lightbox__nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .lightbox__info {
    padding: 1.5rem;
  }

  .lightbox__details {
    flex-direction: column;
    gap: 0.5rem;
  }

  .lightbox__zoom-hint {
    display: none; /* Masquer sur mobile */
  }
}

@media (max-width: 480px) {
  .lightbox {
    padding: 0.5rem;
  }

  .lightbox__content {
    border-radius: 8px;
  }

  .lightbox__media {
    min-height: 250px;
  }

  .lightbox__nav-btn {
    width: 44px;
    height: 44px;
  }

  .lightbox__nav-btn svg {
    width: 18px;
    height: 18px;
  }

  .lightbox__info {
    padding: 1rem;
  }
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__content,
  .lightbox__image,
  .lightbox__nav-btn,
  .lightbox__close {
    transition: none;
  }

  .lightbox__zoom-hint {
    display: none;
  }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
  .lightbox {
    background: rgba(0, 0, 0, 0.8); /* Plus opaque en mode high contrast */
    backdrop-filter: blur(5px); /* Blur réduit pour la lisibilité */
    -webkit-backdrop-filter: blur(5px);
  }

  .lightbox__content {
    border: 3px solid #f8f8d9; /* Border jaune visible */
  }

  .lightbox__close,
  .lightbox__nav-btn {
    background: rgba(255, 255, 255, 0.9); /* Plus opaque */
    border: 2px solid #015769;
    color: #015769;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .lightbox__zoom-hint {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid white;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* KEYBOARD FOCUS */
.lightbox:focus {
  outline: none;
}

.lightbox__close:focus-visible,
.lightbox__nav-btn:focus-visible {
  outline: 3px solid #f8f8d9;
  outline-offset: 2px;
}
