/**
 * 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    EuroTrade
 * @copyright 2026 EuroTrade
 * @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: native-looking tile and sidebar link === */
/* Keep the native PrestaShop account-link structure and inherit the theme's
   colours/backgrounds. We only normalize the icon/text layout so the module
   link does not look like a separate, added block. */
.pz-account-link .link-item {
  text-align: left;
}
.pz-account-link .pz-account-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 0 0.55rem;
  padding: 0;
  color: currentColor;
  font-size: 0;
  line-height: 1;
}
.pz-account-link .pz-account-svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Some themes render displayCustomerAccount output inside an account sidebar
   as well as on the main tile grid. In narrow/sidebar contexts, make the link
   behave like a normal menu row: icon left, label next to it, no card spacing. */
#left-column .pz-account-link,
#right-column .pz-account-link,
.account-sidebar .pz-account-link,
.account-navigation .pz-account-link,
.customer-account-menu .pz-account-link {
  display: block;
  width: 100%;
  max-width: none;
  padding: 0;
}
#left-column .pz-account-link .link-item,
#right-column .pz-account-link .link-item,
.account-sidebar .pz-account-link .link-item,
.account-navigation .pz-account-link .link-item,
.customer-account-menu .pz-account-link .link-item {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.55rem 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
}
#left-column .pz-account-link .pz-account-icon,
#right-column .pz-account-link .pz-account-icon,
.account-sidebar .pz-account-link .pz-account-icon,
.account-navigation .pz-account-link .pz-account-icon,
.customer-account-menu .pz-account-link .pz-account-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex: 0 0 auto;
}

