/* ═══════════════════════════════════════════════════════
   SENVIRTUEL v2 — Page Boutique + Produit
═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────
   LAYOUT BOUTIQUE (sidebar + grille)
───────────────────────────────────────────────────── */
.shop-page {
  padding: var(--sp-6) 0 var(--sp-12);
}

.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--sp-8);
  align-items: start;
}

@media (max-width: 960px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
  .shop-sidebar {
    display: none;
  }
  .shop-sidebar.mobile-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    overflow-y: auto;
    background: var(--bg);
    padding: var(--sp-6) var(--sp-5);
    animation: slideInRight 0s both; /* override with left slide */
  }
}

/* ─────────────────────────────────────────────────────
   SIDEBAR FILTRES
───────────────────────────────────────────────────── */
.shop-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--catbar-h) + var(--sp-4));
  max-height: calc(100dvh - var(--header-h) - var(--catbar-h) - var(--sp-8));
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.filter-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.filter-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.filter-block-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--txt-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-block-clear {
  font-size: var(--text-xs);
  color: var(--primary);
  cursor: pointer;
}
.filter-block-clear:hover { text-decoration: underline; }

.filter-block-body {
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Filter options */
.filter-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}
.filter-option input { display: none; }
.filter-checkbox {
  width: 18px; height: 18px;
  border: 2px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  transition: all var(--dur-fast) var(--ease);
}
.filter-option input:checked ~ .filter-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-option-label {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--txt-2);
}
.filter-option-count {
  font-size: var(--text-xs);
  color: var(--txt-3);
}

/* Range de prix */
.price-range {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.price-range-inputs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.price-range-inputs .form-input {
  height: 36px;
  font-size: var(--text-sm);
  text-align: center;
}
.price-range-sep { color: var(--txt-3); font-size: var(--text-sm); }

/* Slider de prix */
.price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--val, 50%), var(--border) var(--val, 50%), var(--border) 100%);
  border-radius: var(--r-full);
  outline: none;
}
.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────────────
   BARRE D'OUTILS BOUTIQUE
───────────────────────────────────────────────────── */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.shop-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.shop-results-count {
  font-size: var(--text-sm);
  color: var(--txt-2);
}
.shop-results-count strong { color: var(--txt-1); }

.shop-filter-btn {
  display: none;
}
@media (max-width: 960px) {
  .shop-filter-btn { display: flex; }
}

.shop-sort {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.shop-sort label {
  font-size: var(--text-sm);
  color: var(--txt-2);
  white-space: nowrap;
}
.shop-sort select {
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--txt-1);
  font-size: var(--text-sm);
}

.shop-view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 2px;
}
.shop-view-btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--txt-3);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.shop-view-btn.active { background: var(--primary); color: #fff; }

/* Active filters chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 10px;
  background: var(--primary-soft);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  color: var(--primary);
  font-weight: 500;
}
.active-filter-chip button {
  color: currentColor;
  font-size: 14px;
  opacity: 0.7;
  line-height: 1;
}
.active-filter-chip button:hover { opacity: 1; }

/* List view vs Grid view */
.products-grid.list-view {
  grid-template-columns: 1fr;
}
.products-grid.list-view .product-card {
  flex-direction: row;
}
.products-grid.list-view .product-card-img {
  width: 160px;
  aspect-ratio: 1;
  flex-shrink: 0;
}
.products-grid.list-view .product-card-body {
  padding: var(--sp-4) var(--sp-5);
}
.products-grid.list-view .product-card-footer {
  border-top: none;
  border-left: 1px solid var(--border);
  padding: var(--sp-4);
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 140px;
}
@media (max-width: 600px) {
  .products-grid.list-view .product-card { flex-direction: column; }
  .products-grid.list-view .product-card-img { width: 100%; }
  .products-grid.list-view .product-card-footer { border: none; border-top: 1px solid var(--border); flex-direction: row; min-width: auto; }
}

/* ─────────────────────────────────────────────────────
   PAGE PRODUIT
───────────────────────────────────────────────────── */
.product-page {
  padding: var(--sp-6) 0 var(--sp-12);
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: var(--sp-10);
  align-items: start;
}
@media (max-width: 1024px) {
  .product-layout { grid-template-columns: 1fr 360px; gap: var(--sp-6); }
}
@media (max-width: 768px) {
  .product-layout { grid-template-columns: 1fr; }
}

/* Galerie */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: sticky;
  top: calc(var(--header-h) + var(--catbar-h) + var(--sp-4));
}

