/* ==========================================================================
   GiftChoice – Front-Office UI  ·  v2.0
   Design premium & accessible – PrestaShop 1.7 / 8.x
   ========================================================================== */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --gc-accent:        #2d8653;   /* vert CBD */
  --gc-accent-dark:   #1e5e3a;
  --gc-accent-light:  #e8f5ee;
  --gc-gold:          #f0a500;
  --gc-text:          #1a1a2e;
  --gc-muted:         #6b7280;
  --gc-estimated:     #FF5722;
  --gc-border:        #e5e7eb;
  --gc-bg-card:       #ffffff;
  --gc-overlay-bg:    rgba(10, 10, 20, 0.65);
  --gc-radius-modal:  20px;
  --gc-radius-card:   14px;
  --gc-radius-btn:    50px;
  --gc-shadow-modal:  0 24px 64px rgba(0,0,0,0.28), 0 4px 16px rgba(0,0,0,0.12);
  --gc-shadow-card:   0 2px 12px rgba(0,0,0,0.07);
  --gc-t:             0.22s ease;
}

/* ── Overlay ────────────────────────────────────────────────────────────── */
.gc-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: var(--gc-overlay-bg) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: gcFadeIn 0.2s ease forwards;
}

@keyframes gcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.gc-modal {
  background: #fff !important;
  border-radius: var(--gc-radius-modal) !important;
  box-shadow: var(--gc-shadow-modal) !important;
  width: 100% !important;
  max-width: 780px !important;
  max-height: 88vh !important;
  overflow: hidden !important;
  overflow-y: auto !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  animation: gcSlideUp 0.32s cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
}

@keyframes gcSlideUp {
  from { transform: translateY(48px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Scrollbar discrète */
.gc-modal::-webkit-scrollbar { width: 4px; }
.gc-modal::-webkit-scrollbar-track { background: transparent; }
.gc-modal::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.gc-modal-header {
  padding: 20px 32px 20px !important;
  text-align: center !important;
  position: relative !important;
  background: linear-gradient(160deg, #f0faf4 0%, #fff 60%) !important;
  border-bottom: 1px solid #e9f5ee !important;
  flex-shrink: 0 !important;
}

.gc-modal-header-icon {
  font-size: 52px !important;
  line-height: 1 !important;
  margin-bottom: 12px !important;
  display: block !important;
  animation: gcWobble 2.4s ease-in-out infinite !important;
}

@keyframes gcWobble {
  0%, 100% { transform: rotate(-4deg) scale(1);   }
  25%       { transform: rotate( 4deg) scale(1.1); }
  50%       { transform: rotate(-2deg) scale(1.05);}
  75%       { transform: rotate( 2deg) scale(1.08);}
}

.gc-modal-title {
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  color: var(--gc-text) !important;
  margin: 0 0 6px !important;
  letter-spacing: -0.3px !important;
  line-height: 1.2 !important;
}

.gc-modal-subtitle-estimated {
  font-size: 1.05rem !important;
  color: var(--gc-estimated) !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.gc-modal-subtitle {
  font-size: 0.97rem !important;
  color: var(--gc-muted) !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.gc-modal-subtitle strong {
  color: var(--gc-accent) !important;
  font-weight: 700 !important;
}

/* ── Bouton fermer ──────────────────────────────────────────────────────────────── */
#gc-close-btn,
.gc-close-btn {
  all: unset !important;
  position: absolute !important;
  top: 12px !important;
  right: 14px !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  color: #9ca3af !important;
  transition: background var(--gc-t), color var(--gc-t), transform var(--gc-t) !important;
  z-index: 10 !important;
  outline: none !important;
  flex-shrink: 0 !important;
  pointer-events: all !important;
}

#gc-close-btn svg,
.gc-close-btn svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  transition: stroke var(--gc-t) !important;
  pointer-events: none !important;
}

#gc-close-btn:hover,
.gc-close-btn:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
  transform: rotate(90deg) !important;
}

#gc-close-btn:focus-visible,
.gc-close-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25) !important;
}

.gc-badge-recommended {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: left;
  width: 100%;
  background: #ddf37c82;
  color: #0A1740;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 5px;
}

#gc-countdown {
    font-size: 18px;
    color: var(--gc-estimated);
    font-weight: 800;
}
.gc-badge {
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 15px;
  font-weight: 700;
  color: #0A1740;
  margin-top: 4px;
  position: absolute;
  margin-top: -35px;
  
}
.gc-badge-bottom-recommended {
  border: 1px solid #ddf37d;
  background: #EBF8B099;
}
.gc-badge-bottom-fast {
  background: #0A1740;
  border: 1px solid #ddf37d;
  color:#fff;
}
.gc-price-wrap {
  margin-top: 6px;
}

.gc-price-old {
  text-decoration: line-through;
  color: #999;
  font-size: 17px;
  font-weight: 700;
  margin-right: 6px;
}
.gc-timer {
    text-align: center;
    padding: 10px 0;
    font-weight: 600;
}
.gc-countdown {
  color: var(--gc-estimated);
}
.gc-price-free {
  color: #16a34a;
  font-weight: 600;
}
.gc-reassurance {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 15px;
  margin-bottom: 10px;
  color: #555;
}
.gc-recommended {
  border: 2px solid #16a34a;
  transform: scale(1.03);
}
/* ── Progress / Compteur ─────────────────────────────────────────────────── */
.gc-counter-wrap {
  padding: 14px 28px !important;
  background: #fafafa !important;
  border-bottom: 1px solid var(--gc-border) !important;
  flex-shrink: 0 !important;
}

.gc-progress-label {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--gc-muted) !important;
}

