/* ============================
   BOUTIQUE PAGE STYLES
   ============================ */

/* Page Header */
.boutique-page {
  padding-top: 140px;
}

.page-header {
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
}

.page-header h1 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #333;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 1px;
}

/* Categories Filter */
.categories-filter {
  padding: 20px 0 40px;
  background: var(--white);
  border-bottom: 1px solid #eee;
}

.categories-filter .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.category-btn {
  background: transparent;
  border: 1px solid var(--burgundy);
  color: var(--burgundy);
  padding: 12px 25px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
}

.category-btn:hover,
.category-btn.active {
  background: var(--burgundy);
  color: var(--white);
}

/* Products Section */
.products-section {
  padding: 50px 0 80px;
  background: #fafafa;
}

.products-section .container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
}

/* Product Card */
.product-card {
  background: var(--white);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.product-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Lien image produit (séparé de l'overlay) */
.product-link-img {
  display: block;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

/* Product Overlay */
.product-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.quick-add {
  background: var(--burgundy);
  color: var(--white);
  padding: 10px 20px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 0;
  transition: background 0.3s ease;
  text-decoration: none;
}

/* Réinitialisation du bouton natif pour les produits simples (AJAX add to cart) */
button.quick-add {
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
  text-align: center;
}

.quick-add:hover {
  background: #6a0f2e;
}

/* Feedback visuel après ajout au panier */
button.quick-add.loading {
  opacity: 0.6;
  cursor: wait;
}

/* Masquer le lien "Voir le panier" injecté par WooCommerce après ajout AJAX
   (il s'ajoute comme 2ème enfant flex et décale le bouton) */
.product-overlay .added_to_cart {
  display: none !important;
}

button.quick-add.added {
  background: #2d7a3a;
}

/* Sélecteur de quantité dans l'overlay */
.quick-add-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.quick-add-qty {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.qty-btn:hover {
  background: rgba(255,255,255,0.2);
}

.qty-input {
  width: 36px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  text-align: center;
  -moz-appearance: textfield;
  padding: 4px 0;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.quick-add-wrap .quick-add {
  width: 100%;
}

/* Product Info */
.product-info {
  padding: 20px;
  text-align: center;
}

.product-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #333;
  margin-bottom: 5px;
}

.product-subtitle {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 10px;
}

.product-price {
  font-size: 14px;
  color: var(--burgundy);
  font-weight: 500;
}

/* Hidden products (for filter) */
.product-card.hidden {
  display: none;
}

/* ============================
   RESPONSIVE - TABLET
   ============================ */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .category-btn {
    padding: 10px 18px;
    font-size: 10px;
  }
}

/* ============================
   RESPONSIVE - MOBILE
   ============================ */
@media (max-width: 600px) {
  .boutique-page {
    padding-top: 120px;
  }

  .page-header {
    padding: 30px 15px;
  }

  .page-header h1 {
    font-size: 20px;
    letter-spacing: 3px;
  }

  .categories-filter .container {
    gap: 10px;
  }

  .category-btn {
    padding: 8px 15px;
    font-size: 9px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .product-info {
    padding: 15px;
  }

  .product-title {
    font-size: 12px;
  }

  .product-subtitle {
    font-size: 11px;
  }

  .product-price {
    font-size: 13px;
  }

  /* Always show overlay on mobile */
  .product-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  }

  .quick-add {
    padding: 8px 15px;
    font-size: 9px;
  }
}

@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ============================================================
   WOOCOMMERCE — Surcharges boutique
   ============================================================ */

/* Cacher les éléments WC par défaut qu'on gère nous-mêmes */
.woocommerce-result-count,
.woocommerce-ordering { display: none !important; }

/* Grille produits */
.products-grid .product-card.hidden { display: none; }

/* ── Pagination ──────────────────────────────────────────── */
.ct-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 50px 0 20px;
}

.ct-pagination .woocommerce-pagination {
  display: flex;
  justify-content: center;
}

.ct-pagination .woocommerce-pagination ul.page-numbers {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ct-pagination .page-numbers li a,
.ct-pagination .page-numbers li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  transition: all 0.3s ease;
}

.ct-pagination .page-numbers li a:hover {
  border-color: var(--burgundy);
  color: var(--burgundy);
}

.ct-pagination .page-numbers li span.current {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--white);
}

.ct-pagination .page-numbers li .prev,
.ct-pagination .page-numbers li .next {
  width: auto;
  padding: 0 16px;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ct-results-count {
  font-size: 12px;
  color: var(--light-gray);
  letter-spacing: 1px;
}

.ct-no-products {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
  font-size: 15px;
}

/* ============================================================
   MODE INDICATEUR — En-tête boutique avec mode actif
   ============================================================ */

.page-header.has-mode {
  padding: 50px 20px 40px;
}

.page-header.has-mode h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--burgundy);
  color: var(--white);
  padding: 8px 18px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mode-indicator.mode-click-collect {
  background: var(--burgundy);
}

.mode-indicator svg {
  width: 16px;
  height: 16px;
}

.header-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.change-mode-link,
.view-conditions-link {
  display: inline-block;
  color: var(--burgundy);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px dashed var(--burgundy);
  padding-bottom: 2px;
  transition: all 0.3s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: inherit;
}

.change-mode-link:hover,
.view-conditions-link:hover {
  color: #6a0f2e;
  border-color: #6a0f2e;
}

/* ============================================================
   MODALE CHOIX DU MODE (Livraison / Click & Collect)
   ============================================================ */

.mode-choice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mode-choice-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mode-choice-modal {
  background: var(--white);
  padding: 50px;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  text-align: center;
}

.mode-choice-modal h2 {
  font-size: 28px;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: 10px;
}

.mode-choice-modal p {
  color: var(--gray);
  margin-bottom: 40px;
}

.mode-choice-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mode-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 30px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  background: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--dark);
}

