/* ============================================================
   Artena — Modals popup panier (custom, 100% PHP rendered)
   ============================================================ */

#artena-modals-wrap { position: relative; z-index: 99990; }

body.artena-modal-open { overflow: hidden; }

.artena-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.artena-modal.open { display: flex; }

.artena-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: artena-fade 0.25s ease;
}

.artena-modal-box {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  max-width: 880px;
  width: 92%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 34px 36px 26px;
  animation: artena-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.artena-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
  z-index: 2;
}
.artena-modal-close:hover {
  background: #2d5124;
  color: #ffffff;
}

/* ─── Header ────────────────────────────────────────────── */
.artena-modal-header { text-align: center; margin-bottom: 24px; }
.artena-modal-kicker {
  display: inline-block;
  background: #2d5124;
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}
.artena-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #2d5124;
  margin: 0 0 8px;
  line-height: 1.25;
}
.artena-modal-sub {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* ─── Cards ─────────────────────────────────────────────── */
.artena-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.artena-card {
  position: relative;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.artena-card:hover {
  border-color: #2d5124;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.12);
}
.artena-card.sel {
  border-color: #2d5124;
  background: #ddefd4;
}

.artena-cimg {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  margin-bottom: 10px;
}
.artena-cimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.artena-cbadge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #2d5124;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.artena-chk {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2d5124;
  color: #ffffff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  animation: artena-pop 0.25s ease;
}

.artena-cinfo { flex: 1; display: flex; flex-direction: column; }
.artena-ccoll {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 3px;
}
.artena-cname {
  font-size: 14px;
  font-weight: 600;
  color: #2d5124;
  margin-bottom: 8px;
  line-height: 1.3;
}
.artena-cprice {
  font-size: 16px;
  font-weight: 700;
  color: #2d5124;
  margin-top: auto;
  margin-bottom: 8px;
}

/* ─── Chips M/L ─────────────────────────────────────────── */
.artena-szs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.artena-szs .sz {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.artena-szs .sz:hover:not(.dis) {
  border-color: #2d5124;
  color: #2d5124;
}
.artena-szs .sz.on {
  background: #2d5124;
  border-color: #2d5124;
  color: #ffffff;
}
.artena-szs .sz.dis {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ─── Bouton carte ──────────────────────────────────────── */
.artena-cbtn {
  width: 100%;
  padding: 10px 12px;
  background: #2d5124;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.artena-card:hover .artena-cbtn { background: #1a3a14; }
.artena-card.sel .artena-cbtn { background: #ddefd4; color: #2d5124; }

/* ─── Groupes de cartes ─────────────────────────────────── */
.artena-group { margin-bottom: 20px; }
.artena-group:last-of-type { margin-bottom: 0; }

.artena-see-more {
  display: inline-block;
  margin-top: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #2d5124;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.15s;
}
.artena-see-more:hover { opacity: 0.7; }

/* ─── Footer modal ──────────────────────────────────────── */
.artena-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  margin-top: 10px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.artena-modal-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #2d5124;
  font-weight: 600;
}
.artena-modal-summary .artena-fitems { color: #6b7280; font-weight: 500; }
.artena-modal-summary .artena-fsep { color: #d1d5db; }
.artena-modal-summary .artena-ftotal { font-size: 19px; font-weight: 700; }

.artena-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.artena-skip {
  padding: 11px 18px;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}
.artena-skip:hover { color: #2d5124; }
.artena-go {
  padding: 12px 24px;
  background: #2d5124;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.artena-go:hover { background: #1a3a14; transform: translateY(-1px); }
.artena-go:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Bottom-sheet : la box monte depuis le bas */
  .artena-modal { align-items: flex-end; }

  .artena-modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 82dvh; /* dvh = viewport réel iOS sans la barre Safari */
    border-radius: 20px 20px 0 0;
    padding: 0;
    overflow: hidden; /* la box ne scrolle plus elle-même */
    display: flex;
    flex-direction: column;
  }

  /* Close button reste visible en haut */
  .artena-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
  }

  /* Header fixe en haut */
  .artena-modal-header {
    padding: 48px 20px 16px; /* 48px pour laisser place au bouton close */
    flex-shrink: 0;
  }
  .artena-modal-title { font-size: 20px; }

  /* Zone scrollable : seulement les cartes */
  .artena-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0; /* indispensable pour que flex + overflow fonctionne */
    padding: 0 20px 16px;
    margin-bottom: 0;
  }

  .artena-card { padding: 10px; }
  .artena-cname { font-size: 13px; }

  /* Footer toujours visible en bas */
  .artena-modal-footer {
    flex-shrink: 0;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 16px 20px;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    margin-top: 0;
    border-top: 1px solid #e5e7eb;
  }
  .artena-modal-actions { flex-direction: column-reverse; width: 100%; gap: 8px; }
  .artena-modal-actions .artena-go,
  .artena-modal-actions .artena-skip { width: 100%; text-align: center; }
  .artena-modal-summary { justify-content: center; }
}

/* ─── Animations ────────────────────────────────────────── */
@keyframes artena-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes artena-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