.gc-progress-label span:last-child {
  color: var(--gc-accent) !important;
  font-weight: 700 !important;
}

.gc-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.gc-progress-step {
  font-weight: 600;
  color: #666;
}

.gc-progress-dynamic {
  font-weight: 600;
  color: #111;
}

.gc-progress-bar-track {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.gc-progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.4s ease;
  border-radius: 999px;
}

/* Ancienne classe compteur (fallback texte) */
.gc-counter {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--gc-muted) !important;
}

#gc-selected-count {
  color: var(--gc-accent) !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.gc-modal-body {
  padding: 4px 24px !important;
  flex: 1 !important;
  overflow: visible !important;
}

/* ── Grille produits ─────────────────────────────────────────────────────── */
.gc-products-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 20px !important;
}

/* ── Carte produit ───────────────────────────────────────────────────────── */
.gc-product-card {
  border: 2px solid var(--gc-border) !important;
  border-radius: var(--gc-radius-card) !important;
  cursor: pointer !important;
  overflow: hidden !important;
  background: var(--gc-bg-card) !important;
  transition:
    border-color var(--gc-t),
    box-shadow var(--gc-t),
    transform var(--gc-t) !important;
  position: relative !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  outline: none !important;
}

.gc-product-card:hover {
  border-color: #b5dfc6 !important;
  transform: translateY(-3px) !important;
}

.gc-product-card:focus-visible {
  border-color: var(--gc-accent) !important;
  outline: 3px solid rgba(45,134,83,0.3) !important;
}

/* État sélectionné */
.gc-product-card.selected {
  border-color: var(--gc-accent) !important;
  transform: translateY(-3px) !important;
}

.gc-product-card.selected .gc-product-img-wrap::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(45,134,83,0.08) !important;
  pointer-events: none !important;
}

/* État disabled */
.gc-product-card.disabled:not(.selected) {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

/* ── Badge de sélection ──────────────────────────────────────────────────── */
.gc-product-check-badge {
  position: absolute !important;
  top: 9px !important;
  right: 9px !important;
  width: 28px !important;
  height: 28px !important;
  background: var(--gc-accent) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  transform: scale(0.4) rotate(-15deg) !important;
  transition: opacity var(--gc-t), transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  pointer-events: none !important;
  z-index: 2 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(45,134,83,0.4) !important;
}

.gc-product-card.selected .gc-product-check-badge {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
}

.gc-product-check-badge svg {
  width: 15px !important;
  height: 15px !important;
  fill: none !important;
}

/* ── Image produit ───────────────────────────────────────────────────────── */
.gc-product-img-wrap {
  position: relative !important;
  background: #ffffff !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
}

.gc-product-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;   /* contain = image complète, pas coupée */
  padding: 8px !important;
  transition: transform var(--gc-t) !important;
  display: block !important;
}