.mode-choice-btn:hover {
  border-color: var(--burgundy);
  background: #fdf0f3;
}

.mode-choice-btn svg {
  width: 48px;
  height: 48px;
  color: var(--burgundy);
}

.mode-choice-btn span {
  font-size: 16px;
  font-weight: 500;
}

.mode-choice-btn small {
  font-size: 12px;
  color: var(--gray);
}

/* ============================================================
   MODALES CONDITIONS (Livraison & Click & Collect)
   ============================================================ */

.conditions-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.conditions-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.conditions-modal {
  background: var(--white);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  position: relative;
}

.conditions-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray);
  padding: 5px;
  transition: color 0.3s;
}

.conditions-modal-close:hover {
  color: var(--burgundy);
}

.conditions-modal-header {
  text-align: center;
  padding: 40px 40px 20px;
  border-bottom: 1px solid #eee;
}

.chronofresh-logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 15px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.conditions-modal-header h2 {
  font-size: 24px;
  font-weight: 500;
  color: var(--burgundy);
  margin: 0;
}

.conditions-modal-header svg {
  margin-bottom: 10px;
}

.conditions-modal-content {
  padding: 30px 40px;
}

.conditions-modal-content p {
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 15px;
}

.conditions-modal-content ul {
  margin: 0;
  padding-left: 20px;
}

.conditions-modal-content li {
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 12px;
  line-height: 1.6;
}

.conditions-modal-content strong {
  color: var(--burgundy);
}

/* Notice Pessah dans la modal Click & Collect */
.conditions-pessah-notice {
  margin-top: 18px !important;
  margin-bottom: 0 !important;
  padding: 12px 16px;
  background: #fff8ee;
  border-left: 4px solid #c8920a;
  border-radius: 6px;
  font-size: 14px;
  color: var(--dark);
  line-height: 1.6;
}

.conditions-pessah-notice strong {
  color: #c8920a !important;
}

.conditions-modal-actions {
  display: flex;
  gap: 15px;
  padding: 20px 40px 40px;
  justify-content: center;
}

.conditions-btn-cancel {
  padding: 14px 30px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.3s ease;
}

.conditions-btn-cancel:hover {
  background: #eee;
}

.conditions-btn-accept {
  display: inline-block;
  padding: 14px 30px;
  background: var(--burgundy);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.conditions-btn-accept:hover {
  background: #6a0f2e;
}

/* ── Responsive modales ─────────────────────────────────── */
@media (max-width: 600px) {
  .mode-choice-buttons {
    grid-template-columns: 1fr;
  }

  .mode-choice-modal {
    padding: 30px 20px;
  }

  .page-header.has-mode h1 {
    flex-direction: column;
    gap: 12px;
  }

  .mode-indicator {
    font-size: 11px;
    padding: 6px 14px;
  }

  .conditions-modal-header,
  .conditions-modal-content,
  .conditions-modal-actions {
    padding-left: 25px;
    padding-right: 25px;
  }

  .conditions-modal-actions {
    flex-direction: column;
  }

  .conditions-btn-cancel,
  .conditions-btn-accept {
    width: 100%;
    text-align: center;
  }
}

/* =============================================================================
   MODAL AVERTISSEMENT CHANGEMENT DE MODE
   ============================================================================= */

/* Icône centrée dans le header du modal */
.ct-warning-header {
  text-align: center;
}

.ct-warning-header svg {
  margin-bottom: 10px;
}

/* Note d'avertissement dans le contenu du modal */
.ct-warning-note {
  background: #fff8e1;
  border-left: 3px solid #d97706;
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  margin-top: 16px !important;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
}

/* Bouton "Changer quand même" — ton orange ambre pour action risquée */
.ct-warning-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: #b45309;
  color: #fff;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ct-warning-confirm:hover {
  background: #92400e;
}

@media (max-width: 600px) {
  .ct-warning-confirm {
    width: 100%;
    text-align: center;
  }
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

#ctToastContainer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 480px;
  width: 90vw;
}

.ct-toast {
  padding: 14px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  line-height: 1.5;
  color: #fff;
  background: #1a1a2e;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.ct-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.ct-toast--warning { background: #b45309; }
.ct-toast--error   { background: var(--burgundy, #6b1a2e); }
.ct-toast--success { background: #15803d; }
