/* ===== FOND DE PAGE ===== */
.page-dons {
  background-image: url("/images/SalleDon.png");
  background-color: #000;
  background-size: auto 100vh;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
  margin: 0;
  overflow-x: hidden;
}

/* ===== STRUCTURE PRINCIPALE ===== */
.dons-page {
  width: min(1200px, calc(100% - 32px));
  margin: 32px auto 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ===== SOMMAIRE ===== */
.dons-summary {
  position: sticky;
  top: calc(var(--header-height, 120px) + 20px);
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 14px rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.dons-summary nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dons-summary a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1b1208;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.dons-summary a:hover {
  background: rgba(252, 102, 2, 0.35);
  transform: translateX(4px);
}

.summary-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ===== CARTE PRINCIPALE ===== */
.dons-card {
  padding: 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 2px 18px rgba(255, 255, 255, 0.45);
  font-size: 1.12rem;
  line-height: 1.65;
}

.dons-card h1 {
  text-align: center;
  margin-bottom: 28px;
}

/* ===== HERO IMAGE ===== */
.dons-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 30px;
}

.dons-hero-text {
  text-align: justify;
}

.dons-hero-img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

/* ===== SECTIONS ===== */
.dons-section {
  scroll-margin-top: calc(var(--header-height) + 20px);
  margin-top: 50px;
}

.dons-section h2 {
  text-align: center;
  margin-bottom: 15px;
}

.dons-section p {
  margin-bottom: 15px;
  text-align: justify;
  text-indent: 1.5em;
}

/* ===== FORMULAIRE DE DON ===== */
/* --- Bloc global --- */
.donation-form {
  max-width: 640px;
  margin: 30px auto;
  padding: 28px 34px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(70, 45, 10, 0.3);
  color: #120b05;
}

/* Ligne montant */
.donation-amount-block {
  display: grid;
  grid-template-columns: auto 140px auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  text-align: center;
}

.donation-amount-block label {
  margin: 0;
}

#donation-amount {
  width: 120px;
  padding: 8px 10px;
  font-size: 1.15em;
  font-weight: bold;
  text-align: center;
  border-radius: 6px;
  border: 1px solid rgba(70, 45, 10, 0.4);
}

.donation-help {
  white-space: nowrap;
  font-size: 0.9em;
}

.donation-total-line {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  text-align: center;
}

.donation-amount-block p {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  text-align: center;
}

/* Rangs */
.rang-wrapper {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin: 22px 0 18px;
}

.rang-card {
  flex: 1;
  max-width: 240px;
  padding: 10px 14px;
  text-align: center;
}

.titre-rang {
  margin: 0 0 10px;
  font-weight: bold;
  text-align: center;
}

.rang-card > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.rang-img {
  height: 58px;
  width: auto;
  display: block;
}

.rang-title {
  font-size: 1.05em;
  line-height: 1.2;
}

.rang-total {
  font-size: 0.9em;
}

/* Bouton */
.donation-submit {
  display: block;
  margin: 18px auto 0;
  padding: 10px 22px;
  font-size: 1.15em;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #d8aa21, #b8860b);
  color: #080502;
}

.donation-submit:hover {
  transform: scale(1.04);
  box-shadow: 0 0 10px rgba(184, 134, 11, 0.8);
  cursor: url("/images/boutons/curseurPiece.png"), auto;
}

#donation-message {
  margin: 14px 0 0;
  text-align: center;
  font-style: italic;
}

/* ===== MODAL PAYPAL ===== */
.paypal-modal[hidden] {
  display: none;
}

.paypal-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
}

.paypal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.paypal-modal-content {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border-radius: 18px;
  background: rgba(20, 14, 8, 0.96);
  border: 1px solid rgba(252, 206, 2, 0.45);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.65);
  color: #fff;
  text-align: center;
}

.paypal-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #fcce02;
  font-size: 2rem;
  cursor: pointer;
}

#paypal-button-container {
  margin-top: 20px;
}