.gc-product-card:hover .gc-product-img {
  transform: scale(1.06) !important;
}

.gc-product-img-placeholder {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 2.8rem !important;
  color: #9ca3af !important;
}

/* ── Infos produit ───────────────────────────────────────────────────────── */
.gc-product-info {
  padding: 10px 12px 14px !important;
  text-align: center !important;
}

.gc-product-info .feature_value {
    font-size: 0.85rem;
    margin: 0;
    padding: 5px 0;
}

.gc-product-name {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--gc-text) !important;
  margin: 5px 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;

}

.gc-product-free-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: var(--gc-accent-light) !important;
  color: var(--gc-accent-dark) !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  border: 1px solid #b7dfc7 !important;
}

.gc-product-free-badge::before {
  content: '🎁' !important;
  font-size: 0.75rem !important;
}

/* ── Footer modal ────────────────────────────────────────────────────────── */
.gc-modal-footer {
  padding: 16px 28px 16px !important;
  text-align: center !important;
  border-top: 1px solid var(--gc-border) !important;
  background: #fdfdfd !important;
  flex-shrink: 0 !important;
}

/* ── Bouton Valider ──────────────────────────────────────────────────────── */
.gc-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 14px 40px !important;
  border-radius: var(--gc-radius-btn) !important;
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  transition:
    background var(--gc-t),
    transform var(--gc-t),
    box-shadow var(--gc-t),
    opacity var(--gc-t) !important;
  letter-spacing: 0.2px !important;
  text-decoration: none !important;
  outline: none !important;
  min-width: 200px !important;
}

.gc-btn-primary {
  background: linear-gradient(135deg, var(--gc-accent) 0%, var(--gc-accent-dark) 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(45,134,83,0.35) !important;
}

.gc-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #35a065 0%, #246647 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(45,134,83,0.45) !important;
}

.gc-btn-primary:active:not(:disabled) {
  transform: translateY(0) !important;
}

.gc-btn-primary:disabled {
  background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%) !important;
  color: #fff !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.75 !important;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.gc-spinner {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  border: 2.5px solid rgba(255,255,255,0.35) !important;
  border-top-color: #fff !important;
  border-radius: 50% !important;
  animation: gcSpin 0.65s linear infinite !important;
  flex-shrink: 0 !important;
}

@keyframes gcSpin {
  to { transform: rotate(360deg); }
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.gc-toast {
  position: fixed !important;
  bottom: 28px !important;
  right: 28px !important;
  z-index: 1000001 !important;
  background: #1a1a2e !important;
  color: #fff !important;
  padding: 14px 20px !important;
  border-radius: 12px !important;
  font-size: 0.93rem !important;
  font-weight: 600 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22) !important;
  animation: gcSlideInRight 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) forwards !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  max-width: 340px !important;
  border-left: 4px solid var(--gc-accent) !important;
}

.gc-toast.error {
  border-left-color: #ef4444 !important;
}

@keyframes gcSlideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Body lock ───────────────────────────────────────────────────────────── */
body.gc-no-scroll {
  overflow: hidden !important;
}

