/* ===========================
   YAN STORE — style2.css
   Articles, Catalogue, Panier, Modal
   by Emmanuel Bony
=========================== */

/* ===========================
   LAYOUT PAGE ARTICLES
=========================== */
.articles-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

.articles-page-title {
  text-align: center;
  margin-bottom: 48px;
}

.articles-page-title h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: 4px;
  background: linear-gradient(135deg, #fff 40%, #00eeff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.articles-page-title p {
  color: rgba(255,255,255,.4);
  font-size: 0.9em;
  margin-top: 8px;
}

/* ===========================
   FILTRE CATÉGORIES (chips)
=========================== */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}

.cat-chip {
  padding: 8px 20px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 50px;
  color: rgba(255,255,255,.6);
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.cat-chip:hover {
  border-color: rgba(0,238,255,.4);
  color: #00eeff;
}

.cat-chip.active {
  background: linear-gradient(135deg, #0516e2, #00eeff);
  border-color: transparent;
  color: #fff;
}

/* ===========================
   BLOC PAR CATÉGORIE
=========================== */
.category-section {
  margin-bottom: 64px;
}

.category-section[hidden] {
  display: none;
}

.cat-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,238,255,.1);
}

.cat-heading-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0516e2, #00eeff);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  flex-shrink: 0;
}

.cat-heading h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5em;
  letter-spacing: 2px;
  color: #fff;
  /* reset des styles global h2 */
  position: static;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  top: auto; left: auto;
  transition: none;
  background: none;
  -webkit-text-fill-color: #fff;
}

/* ===========================
   GRILLE PRODUITS
=========================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* ===========================
   CARTE PRODUIT
=========================== */
.product-card {
  background: #1a1a2e;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: transform 0.28s, box-shadow 0.28s, border-color 0.28s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 44px rgba(5,22,226,.35);
  border-color: rgba(0,238,255,.22);
}

/* Image — 100% visible */
.product-card .p-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #0a0a1a;
}

/* Infos sous l'image */
.product-card .p-foot {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card .p-name {
  font-size: 0.82em;
  font-weight: 700;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card .p-price {
  font-size: 0.9em;
  font-weight: 800;
  color: #00eeff;
}

/* Bouton panier sur la carte */
.product-card .btn-add {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, #0516e2, #00eeff);
  color: #fff;
  font-weight: 700;
  font-size: 0.78em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.product-card .btn-add:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

/* Badge NEW / PROMO */
.p-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65em;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  z-index: 2;
  pointer-events: none;
}
.p-badge.new  { background: #0516e2; color: #fff; }
.p-badge.sale { background: #ff3860; color: #fff; }

/* ===========================
   MODAL AGRANDISSEMENT
=========================== */
#product-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#product-modal.open {
  opacity: 1;
  pointer-events: auto;
}

#product-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

#product-modal .modal-box {
  position: relative;
  z-index: 1;
  background: #1a1a2e;
  border-radius: 20px;
  border: 1px solid rgba(0,238,255,.18);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

#product-modal.open .modal-box {
  transform: scale(1);
}

#product-modal .modal-img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #0a0a1a;
  display: block;
}

#product-modal .modal-info {
  padding: 24px;
}

#product-modal .modal-name {
  font-size: 1.2em;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

#product-modal .modal-cat {
  font-size: 0.78em;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

#product-modal .modal-price {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2em;
  letter-spacing: 2px;
  color: #00eeff;
  margin-bottom: 20px;
}

#product-modal .modal-btn-cart {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0516e2, #00eeff);
  color: #fff;
  font-weight: 800;
  font-size: 1em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

#product-modal .modal-btn-cart:hover {
  box-shadow: 0 0 30px rgba(0,238,255,.4);
}

#product-modal .modal-btn-cart.added {
  background: linear-gradient(135deg, #128C7E, #25D366);
}

#product-modal .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.5);
  border: none;
  border-radius: 50%;
  color: rgba(255,255,255,.7);
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

#product-modal .modal-close:hover {
  background: rgba(255,56,96,.6);
  color: #fff;
}

/* ===========================
   PANIER LATÉRAL
=========================== */
#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: #12122a;
  border-left: 1px solid rgba(0,238,255,.12);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(.4,0,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}