/* === 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-withdrawal-form .pz-product-row {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center !important;
  grid-auto-rows: auto;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.pz-withdrawal-form .pz-product-row:last-child { border-bottom: none; }
.pz-withdrawal-form .pz-product-row .form-check-input {
  grid-column: 1;
  grid-row: 1;
  margin: 0 !important;
  align-self: center;
  justify-self: center;
}
.pz-withdrawal-form .pz-product-thumb {
  grid-column: 2;
  grid-row: 1;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e3e6ea;
  flex-shrink: 0;
}
.pz-withdrawal-form .pz-product-row .form-check-label {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  line-height: 1.3;
  min-width: 0;
  padding-right: 0.75rem;
}
.pz-withdrawal-form .pz-qty-control {
  grid-column: 4;
  grid-row: 1;
  display: inline-flex !important;
  align-items: stretch;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  margin-left: auto;
  height: 34px;
  border: 1px solid #d6dbe1;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}
.pz-withdrawal-form .pz-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f8f9fa;
  color: #343a40;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.pz-withdrawal-form .pz-qty-btn:hover {
  background: #eef1f4;
}
.pz-withdrawal-form .pz-qty-btn:focus {
  outline: 2px solid rgba(13, 110, 253, 0.22);
  outline-offset: -2px;
}
.pz-withdrawal-form .pz-qty-input {
  width: 52px !important;
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 0.25rem !important;
  margin: 0 !important;
  border: 0 !important;
  border-left: 1px solid #d6dbe1 !important;
  border-right: 1px solid #d6dbe1 !important;
  font-family: inherit;
  line-height: 32px !important;
  text-align: center;
  box-sizing: border-box;
  box-shadow: none !important;
  -moz-appearance: textfield;
}
.pz-withdrawal-form .pz-qty-input::-webkit-outer-spin-button,
.pz-withdrawal-form .pz-qty-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
.pz-withdrawal-form .pz-qty-input:disabled {
  background: #f8f9fa;
  color: #6c757d;
}
@media (max-width: 767.98px) {
  .pz-withdrawal-form .pz-product-thumb { width: 40px; height: 40px; }
  .pz-withdrawal-form .pz-product-row {
    grid-template-columns: 24px 48px minmax(0, 1fr);
    align-items: start !important;
    gap: 0.5rem;
  }
  .pz-withdrawal-form .pz-product-row .form-check-input {
    align-self: start;
    margin-top: 0.55rem !important;
  }
  .pz-withdrawal-form .pz-product-thumb {
    align-self: start;
  }
  .pz-withdrawal-form .pz-product-row .form-check-label {
    padding-right: 0;
  }
  .pz-withdrawal-form .pz-qty-control {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    margin-left: 0;
    margin-top: 0.35rem;
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .pz-withdrawal-form .pz-product-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.55rem;
  }
  .pz-withdrawal-form .pz-product-row .form-check-input {
    grid-column: 1;
    grid-row: 1;
  }
  .pz-withdrawal-form .pz-product-thumb {
    grid-column: 2;
    grid-row: 1;
  }
  .pz-withdrawal-form .pz-product-row .form-check-label {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .pz-withdrawal-form .pz-qty-control {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: end;
  }
}

/* === 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;
}

/* === Optional customer attachments === */
.pz-withdrawal-form .pz-attachments {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}
.pz-withdrawal-form .pz-attachments-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}
.pz-withdrawal-form .pz-attachments-help {
  margin: 0 0 0.75rem;
  color: #6c757d;
  font-size: 0.86rem;
  line-height: 1.45;
}
.pz-withdrawal-form .pz-attachments-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pz-withdrawal-form .pz-attachments-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.pz-withdrawal-form .pz-attachments-button,
.pz-withdrawal-form .pz-attachments-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.45rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.pz-withdrawal-form .pz-attachments-button {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}
.pz-withdrawal-form .pz-attachments-clear {
  margin-top: 0.65rem;
}
.pz-withdrawal-form .pz-attachments-clear[hidden] {
  display: none;
}
.pz-withdrawal-form .pz-attachments-button:hover,
.pz-withdrawal-form .pz-attachments-clear:hover {
  transform: translateY(-1px);
}
.pz-withdrawal-form .pz-attachments-input:focus + .pz-attachments-feedback,
.pz-withdrawal-form .pz-attachments-button:focus {
  outline: 2px solid rgba(13, 110, 253, 0.25);
  outline-offset: 2px;
}
.pz-withdrawal-form .pz-attachments-status {
  min-width: 0;
  max-width: 100%;
  color: #4b5563;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.pz-withdrawal-form .pz-attachments-feedback {
  display: none;
  margin-top: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.35;
}
.pz-withdrawal-form .pz-attachments-feedback.is-error {
  display: block;
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f1aeb5;
}
.pz-withdrawal-form .pz-attachments-feedback.is-ok {
  display: block;
  color: #0f5132;
  background: #d1e7dd;
  border: 1px solid #a3cfbb;
}
.pz-withdrawal-form .pz-attachments-selected {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.pz-withdrawal-form .pz-attachments-selected[hidden] {
  display: none;
}
.pz-withdrawal-form .pz-attachments-selected li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 0.86rem;
}
.pz-withdrawal-form .pz-attachments-file-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}
.pz-withdrawal-form .pz-attachments-file-name {
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.pz-withdrawal-form .pz-attachments-file-size {
  flex: 0 0 auto;
  color: #6c757d;
  white-space: nowrap;
}
.pz-withdrawal-form .pz-attachments-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.pz-withdrawal-form .pz-attachments-remove:hover,
.pz-withdrawal-form .pz-attachments-remove:focus {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
  outline: none;
}
@media (max-width: 480px) {
  .pz-withdrawal-form .pz-attachments {
    padding: 0.85rem;
  }
  .pz-withdrawal-form .pz-attachments-picker {
    align-items: stretch;
    flex-direction: column;
  }
  .pz-withdrawal-form .pz-attachments-button,
  .pz-withdrawal-form .pz-attachments-clear {
    width: 100%;
  }
  .pz-withdrawal-form .pz-attachments-selected li {
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
  }
  .pz-withdrawal-form .pz-attachments-file-details {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }
}