/* ── SwiperJS overrides ──────────────────────────────────────────────────── */
.gc-swiper {
  padding: 8px 30px 34px !important;
  overflow: visible !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.gc-swiper .swiper-slide {
  /* width gérée par slidesPerView JS, pas de valeur fixe */
  padding: 4px 6px !important;
  height: auto !important;
  box-sizing: border-box !important;
}

.gc-swiper .swiper-button-prev,
.gc-swiper .swiper-button-next {
  color: var(--gc-accent) !important;
  width: 32px !important;
  height: 32px !important;
  background: #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.15) !important;
  top: 40% !important;
}

.gc-swiper .swiper-button-prev::after,
.gc-swiper .swiper-button-next::after {
  font-size: 18px !important;
}

.gc-swiper .swiper-pagination-bullet-active {
  background: var(--gc-accent) !important;
}

/* ── Info panier ─────────────────────────────────────────────────────────── */
.gc-cart-gift-info {
  margin: 12px 0 !important;
  padding: 10px 14px !important;
  background: var(--gc-accent-light) !important;
  border-left: 4px solid var(--gc-accent) !important;
  border-radius: 6px !important;
  font-size: 0.88rem !important;
  color: var(--gc-accent-dark) !important;
  font-weight: 600 !important;
}
.gc-cart-gift-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.gc-edit-gift-btn, .gc-restore-gift-btn {
  background: none;
  border: none;
  color: #16a34a;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

.gc-edit-gift-btn:hover, .gc-restore-gift-btn:hover {
  opacity: 0.8;
}
/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gc-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .gc-modal {
    max-width: 100% !important;
    max-height: 96vh !important;
    border-radius: 20px 20px 0 0 !important;
  }

  .gc-modal-header {
    padding: 24px 20px 16px !important;
  }

  .gc-modal-header-icon {
    font-size: 40px !important;
  }

  .gc-modal-title {
    font-size: 1.25rem !important;
  }

  .gc-modal-body {
    padding: 16px !important;
  }

  .gc-products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .gc-modal-footer {
    padding: 14px 20px 20px !important;
  }

  .gc-btn {
    width: 100% !important;
    min-width: unset !important;
  }

  .gc-toast {
    right: 12px !important;
    bottom: 12px !important;
    left: 12px !important;
    max-width: unset !important;
  }
}

@media (max-width: 380px) {
  .gc-products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* ── Swiper : espacement cartes ─────────────────────────────────────────── */
.gc-swiper .swiper-slide {
  height: auto !important;
  padding: 4px 2px !important;
}
.gc-swiper .swiper-slide .gc-product-card {
  height: 100% !important;
}

/* ── Bouton "Je ne veux pas de cadeau" ───────────────────────────────────── */
.gc-btn-decline {
  background: none !important;
  border: none !important;
  color: #9ca3af !important;
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  padding: 6px 12px !important;
  cursor: pointer !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  transition: color var(--gc-t) !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: inline-block !important;
  margin-top: 6px !important;
  width: 100% !important;
  text-align: center !important;
}
.gc-btn-decline:hover {
  color: #ef4444 !important;
  text-decoration-color: #ef4444 !important;
}

/* ── Toast info (refus cadeau) ───────────────────────────────────────────── */
.gc-toast.info {
  border-left-color: #3b82f6 !important;
}

/* ── Rupture de stock ────────────────────────────────────────────────────── */
.gc-product-card.gc-out-of-stock {
  opacity: 0.6 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  filter: grayscale(60%) !important;
}
/* Overlay semi-transparent sur l'image */
.gc-product-card.gc-out-of-stock .gc-product-img-wrap::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(255,255,255,0.35) !important;
  z-index: 1 !important;
  border-radius: 6px !important;
}
/* Texte "Indisponible" centré sur l'image */
.gc-product-card.gc-out-of-stock .gc-product-img-wrap::after {
  content: 'Indisponible' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(239,68,68,0.88) !important;
  color: #fff !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  z-index: 2 !important;
}
/* Badge rouge en bas de carte */
.gc-out-of-stock-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  background: #ef4444 !important;
  border-radius: 20px !important;
  padding: 3px 10px !important;
  margin-top: 4px !important;
  letter-spacing: .03em !important;
  text-transform: uppercase !important;
}

/* ── Slider : nav buttons positionnés dans le padding ───────────────────── */
.gc-swiper .swiper-button-prev {
  left: 4px !important;
}
.gc-swiper .swiper-button-next {
  right: 4px !important;
}
