/* ============================================
   SHOP - Editorial Commerce Design
   Design éditorial premium, loin des e-commerce génériques
   ============================================ */

/* ============================================
   HERO SHOP
   ============================================ */

.shop-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-white) 0%, var(--color-white-soft) 100%);
  overflow: hidden;
  padding-top: calc(80px + var(--space-12));
  padding-bottom: var(--space-12);
}

.shop-hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 147, 51, 0.08) 0%, transparent 70%);
  border-radius: var(--radius-full);
}

.shop-hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

/* ============================================
   CATALOGUE - Grille Éditoriale Asymétrique
   ============================================ */

.shop-catalog {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-10);
  align-items: start;
}

/* Sidebar Filters */
.shop-sidebar {
  position: sticky;
  top: calc(80px + var(--space-6));
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  box-shadow: var(--shadow-sm);
}

/* Sur desktop, garder le comportement normal */
@media (min-width: 1025px) {
  .shop-sidebar {
    position: sticky !important;
    top: calc(80px + var(--space-6)) !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

.shop-sidebar__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-gray-200);
}

.shop-filter-group {
  margin-bottom: var(--space-6);
}

.shop-filter-group__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-gray-700);
  margin-bottom: var(--space-3);
}

.shop-filter-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;
}

.shop-filter-item {
  display: flex;
  align-items: center;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background-color var(--duration-fast) var(--ease-smooth);
  cursor: pointer;
}

.shop-filter-item:hover {
  background-color: var(--color-gray-100);
}

.shop-filter-item.is-active {
  background: var(--gradient-fire-subtle);
  color: var(--color-accent-orange);
  font-weight: var(--weight-semibold);
}

/* ============================================
   GRILLE PRODUITS - Magazine Layout
   ============================================ */

.shop-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-8);
}

/* Featured product (plus large) */
.shop-products-grid > :first-child {
  grid-column: 1 / -1;
}

/* ============================================
   PRODUCT CARD - Editorial
   ============================================ */

.product-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-slow) var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
}

/* Image container */
.product-card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-gray-100);
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-smooth);
}

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

/* Badges */
.product-card__badges {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 2;
}

.product-badge {
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-radius: var(--radius-md);
  backdrop-filter: var(--backdrop-blur-md);
}

.product-badge--new {
  background: var(--gradient-fire);
  color: var(--color-white);
  box-shadow: var(--shadow-glow-fire);
}

.product-badge--discount {
  background: var(--color-accent-red);
  color: var(--color-white);
}

.product-badge--digital {
  background: rgba(0, 82, 165, 0.9);
  color: var(--color-white);
}

/* Content */
.product-card__content {
  padding: var(--space-6);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card__type {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-gray-600);
  margin-bottom: var(--space-2);
}

.product-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-black);
  margin-bottom: var(--space-3);
  line-height: var(--leading-tight);
}

.product-card__author {
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  margin-bottom: var(--space-4);
}

.product-card__excerpt {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-gray-600);
  margin-bottom: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-gray-200);
}

.product-card__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.product-card__price-current {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-primary);
}

.product-card__price-original {
  font-size: var(--text-base);
  color: var(--color-gray-500);
  text-decoration: line-through;
}

.product-card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  background: transparent;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--ease-smooth);
}

.product-card__cta:hover {
  color: var(--color-white);
  background: var(--color-primary);
  transform: translateX(4px);
}

/* ============================================
   PRODUCT CARD FEATURED (première du grid)
   ============================================ */

.product-card--featured {
  flex-direction: row;
  min-height: 400px;
}

.product-card--featured .product-card__media {
  aspect-ratio: auto;
  width: 45%;
  flex-shrink: 0;
}

.product-card--featured .product-card__content {
  width: 55%;
  padding: var(--space-9);
}

.product-card--featured .product-card__title {
  font-size: var(--text-3xl);
}

.product-card--featured .product-card__excerpt {
  -webkit-line-clamp: 4;
  font-size: var(--text-base);
}

/* ============================================
   PAGE PRODUIT DÉTAILLÉE
   ============================================ */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-11);
  align-items: start;
  margin-top: var(--space-10);
}

