/* Boutique TwinPoints (points_shop.html)
   - grid : les grilles d'articles
   - flex : titre de section + compte à rebours, solde, résumé d'achat */

.points-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.points-intro {
  text-align: center;
}

.points-icon {
  color: #a66bff;                    /* le losange violet = TwinPoints */
}

/* ---------- Solde ---------- */

.points-page .points-balance {
  width: fit-content;
  margin: 8px auto 32px;
  padding: 10px 22px;
  background-color: #1a1d27;
  border: 1px solid #a66bff;
  border-radius: 999px;
  font-size: 1.1rem;
}

.points-balance strong {
  color: #ffffff;
}

/* ---------- Sections ---------- */

.shop-section {
  margin-bottom: 48px;
}

.shop-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.points-page .shop-section h2 {
  margin: 0;
  text-align: left;
}

.points-page .shop-section-head .small {
  margin: 4px 0 0;
}

.points-page .shop-timer {
  margin: 0;
  padding: 6px 14px;
  background-color: #1a1d27;
  border-radius: 999px;
  font-size: 0.9rem;
}

.shop-timer strong {
  color: #eab711;
}

/* La vitrine du mois ressort : fond dégradé et bordure */
.showcase {
  padding: 24px;
  border: 1px solid #ff5fa2;
  border-radius: 16px;
  background: linear-gradient(135deg, #2a1830, #1a1d27 60%);
}

/* ---------- Grilles d'articles → GRID ---------- */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.showcase-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  justify-content: center;           /* peu de cartes : elles restent groupées au centre au lieu de coller à gauche */
}

/* ---------- Un article ---------- */

.shop-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background-color: #1a1d27;
  border: 1px solid #2a2e3a;
  border-radius: 12px;
  text-align: center;
}

.points-page .shop-price {
  margin: 0;
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffffff;
}

.points-page .shop-stock {
  margin: 0;
  font-size: 0.75rem;
  color: #9aa0ad;
}

.shop-buy {
  margin-top: auto;                  /* bouton collé en bas, même si les textes ont des hauteurs différentes */
  width: 100%;
}

.shop-buy:disabled {
  background-color: #2a2e3a;
  color: #6b7080;
  cursor: not-allowed;
}

/* Rupture de stock : article grisé */
.shop-item.sold-out .trade-card {
  filter: grayscale(1);
  opacity: 0.5;
}

/* ---------- Comment gagner des points ---------- */

.earn {
  max-width: 600px;
}

.points-page .earn h2 {
  text-align: left;
}

/* ---------- Fenêtre d'achat ---------- */

.buy-dialog {
  width: min(380px, calc(100% - 32px));
  margin: auto;
  padding: 24px;
  background-color: #1a1d27;
  border: 1px solid #2a2e3a;
  border-radius: 16px;
  color: #e7eaf4;
  text-align: center;
}

.buy-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
}

.buy-dialog h2 {
  margin-top: 0;
}

.buy-card {
  width: 160px;
  margin: 0 auto 16px;
}

.buy-summary p {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a2e3a;
}

.buy-dialog .buy-done-msg {
  margin: 16px 0 0;
  font-weight: bold;
  color: #eab711;
}

.buy-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.buy-dialog .btn-ghost {
  background-color: transparent;
  border: 1px solid #727272;
  color: #e7eaf4;
}

.buy-dialog .btn-ghost:hover {
  background-color: #23273a;
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .shop-grid,
  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .showcase {
    padding: 16px;
  }
}
