/* ================================
   VARIABLES
================================ */
:root {
  --black: #0B0B0B;
  --red: #e03d2b;
  --jade: #36b39d;
  --fg: #F4F4F4;
  --fade: rgba(255,255,255,0.08);
}

/* ================================
   LAYOUT PAGE MONTHLY PACKS
================================ */

body {
  background: var(--black);
  color: var(--fg);
}

.monthly-page {
  padding: 8rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.monthly-hero {
  text-align: center;
  margin-bottom: 3rem;
  margin-top: -3.9rem;
}

.monthly-hero p {
  max-width: 720px;
  margin: 0 auto;
  opacity: 0.8;
  line-height: 1.6;
  font-size: 0.98rem;
}

/* ✅ FIX SAFARI : grid centré correctement */
.monthly-grid {
  margin-top: 3rem;
  display: grid;

  /* ✅ IMPORTANT : on évite 1fr + width fixe (Safari bug) */
  grid-template-columns: repeat(auto-fit, minmax(240px, 240px));

  gap: 2.8rem;

  /* ✅ centre la grille entière */
  justify-content: center;

  /* ✅ centre les cartes dans chaque colonne */
  justify-items: center;
}

/* ================================
   LINGOTS 3D – MONTHLY
================================ */

.monthly-pack {
  position: relative;
  width: 240px;
  height: 150px;
  perspective: 1700px;
  cursor: pointer;
}

.monthly-card {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  transform-style: preserve-3d;
  animation: pack-spin 10s linear infinite;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  position: relative;
  padding: 1.4rem 1.2rem;

  box-shadow:
    0 42px 90px rgba(0,0,0,0.92),
    0 8px 30px rgba(0,0,0,0.7),
    inset 0 3px 7px rgba(255,255,255,.5),
    inset 0 -14px 26px rgba(0,0,0,0.85);

  border: 1px solid rgba(255,255,255,0.28);
  overflow: hidden;

  /* ✅ FIX Safari GPU rendering */
  transform: translateZ(0);
  will-change: transform;
}

/* Reflets */
.monthly-card::before {
  content: "";
  position: absolute;
  inset: 7px 9px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.95), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(0,0,0,0.6), transparent 68%);
  mix-blend-mode: screen;
  opacity: 0.95;
  pointer-events: none;
}

.monthly-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.9),
      rgba(255,255,255,0.12),
      rgba(0,0,0,0.78)
    );
  mix-blend-mode: soft-light;
  opacity: 0.78;
  pointer-events: none;
}

/* Texte */
.monthly-name,
.monthly-price,
.monthly-tagline {
  position: relative;
  z-index: 1;
}

.monthly-name {
  font-size: 1.02rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.monthly-price {
  font-size: 0.9rem;
  text-transform: uppercase;
  opacity: 0.96;
  margin-bottom: 0.3rem;
}

.monthly-tagline {
  font-size: 0.78rem;
  opacity: 0.9;
}

/* Pause rotation */
.monthly-pack:hover .monthly-card,
.monthly-pack:focus-within .monthly-card {
  animation-play-state: paused;
}

/* ================================
   ROTATION
================================ */

@keyframes pack-spin {
  0%   { transform: rotateY(0deg) rotateX(20deg); }
  50%  { transform: rotateY(180deg) rotateX(20deg); }
  100% { transform: rotateY(360deg) rotateX(20deg); }
}

/* ================================
   COULEURS MONTHLY PACKS
================================ */

/* SAPHIR */
.saphir .monthly-card {
  background:
    radial-gradient(circle at 10% 0%, #dbe7ff, transparent 55%),
    linear-gradient(135deg, #1f3b73, #3b6cff, #6fa8ff, #15264a);
  color: #0c1428;

  box-shadow:
    0 42px 90px rgba(0,0,0,0.92),
    0 0 80px rgba(80,140,255,0.75),
    inset 0 3px 7px rgba(255,255,255,.55),
    inset 0 -14px 26px rgba(0,0,0,.85);
}

/* RUBIS */
.rubis .monthly-card {
  background:
    radial-gradient(circle at 10% 0%, #ffd4d4, transparent 55%),
    linear-gradient(135deg, #5a0f18, #b11226, #ff4b5c, #3a050b);
  color: #220408;

  box-shadow:
    0 42px 90px rgba(0,0,0,0.92),
    0 0 80px rgba(224,61,43,0.85),
    inset 0 3px 7px rgba(255,255,255,.5),
    inset 0 -14px 26px rgba(0,0,0,.85);
}

/* ÉMERAUDE */
.emeraude .monthly-card {
  background:
    radial-gradient(circle at 10% 0%, #dffaf2, transparent 55%),
    linear-gradient(135deg, #0f3f33, #1fa88c, #36b39d, #06231c);
  color: #041914;

  box-shadow:
    0 42px 90px rgba(0,0,0,0.92),
    0 0 90px rgba(54,179,157,0.9),
    inset 0 3px 7px rgba(255,255,255,.55),
    inset 0 -14px 26px rgba(0,0,0,.85);
}

/* ================================
   TOOLTIP
================================ */

.monthly-tooltip {
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(9,9,9,0.96);
  color: var(--fg);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8);
  width: 230px;
  font-size: 0.78rem;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 10;
}

.monthly-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: rgba(9,9,9,0.96) transparent transparent transparent;
}

.monthly-pack:hover .monthly-tooltip,
.monthly-pack:focus-within .monthly-tooltip,
.monthly-pack.show-tooltip .monthly-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.monthly-tooltip-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--jade);
}

.monthly-tooltip-body {
  opacity: 0.9;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 480px) {
  .monthly-pack {
    width: 200px;
    height: 140px;
  }

  .monthly-page {
    padding-top: 7rem;
  }

  .monthly-grid {
    grid-template-columns: 1fr;
    justify-content: center;
    justify-items: center;
    gap: 2.2rem;
  }

  .monthly-tooltip {
    width: 90vw;
    max-width: 280px;
  }
}

/* ================================
   PACKS NAVIGATION
================================ */

.packs-nav {
  margin-top: -1.5rem;
  margin-bottom: 3.5rem;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.packs-nav-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
}

.packs-nav-link:hover {
  color: var(--jade);
}

.packs-nav-link.active {
  color: var(--jade);
}

.packs-nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--jade),
    transparent
  );
}

.packs-nav-sep {
  margin: 0 14px;
  opacity: 0.35;
}
