/*
 * Koszyk – Męska Mowa Ciała (/checkout).
 * Jasna paleta mc-* z mensbodytalk.com (the-silent-status/public/mbt-checkout.html).
 * Mobile-first (393 px); od 880 px dwie kolumny, podsumowanie w kolumnie bocznej.
 *
 * Stany zaznaczenia (.is-checked) ustawia JS, bez :has() – przeglądarki wbudowane
 * w Facebooka i Instagrama na starszych iOS go nie znają, a stamtąd przychodzi ruch.
 */

:root {
  --mc-text: #202223;
  --mc-muted: #6d7175;
  --mc-subtle: #8c9196;
  --mc-border: #e1e3e5;
  --mc-border-strong: #c9cccf;
  --mc-surface: #f6f6f7;
  --mc-selected: #f1f2f4;
  --mc-ink: #1a1a1a;
  --mc-mark: #5c5f62;
  --mc-accent: #e0a800;
  --mc-accent-bg: #fffbeb;
  --mc-accent-bg-strong: #fff6d9;
  --mc-green: #1a7f37;
  --mc-danger: #b80020;
  --mc-danger-bg: #fff5f5;
  --mc-danger-border: #f5c0c0;
  --mc-pad: clamp(1.2rem, 4vw, 3rem);
  --mc-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.mc-page {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--mc-text);
  font-family: var(--mc-font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Same selektory elementów (specyficzność 0,0,1): klasy typu .mc-pay muszą móc nadpisać kolor i font. */
input,
button {
  font: inherit;
  color: inherit;
}

.mc-page input:-webkit-autofill,
.mc-page input:-webkit-autofill:hover,
.mc-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--mc-text);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  caret-color: var(--mc-text);
}

:focus-visible {
  outline: 2px solid var(--mc-ink);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mc-nowrap {
  white-space: nowrap;
}

/* ---- układ ------------------------------------------------------------ */

.mc {
  max-width: 1200px;
  margin: 0 auto;
}

.mc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.mc-form-side {
  width: 100%;
  padding: 1.25rem var(--mc-pad) 1.5rem;
}

@media (min-width: 880px) {
  /* Szare tło kolumny bocznej dociągnięte do krawędzi ekranu. Kolumny dzielą
     wyśrodkowany kontener na pół, więc granica wypada dokładnie na 50%. */
  body.mc-page {
    background: linear-gradient(90deg, #ffffff 50%, var(--mc-surface) 50%);
  }

  .mc-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
  }

  .mc-form-side {
    max-width: 560px;
    justify-self: end;
    padding-top: 2.4rem;
    padding-bottom: 2.4rem;
  }
}

/* ---- nagłówek marki ---------------------------------------------------- */

.mc-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--mc-border);
}

/* Informacyjny, nie link: na koszyku jedyna droga prowadzi do przodu. */
.mc-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.mc-brand-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--mc-muted);
  white-space: nowrap;
}

.mc-lock {
  width: 12px;
  height: 12px;
  flex: none;
}

@media (min-width: 880px) {
  .mc-brand {
    margin-bottom: 2rem;
  }
}

/* ---- komunikat ?blad=platnosc ------------------------------------------ */

.mc-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem 0.3rem 0.3rem 0.95rem;
  background: var(--mc-danger-bg);
  border: 1px solid var(--mc-danger-border);
  border-radius: 8px;
  color: var(--mc-danger);
  font-size: 0.9rem;
  line-height: 1.45;
}

.mc-alert p {
  flex: 1;
  margin: 0.6rem 0;
}

.mc-alert-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.mc-alert-close:hover {
  background: rgba(184, 0, 32, 0.08);
}

.mc-alert-close svg {
  width: 18px;
  height: 18px;
}

/* ---- tytuł i sekcje ---------------------------------------------------- */

.mc-title {
  margin: 0 0 1.6rem;
  font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.05rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.mc-form {
  display: flex;
  flex-direction: column;
  gap: 1.9rem;
}

.mc-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0;
}

.mc-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--mc-text);
}

.mc-section-title label {
  cursor: pointer;
}

/* ---- produkt ----------------------------------------------------------- */

.mc-product {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.05rem 1.15rem 1.15rem;
  background: #ffffff;
  border: 1px solid var(--mc-border-strong);
  border-radius: 10px;
}

.mc-product-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.9rem;
}

