/* ═══════════════════════════════════════
   Koszyk – tradycyjny flow sklepu
   4 sekcje: Koszyk → Dostawa → Dane → Płatność
═══════════════════════════════════════ */

/* ─── Breadcrumb steps ─── */
.checkout-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.checkout-progress::-webkit-scrollbar { display: none; }

.cp-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.cp-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.cp-step.active .cp-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #0b0908;
}

.cp-step.active { color: var(--text); }
.cp-step.done .cp-step-num {
  background: rgba(72,187,120,0.15);
  border-color: rgba(72,187,120,0.4);
  color: #48bb78;
}
.cp-step.done { color: var(--muted); }

.cp-sep {
  width: 2rem;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

/* ─── Step cards ─── */
.checkout-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.8rem 2rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
}

.checkout-step:last-child { margin-bottom: 0; }

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(201,169,122,0.12);
  border: 1px solid rgba(201,169,122,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.step-header h2 {
  font-size: 1.55rem;
  font-weight: 400;
  margin: 0;
}

/* ─── Cart items (step 1) ─── */
.checkout-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.checkout-item:last-child { border-bottom: none; }

.checkout-item img {
  border-radius: 10px;
  object-fit: cover;
  width: 68px;
  height: 68px;
  border: 1px solid var(--border);
}

.checkout-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.checkout-item-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.2;
}

.checkout-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}

.qty-btn:hover { background: rgba(201,169,122,0.14); }

.qty-num {
  font-size: 0.9rem;
  min-width: 22px;
  text-align: center;
  color: var(--text);
}

.checkout-item-remove {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.34rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
  line-height: 1;
}

.checkout-item-remove:hover {
  background: rgba(229,62,62,0.1);
  border-color: rgba(229,62,62,0.45);
  color: #ff6b6b;
}

.checkout-item-remove:active { transform: scale(0.96); }

/* ─── Banner statusu zamówienia (powrót z płatności) ─── */
.order-status-banner {
  text-align: center;
  padding: 2.6rem 1.6rem;
  margin-bottom: 2rem;
  background: #141210;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.order-status-banner.success { border-color: rgba(93,186,93,0.45); }
.order-status-banner.error   { border-color: rgba(229,62,62,0.45); }
.order-status-banner.invalid { border-color: rgba(229,62,62,0.45); }

.order-status-banner .osb-note {
  max-width: 480px;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(201,169,122,0.08);
  border: 1px solid rgba(201,169,122,0.2);
}

.order-status-banner .osb-errors {
  list-style: none;
  margin: 0 auto 0.4rem;
  padding: 0;
  max-width: 460px;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
}

.order-status-banner .osb-errors li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.5rem;
  line-height: 1.55;
}

.order-status-banner .osb-errors li::before {
  content: '•';
  position: absolute;
  left: 0.35rem;
  color: #fc8181;
  font-weight: 700;
}

.order-status-banner .osb-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #0b0908;
  background: linear-gradient(135deg,#5dba5d,#3f8f3f);
}

.order-status-banner .osb-icon-error {
  background: linear-gradient(135deg,#e06b6b,#b83b3b);
  color: #fff;
}

.order-status-banner h2 {
  margin: 0 0 0.6rem;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.9rem;
  color: var(--text);
}

.order-status-banner p {
  margin: 0 auto 1.5rem;
  max-width: 440px;
  color: var(--muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  line-height: 1.65;
}

.order-status-banner strong { color: var(--accent); }

.checkout-item-remove:focus-visible {
  outline: 2px solid rgba(229,62,62,0.5);
  outline-offset: 2px;
}

.checkout-item-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--accent);
  white-space: nowrap;
  text-align: right;
}

.step-subtotal-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.step-subtotal-row strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 400;
}

.empty-cart-msg {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── Delivery options (step 2) ─── */
.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.delivery-option { position: relative; }

.delivery-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.delivery-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s;
}

.delivery-option input[type="radio"]:checked + .delivery-card {
  border-color: rgba(201,169,122,0.65);
  background: rgba(201,169,122,0.07);
}

.delivery-card strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.delivery-card span:not(.delivery-price) {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.delivery-card span:not(.delivery-price) strong {
  font-size: inherit;
  font-weight: 700;
  color: inherit;
}

.delivery-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--primary);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ─── InPost GeoWidget container ─── */
.paczkomat-field {
  margin-top: 0.75rem;
}

/* Selected paczkomat confirmation bar */
.paczkomat-selected {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: rgba(72,187,120,0.07);
  border: 1px solid rgba(72,187,120,0.28);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.paczkomat-selected-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.paczkomat-selected-info {
  flex: 1;
  min-width: 0;
}

.paczkomat-selected-info span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(72,187,120,0.8);
  margin-bottom: 0.15rem;
}

.paczkomat-selected-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paczkomat-change-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.paczkomat-change-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Error hint */
.paczkomat-error {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #e53e3e;
  display: none;
}

/* ─── Panel wyboru paczkomatu ───────────────────────────────────────────────
   Mapa nie jest już wciśnięta w wąski pasek w formularzu — tutaj jest tylko
   informacja o stanie wyboru i przycisk otwierający pełnowymiarowe okno. */
.paczkomat-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  transition: border-color 0.22s, background 0.22s;
}

.paczkomat-picker.is-chosen {
  border-color: rgba(93,186,93,0.4);
  background: rgba(93,186,93,0.06);
}

.paczkomat-picker-icon { font-size: 1.7rem; line-height: 1; flex: none; }

