/* PIERROT Split Pay – styles front (neutres, surchargeables par le thème) */

:root {
  --psp-alma: #fa5022;
  --psp-alma-blue: #00a4d6;
  --psp-alma-yellow: #f5b400;
  --psp-klarna: #ffb3c7;
  --psp-klarna-ink: #0b051d;
}

.pierrot-splitpay:empty { display: none; }

/* ---------- Lignes ---------- */
.psp-line {
  margin: .5rem 0;
  font-size: .9rem;
  line-height: 1.45;
}
.psp-line__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem;
  min-height: 1.6rem; margin-bottom: .2rem;
}
.psp-line__text { font-weight: 500; }
.psp-line__foot { font-size: .86rem; }
/* L. 312-8 : l'avertissement doit être en caractères plus grands que les autres informations sur le financement */
.psp-line__warning { display: block; margin-bottom: .2rem; font-size: 1rem; font-weight: 600; }
.psp-line__more { display: inline-block; }
.psp-line__warning { opacity: .85; }
.psp-line__more {
  background: none; border: 0; padding: 0;
  font: inherit; text-decoration: underline; cursor: pointer; color: inherit;
}

/* Rotation entre prestataires */
.psp-lines--slide { position: relative; }
.psp-lines--slide .psp-line { display: none; }
.psp-lines--slide .psp-line.is-visible { display: block; animation: psp-fade .4s ease; }
@keyframes psp-fade { from { opacity: 0; } to { opacity: 1; } }

/* Panier / checkout : lignes dans un encadré */
.pierrot-splitpay--cart,
.pierrot-splitpay--checkout { margin: 1rem 0; }
.pierrot-splitpay--cart .psp-lines,
.pierrot-splitpay--checkout .psp-lines {
  padding: .75rem 1rem;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 6px;
}
.pierrot-splitpay--cart .psp-line + .psp-line,
.pierrot-splitpay--checkout .psp-line + .psp-line {
  border-top: 1px dashed rgba(0, 0, 0, .12);
  padding-top: .5rem;
}

/* ---------- Logos ---------- */
.psp-logo { display: inline-flex; align-items: center; vertical-align: middle; }
.psp-logo img { height: 18px; width: auto; display: block; }
.psp-logo--klarna img { height: 24px; }
.psp-logo--badge {
  font-weight: 700; font-size: .78rem; letter-spacing: .02em;
  padding: .1rem .45rem; border-radius: 4px; color: #fff;
}
.psp-logo--badge.psp-logo--alma   { background: var(--psp-alma); }
.psp-logo--badge.psp-logo--klarna { background: var(--psp-klarna); color: var(--psp-klarna-ink); }

/* ---------- Mentions légales sous la ligne ---------- */
.psp-legal-block { font-size: .7rem; line-height: 1.4; opacity: .65; margin: .25rem 0 .75rem; }
.psp-legal-block p { margin: 0 0 .3rem; }

/* ---------- Popin (commun) ---------- */
.psp-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); padding: 1rem;
}
.psp-modal[hidden] { display: none; }
.psp-modal__dialog {
  position: relative; background: #fff; color: #111;
  max-height: 90vh; overflow: auto; border-radius: 12px;
  font-family: inherit; text-align: left;
}
.psp-modal__close {
  width: 32px; height: 32px; border: 0; cursor: pointer; font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
body.psp-modal-open { overflow: hidden; }

.psp-schedule { list-style: none; padding: 0; margin: 0 0 .75rem; }
.psp-schedule li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .4rem 0; font-size: .95rem;
}
.psp-schedule li:first-child { font-weight: 700; }
.psp-warning {
  margin: .75rem 0; padding: .6rem .75rem;
  border: 1px solid #111; font-size: 1.15rem; line-height: 1.3; font-weight: 700;
}
.psp-total {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; background: #f4f4f4; border-radius: 8px;
}
.psp-total__label { font-weight: 700; font-size: 1.1rem; }
.psp-total__amounts { text-align: right; font-weight: 700; font-size: 1.1rem; }
.psp-total__fees { font-weight: 600; font-size: .8rem; opacity: .8; }
.psp-legal { font-size: .72rem; line-height: 1.4; opacity: .7; margin: 1rem 0 0; }