.mc-product-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.mc-product-price {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mc-price-was {
  font-size: 0.85rem;
  color: var(--mc-subtle);
}

.mc-price-now {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mc-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0.85rem 0 0;
  list-style: none;
  border-top: 1px solid var(--mc-border);
}

.mc-product-list li {
  position: relative;
  padding-left: 1.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.mc-product-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 1.1rem;
  height: 1.1rem;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23e0a800'/%3E%3Cpath d='M5.8 10.3l2.8 2.8 5.6-6' fill='none' stroke='%23202223' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- order bump -------------------------------------------------------- */

/* Głośny PRZED zaznaczeniem – bump ma zauważyć ktoś, kto jeszcze nie zdecydował. */
.mc-bump {
  position: relative;
  background: var(--mc-accent-bg);
  border: 2px dashed var(--mc-accent);
  border-radius: 8px;
  transition: background-color 0.15s;
}

.mc-bump.is-checked {
  border-style: solid;
  background: var(--mc-accent-bg-strong);
}

/* Cała karta jest etykietą pola wyboru: klik w opis też zaznacza. */
.mc-bump-label {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1.05rem 1rem;
  cursor: pointer;
}

.mc-bump-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
}

/* Strzałka wskazująca pole wyboru. Dekoracja, więc pseudo-element. */
.mc-bump-check::before {
  content: "\27A4";
  flex: none;
  color: #d7263d;
  font-size: 1.05rem;
  line-height: 1;
  animation: mc-bump-nudge 2.4s ease-in-out infinite;
}

.mc-bump.is-checked .mc-bump-check::before {
  animation: none;
  opacity: 0.45;
}

.mc-bump input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.mc-bump-box {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 1.5px solid var(--mc-subtle);
  border-radius: 4px;
}

.mc-bump-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center / 13px 13px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E");
  opacity: 0;
  transition: opacity 0.12s;
}

.mc-bump.is-checked .mc-bump-box {
  background: var(--mc-accent);
  border-color: var(--mc-accent);
}

.mc-bump.is-checked .mc-bump-box::after {
  opacity: 1;
}

.mc-bump input:focus-visible + .mc-bump-box {
  outline: 2px solid var(--mc-ink);
  outline-offset: 2px;
}

.mc-bump-headline {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--mc-green);
}

.mc-bump-desc {
  display: block;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #4f5256;
}

.mc-bump-lead {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #b04700;
}

@keyframes mc-bump-nudge {
  0%, 62%, 100% { transform: translateX(0); }
  72% { transform: translateX(5px); }
  82% { transform: translateX(0); }
  90% { transform: translateX(4px); }
  98% { transform: translateX(0); }
}

/* ---- e-mail ------------------------------------------------------------ */

.mc-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mc-input {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 0.95rem;
  font-size: 1rem; /* 16 px: iOS nie przybliża strony przy fokusie */
  background: #ffffff;
  border: 1px solid var(--mc-border-strong);
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.mc-input:hover {
  border-color: var(--mc-subtle);
}

.mc-input:focus {
  outline: 0;
  border-color: var(--mc-ink);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.mc-input::placeholder {
  color: var(--mc-subtle);
}

.mc-input[aria-invalid="true"] {
  border-color: var(--mc-danger);
}

.mc-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(184, 0, 32, 0.14);
}

.mc-help,
.mc-field-error {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.mc-help {
  color: var(--mc-muted);
}

.mc-field-error {
  font-weight: 500;
  color: var(--mc-danger);
}

/* ---- metody płatności -------------------------------------------------- */

.mc-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* float zdejmuje z legendy specjalne renderowanie na ramce fieldsetu. */
.mc-legend {
  float: left;
  width: 100%;
  margin: 0 0 0.8rem;
  padding: 0;
}

.mc-methods {
  clear: both;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--mc-border-strong);
  border-radius: 8px;
}

/* Każdy wiersz ma linię u góry przesuniętą o -1px. Pierwszy widoczny wiersz
   chowa ją pod ramką listy (overflow: hidden), więc nie trzeba wiedzieć w CSS,
   które wiersze JS pokazał. */
.mc-method {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  margin-top: -1px;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border-top: 1px solid var(--mc-border);
  cursor: pointer;
  transition: background-color 0.15s;
}

.mc-method:hover {
  background: #f6f7f8;
}

/* Szary, nie bursztynowy: wybór metody to hydraulika, nie decyzja zakupowa. */
.mc-method.is-checked {
  background: var(--mc-selected);
}

/* Prawdziwy radio button leży na całym wierszu, przezroczysty: klik trafia
   wprost w pole, a fokus z klawiatury rysuje .mc-method-focus. */
.mc-method input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mc-method-focus {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mc-method input:focus-visible ~ .mc-method-focus {
  box-shadow: inset 0 0 0 2px var(--mc-ink);
}

.mc-method-mark {
  flex: none;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 1.5px solid var(--mc-subtle);
  border-radius: 50%;
}

.mc-method.is-checked .mc-method-mark {
  background: var(--mc-mark);
  border-color: var(--mc-mark);
  box-shadow: inset 0 0 0 3.5px #ffffff;
}

.mc-method-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.mc-method-label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.mc-method-sub {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--mc-muted);
}

.mc-method-meta {
  font-size: 0.78rem;
  color: var(--mc-muted);
  white-space: nowrap;
}

@media (max-width: 400px) {
  .mc-method-meta {
    display: none;
  }
}

/* Formularz karty rozwija się pod swoim wierszem, w jego kolorze. */
.mc-method-panel {
  padding: 0.25rem 1rem 1rem;
  background: var(--mc-selected);
}

.mc-pe-host:empty {
  display: none;
}

.mc-pe-skeleton {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0.9rem 1rem;
  background: #ffffff;
  border: 1px dashed var(--mc-border-strong);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--mc-muted);
}