.paczkomat-picker-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.paczkomat-picker-info strong {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.paczkomat-picker-info span {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.45;
}

.paczkomat-picker-btn {
  flex: none;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), #a88a5e);
  color: #0b0908;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.18s;
}

.paczkomat-picker-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(201,169,122,0.28);
}

.paczkomat-picker-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 560px) {
  .paczkomat-picker { flex-wrap: wrap; }
  .paczkomat-picker-btn { width: 100%; }
}

/* ─── Okno modalne z mapą ───────────────────────────────────────────────────
   Mapa dostaje pełną szerokość panelu i wysokość znacznie ponad zalecane
   minimum 400–500 px, żeby pinezki i lista punktów były czytelne. */
.geo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.geo-modal[hidden] { display: none; }

.geo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(2px);
}

.geo-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(760px, 90vh);
  background: #141210;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}

.geo-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.geo-modal-head h3 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--text);
}

.geo-modal-close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}

.geo-modal-close:hover { color: var(--text); border-color: var(--primary); }
.geo-modal-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Kluczowe: min-height:0 pozwala temu elementowi skurczyć się w kolumnie flex,
   dzięki czemu widget dostaje realną wysokość zamiast rozpychać panel. */
.geo-modal-body {
  flex: 1;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.geo-modal-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
}

.geo-modal-hint {
  flex: none;
  margin: 0;
  padding: 0.75rem 1.3rem;
  border-top: 1px solid var(--border);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

inpost-geowidget {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

@media (max-width: 640px) {
  .geo-modal { padding: 0; }
  .geo-modal-panel { width: 100%; height: 100%; border-radius: 0; border: none; }
}

/* Awaryjne ręczne wpisanie kodu paczkomatu, gdy mapa InPost się nie załaduje. */
.geo-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  padding: 1.6rem 1.4rem;
  background: #141210;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.86rem;
  color: var(--muted);
}

.geo-fallback input.has-error { border-color: rgba(229,62,62,0.6); }
.geo-fallback .paczkomat-picker-btn { margin-top: 0.9rem; }

.geo-fallback p { margin: 0 0 0.55rem; line-height: 1.55; }
.geo-fallback strong { color: var(--text); }

.geo-fallback label {
  display: block;
  margin: 0.9rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.geo-fallback input {
  width: 100%;
  max-width: 220px;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.geo-fallback input:focus { border-color: rgba(201,169,122,0.55); }

.geo-fallback-hint { margin-top: 0.6rem; font-size: 0.78rem; }
.geo-fallback-hint a { color: var(--primary); }

/* ─── Form (step 3) ─── */
.form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 1.4rem 0 0.8rem;
}

.form-section-title:first-child { margin-top: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-bottom: 0.7rem;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  padding: 0.62rem 0.9rem;
  transition: border-color 0.22s;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(201,169,122,0.55);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted); opacity: 0.7; }

/* ─── Walidacja formularza zamówienia ─── */
.form-group input.has-error,
.form-group textarea.has-error {
  border-color: rgba(229,62,62,0.6);
  background: rgba(229,62,62,0.05);
}

.field-error {
  margin: 0.35rem 0 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #fc8181;
}

/* Zbiorcze podsumowanie braków nad przyciskiem płatności. */
.checkout-form-error {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(229,62,62,0.35);
  border-radius: var(--radius-sm);
  background: rgba(229,62,62,0.08);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: var(--text);
}

.checkout-form-error strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #fc8181;
  font-size: 0.86rem;
}

.checkout-form-error ul { margin: 0; padding-left: 1.15rem; }
.checkout-form-error li { margin: 0.25rem 0; line-height: 1.5; color: var(--muted); }

/* Informacja o danych uzupełnionych z pamięci przeglądarki. */
.saved-data-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(93,186,93,0.28);
  border-radius: var(--radius-sm);
  background: rgba(93,186,93,0.06);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.79rem;
  color: var(--muted);
}

.saved-data-note span { color: #5dba5d; }

.saved-data-note button {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.saved-data-note button:hover { color: var(--text); }

/* ─── Payment summary (step 4) ─── */
.checkout-step--payment {
  border-color: rgba(201,169,122,0.2);
  background: linear-gradient(135deg, rgba(201,169,122,0.04), transparent);
}

.payment-summary {
  margin-bottom: 1.5rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(42,36,30,0.6);
}

.summary-line:last-child { border-bottom: none; }

.summary-line span:last-child { color: var(--text); }

.summary-line.summary-total {
  padding: 0.9rem 0 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.summary-line.summary-total span:first-child {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.summary-line.summary-total span:last-child {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  color: var(--accent);
  font-weight: 400;
}

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.terms-row input[type="checkbox"] {
  margin-top: 0.18rem;
  flex-shrink: 0;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.terms-row > span { flex: 1; min-width: 0; }
.terms-row a { color: var(--primary); text-decoration: underline; }
.terms-row a:hover { color: var(--accent); }

.pay-btn {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #c9a97a, #a88a5e);
  border: none;
  color: #0b0908;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(201,169,122,0.3);
  transition: transform 0.18s, box-shadow 0.18s;
  letter-spacing: 0.02em;
}

.pay-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(201,169,122,0.42);
}

.pay-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
  margin-bottom: 1.4rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text); }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .checkout-step { padding: 1.2rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .delivery-options { grid-template-columns: 1fr; }
  .checkout-item { grid-template-columns: 56px 1fr auto; gap: 0.7rem; }
  .checkout-item img { width: 56px; height: 56px; }
  .cp-sep { width: 1rem; }
}

