/**
 * MotoClassicWrocław — Formularz zgłoszeniowy
 */

/* =========================================================
 * OGÓLNE
 * ========================================================= */
form#mcw-event-form ::placeholder {
  opacity: 1;
  color: #666;
}
.mcw-event-form-wrapper {
  margin: 0 auto;
  font-family: inherit;
  color: var(--black);
}

.mcw-event-form-wrapper *,
.mcw-event-form-wrapper *::before,
.mcw-event-form-wrapper *::after {
  box-sizing: border-box;
}
form#mcw-event-form svg {
  width: 18px;
  height: 18px;
  fill: #666;
}
form#mcw-event-form label button {
  background: none;
}
/* =========================================================
 * FIELDSET / LEGEND
 * ========================================================= */
.mcw-fieldset {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  background: #fff;
}

.mcw-fieldset legend {
  font-size: 1.15em;
  font-weight: 700;
  padding: 0 12px;
  color: #222;
}

/* =========================================================
 * POLA FORMULARZA
 * ========================================================= */
.mcw-form-row {
  margin-bottom: 16px;
}

.mcw-form-row:last-child {
  margin-bottom: 0;
}

.mcw-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .mcw-two-cols {
    grid-template-columns: 1fr;
  }
}

.mcw-field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.9em;
  color: #333;
}

.mcw-field input[type="text"],
.mcw-field input[type="email"],
.mcw-field input[type="tel"],
.mcw-field input[type="number"],
.mcw-field select,
.mcw-field textarea {
  width: 100%;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95em;
  transition: border-color 0.2s;
}
.mcw-field input[type="radio"] {
  accent-color: var(--black);
  width: 18px;
  height: 18px;
}

.mcw-field input:focus,
.mcw-field select:focus,
.mcw-field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.15);
}

.mcw-event-form-wrapper .required {
  color: #c00;
  font-size: 140%;
  line-height: 1;
}

.mcw-inherited-field {
  background: #f5f5f5;
  color: #888;
  cursor: not-allowed;
}
.mcw-form-help {
  background: #f0f4ff;
  border: 1px solid #c0d0f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9em;
  color: #335;
  display: flex;
  align-items: flex-start;
  line-height: 1.2;
  gap: 4px;
}
.mcw-form-help svg {
  width: 18px;
  height: 18px;
  fill: #666;
}
/* =========================================================
 * CHECKBOXY / RADIO
 * ========================================================= */
.mcw-checkbox-inline {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
  cursor: pointer;
  color: #444;
}

.mcw-checkbox-inline input[type="checkbox"],
.mcw-checkbox-inline input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mcw-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}

.mcw-radio {
  display: flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
}
.mcw-checkbox-inline a {
  font-weight: 800;
  text-decoration: underline;
}
/* =========================================================
 * REPEATER (osoby towarzyszące, pojazdy)
 * ========================================================= */
.mcw-repeater-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
  background: #fafafa;
  position: relative;
}

.mcw-repeater-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.mcw-repeater-header h4 {
  margin: 0;
  font-size: 1em;
  font-weight: 700;
  color: #444;
}

.mcw-btn-remove {
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mcw-btn-remove:hover {
  border-color: #c00;
  color: #c00;
  background: #fff0f0;
}

/* =========================================================
 * PRZYCISKI
 * ========================================================= */
.mcw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.mcw-btn-primary {
  background: var(--black);
  color: #fff;
  font-size: 1.1em;
  padding: 14px 32px;
}

.mcw-btn-primary:hover {
  background: #9a7209;
}

.mcw-btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.mcw-btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.mcw-btn-secondary:hover {
  background: #eee;
  border-color: #bbb;
}

/* =========================================================
 * DRAG-DROP UPLOAD
 * ========================================================= */
.mcw-dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.mcw-dropzone:hover,
.mcw-dropzone-active {
  border-color: var(--black);
  background: rgba(184, 134, 11, 0.04);
}

.mcw-dropzone-text {
  color: #999;
  font-size: 0.9em;
}

.mcw-dropzone-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.mcw-dropzone-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.mcw-file-name {
  flex: 1;
  font-size: 0.85em;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcw-remove-file {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8em;
  cursor: pointer;
  color: #c00;
}

.mcw-remove-file:hover {
  background: #fff0f0;
  border-color: #c00;
}

/* =========================================================
 * PODSUMOWANIE
 * ========================================================= */
.mcw-summary-section {
  background: #fffdf5;
  border-color: #e8d9a0;
}

.mcw-summary-item {
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}

.mcw-summary-item:last-child {
  border-bottom: none;
}

.mcw-summary-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mcw-summary-item-label {
  font-weight: 600;
  font-size: 0.95em;
  color: #333;
}

.mcw-summary-item-price {
  font-weight: 700;
  font-size: 0.95em;
  white-space: nowrap;
  color: #222;
}

.mcw-summary-item-details {
  margin: 4px 0 0 16px;
  padding: 0;
  list-style: none;
}

.mcw-summary-item-details li {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}

.mcw-summary-item-details li::before {
  content: "–";
  margin-right: 6px;
  color: #aaa;
}

.mcw-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-top: 1rem;
  border-top: 1px solid var(--black);
  font-size: 1.15em;
}

#mcw-total-price {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--black);
}

/* =========================================================
 * KOD RABATOWY
 * ========================================================= */
.mcw-coupon-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.mcw-coupon-field {
  flex: 1;
}

.mcw-coupon-field input {
  width: 100%;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95em;
  transition: border-color 0.2s;
}

.mcw-coupon-field input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.15);
}

.mcw-coupon-field input[readonly] {
  background: #f5f5f5;
  color: #666;
}

