/**
 * Przycisk Zwrotu - EU Withdrawal Button (Article 11a CRD)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License version 3.0
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 *
 * @author    przyciskzwrotu.eu
 * @copyright 2026 przyciskzwrotu.eu
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 */
/* === Przycisk Zwrotu - style frontowe === */

.pz-info-box {
  background: #f8f9fa;
  border-left: 4px solid #c00000;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
}

.pz-legal-basis {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 0.5rem 0 0;
}

.pz-withdrawal-form {
  background: #fff;
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.pz-withdrawal-form .form-group {
  margin-bottom: 1.25rem;
}

.pz-withdrawal-form label.required::after {
  content: ' *';
  color: #c00000;
}

.pz-withdrawal-button {
  background-color: #c00000;
  color: #fff !important;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none !important;
  display: inline-block;
  transition: filter 0.15s ease;
}

.pz-withdrawal-button:hover {
  filter: brightness(0.9);
  color: #fff !important;
}

.pz-button-large {
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
}

.pz-form-submit {
  margin-top: 1.5rem;
}

.pz-next-step-note {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.75rem;
}

/* === Krok 2 === */

.pz-progress {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.pz-step {
  font-size: 0.9rem;
  color: #6c757d;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: #f8f9fa;
}

.pz-step-done {
  color: #28a745;
  background: #d4edda;
}

.pz-step-active {
  color: #fff;
  background: #c00000;
  font-weight: 600;
}

.pz-confirm-box {
  background: #fff;
  padding: 2rem;
  border: 2px solid #c00000;
  border-radius: 6px;
}

.pz-warning-text {
  font-size: 1rem;
  color: #721c24;
  background: #f8d7da;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.pz-summary {
  margin: 1.5rem 0;
  background: #f8f9fa;
  padding: 1.25rem;
  border-radius: 4px;
}

.pz-summary dt {
  font-weight: 600;
  margin-top: 0.5rem;
}

.pz-summary dd {
  margin: 0 0 0.5rem 0;
}

.pz-confirm-form {
  text-align: center;
  margin: 2rem 0 1rem;
}

.pz-after-confirm-note {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 1rem;
}

.pz-back-link {
  text-align: center;
  margin-top: 1rem;
}

.pz-back-link a {
  color: #6c757d;
  font-size: 0.9rem;
}

/* === Sukces === */

.pz-success {
  text-align: center;
}

.pz-success-icon {
  font-size: 5rem;
  color: #28a745;
  width: 100px;
  height: 100px;
  line-height: 100px;
  background: #d4edda;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

.pz-summary-box {
  background: #f8f9fa;
  padding: 1.25rem;
  border-radius: 4px;
  text-align: left;
  display: inline-block;
  margin: 1rem auto;
}

.pz-next-steps {
  text-align: left;
  margin: 2rem 0;
  background: #fff;
  padding: 1.5rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.pz-next-steps ol {
  padding-left: 1.25rem;
}

.pz-next-steps li {
  margin-bottom: 0.75rem;
}

/* === Hook: stopka === */

.pz-footer-link {
  margin: 0.5rem 0;
}

.pz-footer-link a {
  font-size: 0.9rem;
  color: inherit;
  text-decoration: underline;
}

/* === Hook: order details === */

.pz-order-detail-box {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fafafa;
}

.pz-deadline-info {
  margin-bottom: 0.75rem;
  color: #6c757d;
}

/* === Product list for partial withdrawal === */

.pz-products-list {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.pz-products-list .form-check {
  margin-bottom: 0.5rem;
}

/* === Responsiveness === */

@media (max-width: 576px) {
  .pz-withdrawal-wrapper {
    margin: 1rem auto;
    padding: 0.75rem;
  }

  .pz-confirm-box {
    padding: 1.25rem;
  }

  .pz-button-large {
    width: 100%;
  }

  .pz-progress {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* === Step 1: request type note === */
.pz-type-note {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.pz-type-withdrawal {
  background: #fff3cd;
  border-left: 4px solid #f0ad4e;
  color: #6b5400;
}
.pz-type-cancellation {
  background: #d1ecf1;
  border-left: 4px solid #17a2b8;
  color: #0c5460;
}
.pz-guest-note {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 1.25rem;
}
.pz-withdrawal-form select.form-control {
  height: auto;
  padding: 0.6rem;
}

/* === Pole IBAN === */
.pz-iban-wrap {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #17a2b8;
}

/* === Korekta layoutu: szerszy formularz, lepiej wpasowany === */
.pz-withdrawal-wrapper {
  max-width: 860px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* === Form sections (clarity) === */
.pz-section {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.pz-section-title {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f0f0f0;
}
.pz-verified-info {
  background: #d4edda;
  color: #155724;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.pz-form-submit { margin-top: 1.25rem; }

/* === STOPKA: subtelny outline button (nie krzyczy) === */
.pz-footer-link {
  margin-top: 1.5rem !important;
  display: flex;
  clear: both;
  width: 100%;
}
.pz-footer-align-left { justify-content: flex-start; }
.pz-footer-align-center { justify-content: center; }
.pz-footer-align-right { justify-content: flex-end; }

.pz-footer-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.9rem;
  /* Semi-transparent white background + light border. On a dark footer it gives a readable,
     subtelny przycisk; na jasnej pozostaje delikatny. Jawny kolor tekstu
     (non-inherited) prevents "blending" with dimmed links. */
  border: 1px solid rgba(150, 150, 150, 0.5);
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none !important;
  transition: all 0.15s ease;
  background: rgba(127, 127, 127, 0.12);
  color: inherit !important;
}
.pz-footer-button .pz-icon,
.pz-footer-button span {
  /* A subtle shadow improves readability regardless of the footer background colour. */
  opacity: 0.95;
}
.pz-footer-button:hover {
  border-color: rgba(150, 150, 150, 0.9);
  background: rgba(127, 127, 127, 0.22);
}
.pz-footer-button .pz-icon {
  flex-shrink: 0;
}

/* LIGHT variant - for dark footers (explicit white text and border). */
.pz-footer-button.pz-footer-theme-light {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}
.pz-footer-button.pz-footer-theme-light:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}
/* Wariant CIEMNY - dla jasnych stopek (jawny ciemny tekst i ramka). */
.pz-footer-button.pz-footer-theme-dark {
  color: #333333 !important;
  border-color: rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.03);
}
.pz-footer-button.pz-footer-theme-dark:hover {
  border-color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.08);
}

/* === ACCOUNT PANEL: tile with the same width as native ones === */
/* The "Withdraw from contract" tile in the account panel: intentionally WITHOUT custom styling.
   We use the native PrestaShop structure (a.col-* > span.link-item), thanks to
   which every theme (Classic, Hummingbird and others) styles it the same as
   the other account tiles. Imposing a custom look broke consistency on
   themes other than Classic. Only a minor tweak: the icon is centred. */
#pz-account-link .pz-icon {
  display: block;
  margin: 0 auto 10px;
}

/* === FORM: unified section width (no more drifting) === */
.pz-withdrawal-wrapper .pz-section {
  width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}
.pz-withdrawal-form {
  width: 100%;
}

/* ===================================================================
   ALIGNMENT FIXES (conflict with Bootstrap/Classic)
   =================================================================== */

/* Issue 1: the select clipped text - set height and padding */
.pz-withdrawal-form select.form-control,
.pz-withdrawal-form .form-control {
  height: auto;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

/* Issues 2,3,4: checkboxes and radios escaped to the left.
   We enforce a consistent layout: input + label on one line, from the section's left edge. */
.pz-withdrawal-form .form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding-left: 0;
  margin-left: 0;
  margin-bottom: 0.5rem;
}
.pz-withdrawal-form .form-check .form-check-input {
  position: static;   /* Bootstrap applies absolute + negative margin -> hence the escape */
  margin: 0.2rem 0 0 0;
  float: none;
  flex-shrink: 0;
}
.pz-withdrawal-form .form-check .form-check-label {
  margin: 0;
  cursor: pointer;
}

/* Selectable product list - align to the section's left edge */
.pz-withdrawal-form .pz-products-list {
  margin-top: 0.6rem;
  padding: 0.75rem;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
}
.pz-withdrawal-form .pz-products-list .form-check {
  margin-bottom: 0.35rem;
}

/* Field labels full-width, aligned left */
.pz-withdrawal-form .form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

/* === Product thumbnails in selection (BUG 5) === */
.pz-product-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.pz-product-row:last-child { border-bottom: none; }
.pz-product-row .form-check-input {
  margin: 0 !important;
  flex-shrink: 0;
}
.pz-product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e3e6ea;
  flex-shrink: 0;
}
.pz-product-row .form-check-label {
  margin: 0;
  line-height: 1.3;
}
@media (max-width: 576px) {
  .pz-product-thumb { width: 40px; height: 40px; }
  .pz-product-row { gap: 0.5rem; }
}

/* === Produkty wykluczone ze zwrotu === */
.pz-product-excluded {
  opacity: 0.55;
}
.pz-product-excluded .form-check-label {
  cursor: not-allowed;
}
.pz-excluded-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #842029;
  background: #f8d7da;
  border-radius: 3px;
  vertical-align: middle;
}
.pz-exclusion-note {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  color: #664d03;
  background: #fff3cd;
  border-radius: 4px;
}
