/* =========================================================
   PANIER — cart.html + toast global
   ========================================================= */
.cart-page {
  padding: calc(var(--header-h) + 32px) 0 var(--space-section);
  min-height: 70vh;
}

.cart-count {
  margin-left: 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--grey);
}

.clear-cart {
  color: var(--grey);
}

.clear-cart:hover {
  color: var(--red);
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

/* ---------- Lignes ---------- */
.cart-list ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto 96px 32px;
  align-items: center;
  gap: 18px;
  padding: 12px;
  background: #121012;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-sm);
  transition: opacity 0.22s, transform 0.22s var(--ease), border-color 0.25s;
}

.cart-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.cart-item.removing {
  opacity: 0;
  transform: translateX(16px);
}

.cart-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  background: #1a1418 center / cover no-repeat;
}

.cart-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cart-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.cart-title:hover {
  color: var(--green);
}

.cart-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}

.cart-unit {
  font-size: 13px;
  color: var(--grey);
}

.cart-unit s {
  color: rgba(255, 255, 255, 0.35);
  margin-right: 4px;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.cart-qty button {
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: var(--grey);
  transition: background 0.15s, color 0.15s;
}

.cart-qty button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.cart-qty span {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.cart-line-total {
  text-align: right;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cart-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--grey);
  transition: color 0.2s, background 0.2s;
}

.cart-remove:hover {
  color: var(--red);
  background: rgba(179, 18, 28, 0.12);
}

/* ---------- Vide ---------- */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--r-sm);
  color: var(--grey);
}

.cart-empty[hidden] {
  display: none;
}

.cart-empty svg {
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 6px;
}

.cart-empty h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
}

.cart-empty .btn {
  margin-top: 14px;
}

/* ---------- Récapitulatif ---------- */
.cart-summary {
  position: sticky;
  top: calc(var(--header-h-scrolled) + 28px);
  padding: 22px;
  background: #121012;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
}

.cart-summary[hidden] {
  display: none;
}

.cart-summary h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.promo {
  display: flex;
  gap: 8px;
}

.promo input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-sm);
  background: #0e0c0e;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
}

.promo input:focus {
  border-color: var(--olive);
}

.promo button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: var(--r-sm);
  color: var(--green);
  font-family: var(--font-nav);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: background 0.2s, color 0.2s;
}

.promo button:hover {
  background: var(--green);
  color: #0a0a0a;
}

.promo-msg {
  min-height: 18px;
  margin: 6px 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.promo-msg.ok { color: var(--green); }
.promo-msg.err { color: var(--red); }

.sum {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.sum > div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--grey);
}

.sum > div[hidden] {
  display: none;
}

.sum dd {
  color: var(--white);
  font-weight: 700;
}

.sum .green dd {
  color: var(--green);
}

.sum .total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-weight: 700;
}

.sum .total dd {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.checkout {
  width: 100%;
  height: 46px;
}

.sum-perks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--grey);
}

.sum-perks li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--green);
}

/* ---------- Toast (toutes les pages) ---------- */
.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--olive-soft);
  border-radius: var(--r-sm);
  background: rgba(14, 12, 14, 0.96);
  color: var(--grey);
  font-size: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, 16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}

.cart-toast b {
  color: var(--white);
}

.cart-toast a {
  font-family: var(--font-nav);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.cart-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .cart-item {
    grid-template-columns: 96px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info remove"
      "thumb qty total";
    row-gap: 10px;
    column-gap: 12px;
  }

  .cart-thumb { grid-area: thumb; }
  .cart-info { grid-area: info; }
  .cart-qty { grid-area: qty; justify-self: start; }
  .cart-line-total { grid-area: total; font-size: 16px; white-space: nowrap; align-self: center; }
  .cart-remove { grid-area: remove; justify-self: end; }

  .cart-toast {
    left: 16px;
    right: 16px;
    transform: translateY(16px);
    justify-content: space-between;
  }

  .cart-toast.show {
    transform: translateY(0);
  }
}

/* =========================================================
   WISHLIST — tiroir latéral (toutes les pages)
   ========================================================= */
.wish-badge {
  position: absolute;
  top: -7px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  padding-inline: 4px;
  border-radius: var(--r-pill);
  background: var(--green);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.wish-badge[hidden] {
  display: none;
}

.header-actions {
  position: relative;
}

/* Panneau flottant sous l'icône cœur, effet verre comme le header */
.wish-drawer {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  z-index: 50;
  width: min(360px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  max-height: min(520px, calc(100vh - var(--header-h) - 40px));
  background: rgba(14, 10, 12, 0.82);
  border: 1px solid var(--olive-soft);
  border-radius: var(--r-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transform-origin: top right;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}

.wish-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wish-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 12px 10px 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wish-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-nav);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wish-count {
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  background: var(--green);
  color: #0a0a0a;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  letter-spacing: 0;
}

.wish-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  color: var(--grey);
  transition: color 0.2s, background 0.2s;
}

.wish-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.wish-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.wish-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-sm);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

.wish-item.removing {
  opacity: 0;
  transform: translateX(12px);
}

.wish-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  background: #1a1418 center / cover no-repeat;
}

.wish-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wish-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.wish-name:hover {
  color: var(--green);
}

.wish-platform {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}

.wish-platform svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.wish-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

.wish-price s {
  margin-right: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
}

.wish-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wish-cart,
.wish-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.wish-cart {
  background: var(--green);
  color: #0a0a0a;
}

.wish-cart:hover {
  box-shadow: 0 0 14px rgba(164, 224, 36, 0.45);
}

.wish-remove {
  color: var(--grey);
}

.wish-remove:hover {
  color: var(--red);
  background: rgba(179, 18, 28, 0.12);
}

.wish-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  font-size: 14px;
  text-align: center;
  color: var(--grey);
}

.wish-empty[hidden] {
  display: none;
}

.wish-empty svg {
  width: 36px;
  height: 36px;
  color: rgba(255, 255, 255, 0.25);
}

.wish-foot {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wish-foot[hidden] {
  display: none;
}

.wish-foot .btn {
  width: 100%;
  height: 40px;
}

.wish-empty .btn {
  height: 38px;
  padding: 0 20px;
  font-size: 14px;
}

/* Le header en pilule : le panneau reste dans la fenêtre */
@media (max-width: 860px) {
  .wish-drawer {
    right: -8px;
    top: calc(100% + 10px);
  }
}

/* Coeur sur les cartes du catalogue */
.product-wish {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10, 8, 10, 0.75);
  color: var(--white);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s var(--ease), color 0.2s;
}

.product:hover .product-wish,
.product:focus-within .product-wish,
.product-wish.on {
  opacity: 1;
  transform: translateY(0);
}

.product-wish.on {
  color: var(--green);
}

.product-wish.on svg path {
  fill: currentColor;
}

/* le badge DLC se decale a droite quand le coeur est present */
.product .product-tag {
  left: auto;
  right: 56px;
}

@media (max-width: 860px) {
  .product-wish {
    opacity: 1;
    transform: none;
    width: 28px;
    height: 28px;
  }
}