/* ---- podsumowanie ------------------------------------------------------ */

.mc-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mc-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.mc-line-title {
  font-weight: 500;
}

.mc-line-price {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mc-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.2rem;
  padding-top: 0.9rem;
  border-top: 1px solid #d2d5d8;
  font-size: 1.05rem;
  font-weight: 600;
}

.mc-total-row strong {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Telefon: pas na całą szerokość między wyborem a przyciskiem, jak w szablonie. */
.mc-summary-inline {
  margin-left: calc(var(--mc-pad) * -1);
  margin-right: calc(var(--mc-pad) * -1);
  padding: 1.35rem var(--mc-pad);
  background: var(--mc-surface);
  border-top: 1px solid var(--mc-border);
  border-bottom: 1px solid var(--mc-border);
}

.mc-summary-side {
  display: none;
}

.mc-summary-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mc-muted);
}

@media (min-width: 880px) {
  .mc-summary-inline {
    display: none;
  }

  .mc-summary-side {
    display: block;
    padding: 2.4rem var(--mc-pad);
    background: var(--mc-surface);
    border-left: 1px solid var(--mc-border);
  }

  .mc-summary-sticky {
    position: sticky;
    top: 2rem;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }
}

/* ---- przycisk, oświadczenie, gwarancja --------------------------------- */

.mc-payblock {
  display: flex;
  flex-direction: column;
}

.mc-status {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.mc-status[data-kind="error"] {
  background: var(--mc-danger-bg);
  color: var(--mc-danger);
  border: 1px solid var(--mc-danger-border);
}

.mc-status[data-kind="info"] {
  background: #f5f5f5;
  color: var(--mc-text);
  border: 1px solid var(--mc-border);
}

.mc-status-retry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0.15rem 0 -0.45rem;
  padding: 0;
  background: none;
  border: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.mc-pay {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 54px;
  padding: 0.9rem 1.2rem;
  background: var(--mc-ink);
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.mc-pay:hover:not(:disabled) {
  background: #000000;
}

.mc-pay:focus-visible {
  outline: 3px solid var(--mc-accent);
  outline-offset: 2px;
}

.mc-pay:disabled {
  background: #e4e5e7;
  color: #5c5f62;
  cursor: not-allowed;
}

.mc-pay.is-busy,
.mc-pay.is-busy:disabled {
  background: #3a3b3c;
  color: #ffffff;
  cursor: progress;
}

.mc-spinner {
  display: none;
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: mc-spin 0.8s linear infinite;
}

.mc-pay.is-busy .mc-spinner,
.mc-spinner--dark {
  display: inline-block;
}

.mc-spinner--dark {
  width: 14px;
  height: 14px;
  border-color: var(--mc-border);
  border-top-color: var(--mc-ink);
}

/* Express Checkout Element montujemy od razu (żeby zgłosił dostępne portfele),
   ale bez display:none – iframe musi mieć układ. Do czasu wyboru portfela jest
   zwinięty i niewidoczny. */
.mc-express {
  min-height: 52px;
}

.mc-express.is-parked {
  min-height: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.mc-legal {
  margin: 0.85rem 0 0;
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--mc-muted);
}

.mc-legal a {
  color: var(--mc-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mc-guarantee {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.25rem 0 0;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.mc-guarantee-seal {
  flex: none;
  width: 46px;
  height: 46px;
  color: var(--mc-green);
  font-family: var(--mc-font);
}

/* ---- stopka ------------------------------------------------------------ */

.mc-foot {
  margin-top: 2.25rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--mc-border);
  font-size: 0.8rem;
  color: var(--mc-muted);
}

.mc-foot nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.4rem;
}

.mc-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.1rem;
  color: var(--mc-text);
  text-decoration: none;
}

.mc-foot a:hover {
  text-decoration: underline;
}

/* ---- ładowanie konfiguracji -------------------------------------------- */

/* Dopóki nie ma /api/config, kwoty w HTML są tylko wypełniaczem: nie pokazujemy
   ceny, która mogłaby się za chwilę zmienić. */
.is-loading [data-money],
.is-loading [data-total] {
  color: transparent;
  background: #eceef0;
  border-radius: 4px;
}

.is-loading .mc-price-was {
  text-decoration-color: transparent;
}

.is-loading .mc-methods {
  min-height: 170px;
  background: linear-gradient(90deg, #f3f4f5 25%, #e9eaec 50%, #f3f4f5 75%);
  background-size: 200% 100%;
  animation: mc-shimmer 1.4s ease-in-out infinite;
}

@keyframes mc-spin {
  to { transform: rotate(360deg); }
}

@keyframes mc-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