#paypal-modal-message {
  min-height: 1.5em;
  margin-top: 16px;
}

/* ===== INFO RANGS MECENAT ===== */
.infos-rangs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 12px 0 22px;
}

.rangs-toggle-btn,
.rangs-close-btn {
  padding: 8px 12px;
  border: 1px solid rgba(80, 45, 12, 0.55);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.85);
  color: #1b1208;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.rangs-toggle-btn:hover,
.rangs-close-btn:hover {
  background: rgba(252, 206, 2, 0.35);
}

.rangs-details {
  width: min(620px, 100%);
  margin-top: 12px;
  padding: 18px;
  background: rgba(255, 248, 232, 0.92);
  border: 2px solid rgba(86, 45, 12, 0.45);
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}

.rangs-details h3 {
  margin-top: 0;
  text-align: center;
}

.liste-des-rangs {
  list-style: none;
  padding-left: 0;
  margin: 18px 0;
}

.liste-des-rangs li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(86, 45, 12, 0.2);
}

.liste-des-rangs img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.rangs-close-wrapper {
  text-align: center;
  margin-top: 1rem;
}

.hidden {
  display: none;
}

/* ===== CTA ===== */
.dons-cta {
  display: flex;
  justify-content: center;
  margin: 25px 0;
}

.cta-img {
  max-width: 260px;
  transition: transform 0.2s ease;
}

.small-cta-img {
  max-width: 200px;
}

.cta-img:hover {
  transform: scale(1.05);
  cursor: pointer;
}

/* ===== TABLEAU MECENES ===== */
.membres-container {
  max-width: auto;
  margin: 20px auto;
  padding: 2.5rem 2rem;
  text-align: left;
  background: url("/images/parchemGai.png") no-repeat center center;
  background-size: 100% 100%;
  border-radius: 10px;
}

.mecene-card {
  display: grid;
  grid-template-columns: 48px 90px 260px;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.2rem;
  padding: 0.8rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.mecene-card + .mecene-card {
  border-top: 1px solid rgba(90, 55, 10, 0.22);
}

.mecene-position {
  width: 48px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #6f4300;
  text-align: center;
}

.icon {
  align-items: center;
}

.mecene-rank-img {
  height: 64px;
  width: auto;
  object-fit: contain;
  justify-self: center;
  align-self: center;
}

.mecene-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
}

.mecene-info h3 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.1;
  color: #2d1a00;
}

.mecene-info p {
  margin: 0;
  font-size: 1.4rem;
  font-style: italic;
  font-weight: bold;
  line-height: 1.15;
  color: #2d1a00;
  text-align: center;
}

.mecene-info strong {
  color: #6f4300;
  text-align: end;
}

.empty-mecenes {
  text-align: center;
  font-style: italic;
}

/* ===== Chargement du modal PAYPAL ===== */
.paypal-loader {
  text-align: center;
  margin: 16px 0;
}

.paypal-loader-logo {
  width: 64px;
  height: 64px;
  animation: paypal-loader-spin 1.2s linear infinite;
}

@keyframes paypal-loader-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== RETOUR SOMMAIRE ===== */
.back-to-summary {
  display: none;
}

.page-dons {
  overflow-x: hidden;
}

.dons-page,
.dons-card,
.dons-section,
.donation-form,
.membres-container {
  box-sizing: border-box;
  max-width: 100%;
}

.dons-card {
  overflow: hidden;
}

.donation-form {
  width: 100%;
}

.donation-amount-block input {
  min-width: 0;
  width: 100%;
}

.donation-submit {
  max-width: 100%;
  white-space: normal;
}