.mcw-coupon-message {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
}

.mcw-coupon-success {
  background: #f0faf0;
  border: 1px solid #a0d0a0;
  color: #2a7a2a;
}

.mcw-coupon-error {
  background: #fff0f0;
  border: 1px solid #e0b0b0;
  color: #900;
}

/* Rabat w podsumowaniu */
.mcw-coupon-discount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95em;
  color: #2a7a2a;
}

.mcw-discount-amount {
  font-weight: 700;
  white-space: nowrap;
}

/* =========================================================
 * BŁĘDY
 * ========================================================= */
.mcw-errors {
  background: #fff0f0;
  border: 1px solid #e0b0b0;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  color: #900;
}

.mcw-errors ul {
  margin: 0;
  padding-left: 20px;
  list-style: auto;
}

.mcw-errors li {
  margin-bottom: 4px;
  font-size: 0.9em;
  width: fit-content;
}

.mcw-error {
  color: #c00;
  font-weight: 600;
}

/* =========================================================
 * INFO
 * ========================================================= */
.mcw-info {
  background: #f0f4ff;
  border: 1px solid #c0d0f0;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9em;
  color: #335;
  margin-bottom: 16px;
}

/* =========================================================
 * SUBMIT ROW
 * ========================================================= */
.mcw-submit-row {
  text-align: center;
  padding-top: 12px;
}

/* =========================================================
 * CART / CHECKOUT — szczegóły wydarzenia
 * ========================================================= */
.mcw-cart-event-details {
  margin-top: 8px;
}

.mcw-toggle-details {
  font-size: 0.85em;
  color: var(--black);
  text-decoration: underline;
}

.mcw-details-content {
  margin-top: 8px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 4px;
}

.mcw-details-content p {
  margin: 1rem 0;
}

.mcw-details-content ul {
  margin: 4px 0 8px 16px;
  padding: 0;
  list-style: none;
}

.mcw-details-content li {
  margin-bottom: 2px;
}

/* =========================================================
 * PODSUMOWANIE — szczegóły zamówienia Override woocommerce
  (w koszyku i na stronie zamówienia)
  Override domyślnych stylów WooCommerce dla sekcji podsumowania zamówienia,
  aby lepiej pasowały do ogólnego designu formularza zgłoszeniowego.
 * ========================================================= */
form.woocommerce-checkout h3 {
  margin-bottom: 1rem;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody,
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody .product-name {
  width: 100%;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody .cart_item {
  display: flex;
  width: 100%;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table thead,
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody .product-total,
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody .product-quantity {
  display: none;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th {
  width: 100%;
}

/* =========================================================
 * Animacja przycisku info (kropka z pytajnikiem) — delikatna fala rozchodząca się od przycisku, aby zwrócić uwagę użytkownika, że jest tam dodatkowa informacja do odkrycia.
  Override domyślnych stylów WooCommerce dla przycisku info w podsumowaniu zamówienia, dodając animację fali, która rozchodzi się od przycisku, aby zwrócić uwagę użytkownika na dodatkowe informacje.
 * ========================================================= */
button.mcw-info-popup-btn svg {
  animation-iteration-count: infinite;
  animation: hoverWave2 linear 2s infinite;
  border-radius: 50vw;
}

@keyframes hoverWave2 {
  0% {
    box-shadow:
      0 0px 0px rgba(36, 109, 164, 0.3),
      0 0 0 0 rgba(36, 109, 164, 0.2),
      0 0 0 0 rgba(36, 109, 164, 0.2);
  }
  40% {
    box-shadow:
      0 0px 0px rgba(36, 109, 164, 0.3),
      0 0 0 5px rgba(36, 109, 164, 0.2),
      0 0 0 5px rgba(36, 109, 164, 0.2);
  }
  80% {
    box-shadow:
      0 0px 0px rgba(36, 109, 164, 0.3),
      0 0 0 10px rgba(36, 109, 164, 0),
      0 0 0 10px rgba(36, 109, 164, 0.067);
  }
  100% {
    box-shadow:
      0 0px 0px rgba(36, 109, 164, 0.3),
      0 0 0 15px rgba(36, 109, 164, 0),
      0 0 0 15px rgba(36, 109, 164, 0);
  }
}

/* =========================================================
 * POLE TELEFONU — prefiks (select2/selectWoo) + numer
 * ========================================================= */
.mcw-event-form-wrapper .mcw-phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.mcw-event-form-wrapper .mcw-phone-row > input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
}
.mcw-event-form-wrapper .mcw-phone-row .select2-container,
.mcw-event-form-wrapper .mcw-phone-row .select2 {
  flex: 0 0 auto;
  min-width: 110px;
}
.mcw-event-form-wrapper .mcw-phone-row .select2-container .select2-selection--single {
  height: auto;
  min-height: 42px;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.select2-search__field {
  line-height: 30px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
  background-color: var(--black);
  color: #fff;
}
.mcw-event-form-wrapper .mcw-phone-row .select2-container .select2-selection__rendered {
  line-height: 1.4;
  padding: 0 28px 0 10px;
  color: #222;
}
.mcw-event-form-wrapper .mcw-phone-row .select2-container .select2-selection__arrow {
  height: 100%;
  top: 0;
}
/* Fallback gdy oryginalny <select> jest widoczny (brak select2/selectWoo) */
.mcw-event-form-wrapper .mcw-phone-row > select.mcw-phone-prefix {
  flex: 0 0 auto;
  min-width: 110px;
  width: auto;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
/* Dropdown listy prefiksów */
.select2-dropdown .select2-results__option {
  padding: 6px 12px;
  font-size: 0.95em;
}