.product-main-img {
  aspect-ratio: 16/9;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.product-main-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.product-thumbnails {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.product-thumbnails::-webkit-scrollbar { display: none; }
.product-thumb {
  width: 72px;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--dur-fast) var(--ease);
}
.product-thumb.active,
.product-thumb:hover { border-color: var(--primary); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Infos produit */
.product-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.product-info-header { display: flex; flex-direction: column; gap: var(--sp-3); }

.product-info-category {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-info-name {
  font-family: var(--font-display);
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 800;
  color: var(--txt-1);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.product-info-rating {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.product-info-stars {
  display: flex;
  gap: 2px;
  color: var(--warning);
  font-size: 16px;
}
.product-info-rating-text {
  font-size: var(--text-sm);
  color: var(--txt-2);
}
.product-info-rating-count {
  font-size: var(--text-sm);
  color: var(--txt-3);
  text-decoration: underline;
  cursor: pointer;
}
.product-info-rating-count:hover { color: var(--primary); }

/* Prix */
.product-pricing {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.product-price-display {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.product-price-current {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--txt-1);
  letter-spacing: -0.02em;
}
.product-price-original {
  font-size: var(--text-lg);
  color: var(--txt-3);
  text-decoration: line-through;
}
.product-price-discount {
  background: var(--success-soft);
  color: var(--success);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* Variants (durée abonnement) */
.product-variants {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.product-variants-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--txt-2);
}

/* CTA */
.product-cta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.product-cta-row {
  display: flex;
  gap: var(--sp-3);
}
.product-cta .btn-primary { flex: 1; height: 52px; font-size: var(--text-base); }
.product-cta .btn-secondary { width: 52px; flex-shrink: 0; }

/* Garanties */
.product-guarantees {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.product-guarantee {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--txt-2);
}
.product-guarantee svg { color: var(--success); flex-shrink: 0; }

/* Description longue */
.product-description {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
}
.product-description-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--txt-1);
  margin-bottom: var(--sp-4);
}
.product-description-body {
  font-size: var(--text-sm);
  color: var(--txt-2);
  line-height: 1.8;
}
.product-description-body h3 { color: var(--txt-1); margin: var(--sp-4) 0 var(--sp-2); }
.product-description-body ul { list-style: disc; padding-left: var(--sp-5); display: flex; flex-direction: column; gap: 4px; }
.product-description-body strong { color: var(--txt-1); }

/* Features list */
.product-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
@media (max-width: 480px) {
  .product-features { grid-template-columns: 1fr; }
}
.product-feature {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--txt-1);
}
.product-feature-icon {
  width: 32px; height: 32px;
  background: var(--primary-soft);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────
   SECTION AVIS
───────────────────────────────────────────────────── */
.reviews-section {
  margin-top: var(--sp-10);
}

.reviews-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-8);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-6);
}
@media (max-width: 600px) {
  .reviews-summary { grid-template-columns: 1fr; }
}

.reviews-score {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.reviews-score-value {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  color: var(--txt-1);
  line-height: 1;
}
.reviews-score-stars {
  display: flex;
  gap: 3px;
  color: var(--warning);
  font-size: 20px;
}
.reviews-score-count {
  font-size: var(--text-sm);
  color: var(--txt-3);
}

.reviews-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  justify-content: center;
}
.review-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.review-bar-label {
  font-size: var(--text-xs);
  color: var(--txt-3);
  white-space: nowrap;
  width: 40px;
  text-align: right;
}
.review-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.review-bar-fill {
  height: 100%;
  background: var(--warning);
  border-radius: var(--r-full);
  transition: width 0.5s var(--ease);
}
.review-bar-count {
  font-size: var(--text-xs);
  color: var(--txt-3);
  width: 24px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}

/* ─────────────────────────────────────────────────────
   PRODUITS SIMILAIRES
───────────────────────────────────────────────────── */
.related-section { margin-top: var(--sp-12); }

/* ─────────────────────────────────────────────────────
   PAGE CHECKOUT
───────────────────────────────────────────────────── */
.checkout-page {
  padding: var(--sp-6) 0 var(--sp-12);
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary-col { order: -1; }
}

.checkout-form { display: flex; flex-direction: column; gap: var(--sp-6); }

.checkout-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.checkout-section-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.checkout-section-num {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.checkout-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--txt-1);
}
.checkout-section-body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Méthodes de paiement */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.payment-method {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.payment-method:hover { border-color: var(--border-2); }
.payment-method.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.payment-method input[type="radio"] { display: none; }

.payment-method-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.payment-method-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--txt-1);
}
.payment-method-desc {
  font-size: var(--text-xs);
  color: var(--txt-3);
}

/* ─────────────────────────────────────────────────────
   PAGE SUCCÈS COMMANDE
───────────────────────────────────────────────────── */
.order-success-page {
  min-height: 60dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) 0;
}
.order-success-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
}
.order-success-icon {
  width: 72px; height: 72px;
  background: var(--success-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--success);
  animation: fadeInScale var(--dur-slow) var(--ease) both;
}
.order-success-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--txt-1);
}
.order-success-desc {
  font-size: var(--text-sm);
  color: var(--txt-2);
  line-height: 1.6;
}
.order-success-id {
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--txt-1);
  width: 100%;
  text-align: center;
}
.order-success-cta {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: center;
}