/* ===== RESPONSIVE ===== */
/* ===== RESPONSIVE TABLETTE ===== */
@media (max-width: 900px) {
  .dons-page {
    width: min(100% - 20px, 1200px);
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 20px;
  }

  .dons-summary {
    position: static;
    padding: 10px;
  }

  .dons-summary nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dons-summary a {
    justify-content: flex-start;
    font-size: 0.9rem;
    line-height: 1.15;
    padding: 8px;
    background: rgba(255, 255, 255, 0.45);
  }

  .summary-icon {
    width: 24px;
    height: 24px;
  }

  /* Important : on garde le hero aligné tablette */
  .dons-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
    gap: 22px;
  }

  .dons-hero-text {
    text-align: justify;
  }

  .back-to-summary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(252, 206, 2, 0.35);
    color: #1b1208;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(108, 37, 0, 0.35);
  }

  .donation-form {
    max-width: 620px;
  }
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 640px) {
  .dons-page {
    text-align: center;
    width: 100%;
    margin: 12px auto;
    padding: 0 8px;
  }

  .dons-card {
    width: 100%;
    padding: 12px;
  }

  .dons-card h1 {
    font-size: 1.55rem;
    text-align: center;
  }

  .dons-section {
    overflow: hidden;
  }

  .dons-section h2 {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .dons-section p,
  .dons-hero-text {
    text-align: left;
    text-indent: 0;
  }

  .dons-summary nav {
    grid-template-columns: 1fr;
  }

  .dons-summary a {
    font-size: 0.95rem;
  }

  /* Hero seulement en colonne sur mobile */
  .dons-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
  }

  .donation-form {
    padding: 20px 14px;
  }

  .donation-amount-block {
    width: 100%;
  }

  .donation-help {
    white-space: normal;
  }

  .rang-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .rang-card {
    width: 100%;
    max-width: 260px;
  }

  .infos-rangs {
    align-items: center;
  }

  .rangs-toggle-btn,
  .rangs-close-btn {
    font-size: 0.9rem;
  }

  .liste-des-rangs li {
    align-items: flex-start;
  }

  .cta-img {
    max-width: min(230px, 100%);
  }

  .small-cta-img {
    max-width: min(180px, 100%);
  }

  .membres-container {
    width: 100%;
    max-width: 100%;
    padding: 2rem 0.8rem;
    background-size: 100% 100%;
    overflow: hidden;
  }

  .mecene-card {
    grid-template-columns: 32px 52px minmax(0, 1fr);
    justify-content: stretch;
    gap: 0.45rem;
  }

  .mecene-position {
    width: 32px;
    font-size: 0.95rem;
  }

  .mecene-rank-img {
    width: 50px;
    height: 50px;
  }

  .mecene-info {
    width: auto;
    min-width: 0;
    text-align: left;
  }

  .mecene-info h3,
  .mecene-info p {
    overflow-wrap: anywhere;
  }

  .dons-section p,
  .dons-hero-text {
    text-align: center;
  }

  /* Formulaires dons/cotisation */
  .donation-amount-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .donation-amount-block label,
  .donation-help,
  .donation-amount-block p {
    width: 100%;
    max-width: 260px;
    text-align: center;
  }

  .donation-amount-block input {
    width: min(100%, 220px);
    max-width: 220px;
  }

  .donation-submit {
    width: auto;
    min-width: 170px;
    margin-inline: auto;
  }

  /* Tableau mécènes mobile */
  .membres-container {
    width: calc(100% + 12px);
    max-width: calc(100% + 12px);
    margin-left: -6px;
    margin-right: -6px;
    padding: 2rem 1rem;

    background: rgba(255, 245, 210, 0.82);
    border: 1px solid rgba(111, 67, 0, 0.35);
  }

  .mecene-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    gap: 0.45rem;
    padding: 1rem 0.4rem;
  }

  .mecene-position {
    width: auto;
    font-size: 1rem;
    align-items: center;
  }

  .mecene-rank-img {
    width: auto;
    height: 45px;
    display: block;
    margin: 0 auto;
  }

  .mecene-info {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .mecene-info h3,
  .mecene-info p {
    margin: 0.15rem 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .mecene-info h3 {
    font-size: 1rem;
  }

  .mecene-info p {
    font-size: 0.92rem;
  }
}