#cart-drawer.open {
  transform: translateX(0);
}

#cart-drawer .drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s;
}

#cart-drawer.open .drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.drawer-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4em;
  letter-spacing: 3px;
  color: #fff;
}

.drawer-header .cart-total-count {
  background: #0516e2;
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
}

.drawer-close {
  background: rgba(255,255,255,.06);
  border: none;
  color: rgba(255,255,255,.6);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.drawer-close:hover {
  background: rgba(255,56,96,.3);
  color: #fff;
}

/* Liste d'articles */
.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.drawer-list::-webkit-scrollbar { width: 4px; }
.drawer-list::-webkit-scrollbar-track { background: transparent; }
.drawer-list::-webkit-scrollbar-thumb { background: rgba(0,238,255,.2); border-radius: 2px; }

.cart-empty-msg {
  text-align: center;
  padding: 60px 24px;
  color: rgba(255,255,255,.3);
  font-size: 0.9em;
}

.cart-empty-msg .empty-icon {
  font-size: 3em;
  display: block;
  margin-bottom: 12px;
  opacity: .4;
}

/* Item panier */
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background 0.2s;
  position: relative;
}

.cart-item:hover {
  background: rgba(255,255,255,.02);
}

.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #0a0a1a;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.85em;
  font-weight: 700;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.82em;
  color: #00eeff;
  font-weight: 700;
  margin-top: 3px;
}

/* Statut confirmé */
.cart-item.confirmed {
  background: rgba(37,211,102,.05);
}

.cart-item.confirmed .cart-item-name::after {
  content: " ✓";
  color: #25D366;
}

/* Actions item */
.cart-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-confirm,
.btn-delete {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-confirm {
  background: rgba(37,211,102,.15);
  color: #25D366;
  border: 1px solid rgba(37,211,102,.25);
}

.btn-confirm:hover,
.cart-item.confirmed .btn-confirm {
  background: #25D366;
  color: #fff;
}

.btn-delete {
  background: rgba(255,56,96,.1);
  color: #ff3860;
  border: 1px solid rgba(255,56,96,.2);
}

.btn-delete:hover {
  background: #ff3860;
  color: #fff;
}

/* Pied du drawer */
.drawer-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.drawer-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.88em;
}

.drawer-total-line span:first-child {
  color: rgba(255,255,255,.4);
}

.drawer-total-line .total-amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5em;
  letter-spacing: 1px;
  color: #00eeff;
}

.drawer-note {
  font-size: 0.74em;
  color: rgba(255,255,255,.25);
  text-align: center;
  margin-bottom: 12px;
}

/* BOUTON COMMANDER sur WhatsApp — fixe et visible */
.btn-whatsapp-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #128C7E, #25D366);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3em;
  letter-spacing: 2px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 0 0 rgba(37,211,102,.4);
  animation: waPulse 2.4s 2s ease-in-out infinite;
}

.btn-whatsapp-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37,211,102,.4);
}

.btn-whatsapp-order:disabled {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.3);
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
  transform: none;
}

.btn-whatsapp-order svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

@keyframes waPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.45); }
  70%  { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ===========================
   BOUTON FLOTTANT PANIER
=========================== */
#floating-cart {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 2500;
  background: linear-gradient(135deg, #0516e2, #00eeff);
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(5,22,226,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  transition: transform 0.3s, box-shadow 0.3s;
}

#floating-cart:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 36px rgba(0,238,255,.5);
}

#floating-cart .fc-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3860;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.62em;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #12122a;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s cubic-bezier(.34,1.56,.64,1);
}

#floating-cart .fc-badge.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===========================
   TOAST NOTIFICATION
=========================== */
#toast {
  position: fixed;
  top: 90px;
  right: 28px;
  z-index: 5000;
  background: #1a1a2e;
  border: 1px solid rgba(0,238,255,.25);
  border-left: 4px solid #00eeff;
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 0.88em;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  transform: translateX(140%);
  transition: transform 0.38s cubic-bezier(.34,1.56,.64,1);
  max-width: 300px;
  pointer-events: none;
}

#toast.show {
  transform: translateX(0);
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  #cart-drawer { width: 100vw; }
  .cat-chips { gap: 7px; }
  .cat-chip { font-size: 0.78em; padding: 6px 14px; }
}