/* ---------- Popin Alma ---------- */
.psp-alma {
  width: min(820px, 100%);
  padding: 2.25rem 2rem 2rem;
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem;
}
@media (max-width: 720px) { .psp-alma { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; } }
.psp-alma .psp-modal__close {
  position: absolute; top: .75rem; right: .75rem;
  border-radius: 50%; background: #111; color: #fff;
}
.psp-alma__title {
  font-size: 1.5rem; line-height: 1.25; font-weight: 700; margin: 0 0 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
}
.psp-alma__steps { list-style: none; padding: 0; margin: 0 0 2rem; }
.psp-alma__steps li { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; font-size: .92rem; line-height: 1.45; }
.psp-alma__num {
  flex: 0 0 auto; width: 1.6rem; font-size: 1.6rem; line-height: 1; font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
}
.psp-alma__steps li:nth-child(1) .psp-alma__num { color: var(--psp-alma); }
.psp-alma__steps li:nth-child(2) .psp-alma__num { color: var(--psp-alma-blue); }
.psp-alma__steps li:nth-child(3) .psp-alma__num { color: var(--psp-alma-yellow); }
.psp-alma__logo .psp-logo img { height: 26px; }
.psp-alma__tabs { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.psp-alma__tab {
  min-width: 4.5rem; padding: .55rem 1.2rem; border-radius: 999px;
  border: 1.5px solid #111; background: #fff; color: #111;
  font-weight: 700; font-size: 1.05rem; cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
}
.psp-alma__tab.is-active { background: var(--psp-alma); border-color: var(--psp-alma); color: #fff; }
.psp-alma .psp-schedule li { position: relative; padding-left: 1.25rem; }
.psp-alma .psp-schedule li::before {
  content: ""; position: absolute; left: 0; top: .85rem;
  width: 8px; height: 8px; border-radius: 50%; background: #fbd3c6;
}
.psp-alma .psp-schedule li:first-child::before { background: var(--psp-alma); }
.psp-alma .psp-warning { border-color: var(--psp-alma); }

/* ---------- Popin Klarna ---------- */
.psp-klarna { width: min(640px, 100%); padding: 1.75rem 1.75rem 1.5rem; }
.psp-klarna__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.psp-klarna__title { font-size: 1.35rem; font-weight: 600; margin: 0; line-height: 1.3; }
.psp-klarna .psp-modal__close { border-radius: 6px; background: #fff; border: 1.5px solid var(--psp-klarna-ink); color: var(--psp-klarna-ink); }
.psp-klarna__price { font-size: .85rem; font-weight: 600; opacity: .7; margin: 0 0 .75rem; }
.psp-klarna__intro { font-size: .95rem; margin: 0 0 1rem; line-height: 1.5; }
.psp-klarna__option {
  background: #f5f5f5; border-radius: 8px; padding: .9rem 1rem; margin-bottom: .6rem;
  cursor: pointer; border: 1.5px solid transparent; transition: border-color .15s;
}
.psp-klarna__option:hover { border-color: var(--psp-klarna); }
.psp-klarna__option.is-open { border-color: var(--psp-klarna); background: #fff; }
.psp-klarna__option-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .95rem; }
.psp-klarna__option-total { font-size: .82rem; opacity: .7; margin-top: .35rem; }
.psp-klarna__option-detail { display: none; margin-top: .9rem; padding-top: .75rem; border-top: 1px solid #eee; }
.psp-klarna__option.is-open .psp-klarna__option-detail { display: block; }
.psp-klarna .psp-schedule li:first-child { color: #e0527f; }
.psp-klarna .psp-warning { border-color: var(--psp-klarna); }
.psp-klarna .psp-total { background: #fff0f4; }
.psp-klarna__legal { background: #f5f5f5; border-radius: 8px; padding: .75rem 1rem; opacity: 1; color: #666; }

/* ---------- Mentions légales en pied de page ---------- */
.pierrot-splitpay-footer { font-size: .72rem; line-height: 1.45; opacity: .7; padding: 1rem 0; }
.pierrot-splitpay-footer p { margin: 0 0 .4rem; }
.psp-footer__warning { font-weight: 700; font-size: .9rem; }
