/* ============================================================
   HeritasRP — Styles spécifiques à la boutique (Tebex)
   Réutilise les tokens et classes de styles.css (.card, .product…)
   ============================================================ */

/* ---------- Catégories ---------- */
.shop-cat {
  margin-bottom: 3rem;
}
.shop-cat__title {
  margin-bottom: 0.5rem;
}
.shop-cat__desc {
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

/* ---------- Carte produit ---------- */
.shop-product {
  overflow: hidden;
}
.shop-product__media {
  margin: -1.6rem -1.6rem 1.2rem;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.shop-product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.shop-product:hover .shop-product__media img {
  transform: scale(1.05);
}
.shop-recur {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.15rem;
}

/* ---------- Skeleton de chargement ---------- */
.shop-skeleton {
  pointer-events: none;
}
.sk {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  animation: sk-shimmer 1.3s infinite;
}
.sk--media {
  height: 150px;
  margin-bottom: 1rem;
}
.sk--line {
  height: 14px;
  margin-top: 0.8rem;
}
.sk--short {
  width: 60%;
}
.sk--foot {
  height: 40px;
  margin-top: 1.5rem;
}
@keyframes sk-shimmer {
  100% {
    transform: translateX(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sk::after {
    animation: none;
  }
}

/* ---------- Bloc d'erreur ---------- */
.shop-error {
  text-align: center;
  border: 1px solid rgba(216, 97, 44, 0.3);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
}
.shop-error[hidden] {
  display: none;
}
.shop-error svg {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---------- Bouton panier flottant ---------- */
.cart-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--grad-brand);
  color: var(--surface);
  box-shadow: 0 10px 30px -8px var(--accent);
  transition: transform 0.2s, filter 0.2s;
}
.cart-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.cart-button svg {
  width: 24px;
  height: 24px;
}
.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
.cart-count[hidden] {
  display: none;
}

/* ---------- Tiroir panier ---------- */
.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.cart-backdrop[hidden] {
  display: none;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 59;
  width: min(380px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.9);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.cart-drawer.is-open {
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .cart-drawer {
    transition: none;
  }
}
.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.cart-drawer__head h2 {
  font-size: 1.2rem;
}
.cart-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.cart-close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.4rem;
}
.cart-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 0;
}
.cart-empty[hidden] {
  display: none;
}
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-item__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cart-item__name {
  font-weight: 600;
}
.cart-item__meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.cart-item__remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}
.cart-item__remove:hover {
  color: var(--accent);
  border-color: rgba(216, 97, 44, 0.4);
}
.cart-foot {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1.4rem;
}
.cart-foot__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cart-foot__row .label {
  color: var(--muted);
}
.cart-foot__row .total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}
.cart-note {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Toasts ---------- */
.shop-toasts {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: max-content;
  max-width: 90vw;
  pointer-events: none;
}
.toast {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
  animation: toast-in 0.25s ease;
}
.toast--error {
  border-left-color: #e0533a;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}