/* Gallery */
.product-gallery {
  position: sticky;
  top: calc(80px + var(--space-6));
}

.product-gallery__main {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  margin-bottom: var(--space-5);
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.product-gallery__thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--duration-base) var(--ease-smooth);
  border: 2px solid transparent;
}

.product-gallery__thumb:hover,
.product-gallery__thumb.is-active {
  opacity: 1;
  border-color: var(--color-primary);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info */
.product-info {
  padding-top: var(--space-6);
}

.product-info__type {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent-orange);
  margin-bottom: var(--space-3);
}

.product-info__title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.product-info__subtitle {
  font-size: var(--text-lg);
  color: var(--color-gray-700);
  margin-bottom: var(--space-6);
}

.product-info__meta {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-gray-200);
  border-bottom: 1px solid var(--color-gray-200);
  margin-bottom: var(--space-7);
}

.product-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.product-meta-item__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-gray-600);
}

.product-meta-item__value {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-black);
}

.product-info__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}

.product-info__price-current {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-extrabold);
  background: var(--gradient-fire);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.product-info__price-original {
  font-size: var(--text-2xl);
  color: var(--color-gray-500);
  text-decoration: line-through;
}

.product-info__actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-9);
}

.product-info__description {
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--color-gray-800);
  margin-bottom: var(--space-7);
}

/* ============================================
   MODAL TÉLÉCHARGEMENT
   ============================================ */

.download-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--backdrop-blur-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-smooth);
}

.download-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.download-modal__content {
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-9);
  max-width: 600px;
  width: 90%;
  box-shadow: var(--shadow-2xl);
  transform: scale(0.95);
  transition: transform var(--duration-base) var(--ease-bounce);
}

.download-modal.is-open .download-modal__content {
  transform: scale(1);
}

.download-modal__close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.download-modal__close:hover {
  background: var(--color-gray-200);
  transform: rotate(90deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Masquer le bouton toggle et le bouton fermeture sur desktop */
.shop-filters-toggle,
.shop-sidebar__close,
.shop-filters-backdrop {
  display: none;
}

@media (max-width: 1024px) {
  .shop-catalog {
    grid-template-columns: 1fr;
    position: relative;
  }

  /* Bouton pour afficher les filtres sur mobile/tablette */
  .shop-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--weight-medium);
    cursor: pointer;
    margin-bottom: var(--space-5);
    transition: all var(--duration-fast) var(--ease-smooth);
  }

  .shop-filters-toggle:hover {
    background: var(--color-primary-800);
    transform: translateY(-1px);
  }

  .shop-filters-toggle svg {
    width: 20px;
    height: 20px;
  }

  /* Backdrop pour le modal - doit être avant le modal dans le DOM */
  .shop-filters-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99998;
    pointer-events: none;
  }

  .shop-filters-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }

  /* Sidebar devient un modal centré sur mobile/tablette */
  .shop-sidebar {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    width: 90% !important;
    max-width: 500px !important;
    max-height: 85vh !important;
    background-color: var(--color-white) !important;
    box-shadow: var(--shadow-2xl) !important;
    border-radius: var(--radius-2xl) !important;
    padding: var(--space-9) var(--space-6) var(--space-6) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 99999 !important;
  }

  .shop-sidebar.is-open {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Bouton de fermeture dans le modal */
  .shop-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    background: var(--color-gray-100);
    border: none;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-smooth);
    z-index: 1;
  }

  .shop-sidebar__close:hover {
    background-color: var(--color-gray-200);
    transform: rotate(90deg);
  }

  .shop-sidebar__close svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-gray-700);
  }

  .product-card--featured {
    flex-direction: column;
  }

  .product-card--featured .product-card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .product-card--featured .product-card__content {
    width: 100%;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .product-gallery {
    position: static;
  }
}

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

  .product-info__title {
    font-size: var(--text-3xl);
  }

  .product-info__actions {
    flex-direction: column;
  }

  .product-info__actions .btn {
    width: 100%;
  }
}
