/* Dynamic forms and classic WooCommerce, using Astro tokens. */
.lite-main { max-width: var(--container); margin: auto; padding: var(--space-2xl) var(--space-m); min-height: 50vh; }
.lite-main h1 { font-size: var(--text-h1); margin-bottom: var(--space-xl); }
.lite-main h2 { font-size: var(--text-h2); }
.lite-main h3 { font-size: var(--text-h3); }
.lite-main input:not([type="checkbox"], [type="radio"]), .lite-main select, .lite-main textarea { max-width: 100%; padding: var(--space-s); border: 1px solid var(--color-field-border); border-radius: var(--radius-field); background: var(--color-surface); color: var(--color-ink); font: inherit; }
.lite-main label { display: block; margin-bottom: var(--space-xs); }
.lite-main .form-row { margin-bottom: var(--space-m); }
body.receptomaty-lite .lite-main .wsf-button, .lite-main .button, .lite-main button[type="submit"] { display: inline-block; padding: var(--space-s) var(--space-m); border: 0; border-radius: var(--radius-sm); background: var(--color-deep); color: var(--color-on-deep); cursor: pointer; font: inherit; text-decoration: none; }
.lite-main :focus-visible { outline: 3px solid var(--color-deep); outline-offset: 3px; }
.lite-main .shop_table { width: 100%; border-collapse: collapse; }
.lite-main .shop_table th, .lite-main .shop_table td { padding: var(--space-s); text-align: left; border-bottom: 1px solid var(--color-line); overflow-wrap: anywhere; }
/* Astro's bare th/td rules target dark sections; WP pages are light. */
.lite-main th, .lite-main td, .lite-main td:first-child { color: var(--color-ink); border-bottom-color: var(--color-line); }
.lite-main td:first-child { font-weight: inherit; }
.lite-main .woocommerce-error { color: var(--color-danger-strong); }
.lite-main .woocommerce-info, .lite-main .woocommerce-message { padding: var(--space-m); background: var(--color-soft); margin-bottom: var(--space-m); }
.lite-main .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wizyta-container { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-xl); }
.wizyta-column__content { padding: var(--space-m); background: var(--color-soft); border-radius: var(--radius-md); }
.content-ankieta-medyczna { display: none; }
.lite-payment-header { background: var(--color-surface); }
.lite-payment-header__inner { max-width: var(--container); margin: auto; padding: var(--space-s) var(--space-m); display: flex; justify-content: center; }
.lite-payment-header img { width: 160px; height: auto; }
.lite-payment-header__bar { display: flex; justify-content: center; align-items: center; gap: var(--space-xs); margin: 0; padding: var(--space-xs) var(--space-m); background: var(--color-success-soft); color: var(--color-success-strong); font-weight: 500; text-align: center; }
.lite-payment-header__bar svg { flex: none; }
.thp { max-width: 760px; margin: 0 auto; padding: var(--space-xl); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface); }
.thp__header, .thp__confirmation, .thp__summary, .thp__next, .thp__actions { margin-bottom: var(--space-l); }
.thp__title { margin-bottom: var(--space-s); }
.thp__status, .thp__next p { color: var(--color-text-soft); }
.thp__confirmation { padding: var(--space-m); border-radius: var(--radius-sm); background: var(--color-soft); }
.thp__confirmation p { margin: 0; }
.thp__summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-m); }
.thp__summary-item { padding: var(--space-m); border-radius: var(--radius-sm); background: var(--color-soft); }
.thp__summary dt { margin-bottom: var(--space-xs); color: var(--color-text-soft); }
.thp__summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.thp__actions { display: flex; flex-wrap: wrap; gap: var(--space-s); }
.thp__actions .button--ghost { border: 1px solid var(--color-deep); background: var(--color-surface); color: var(--color-deep); }
.thp__contact ul { margin: var(--space-s) 0 0; padding-left: var(--space-l); }
.thp__contact a { color: var(--color-deep); }
@media (max-width: 700px) {
    .wizyta-container { grid-template-columns: 1fr; }
    .lite-main { overflow-x: auto; }
    .lite-main .shop_table th, .lite-main .shop_table td { padding: var(--space-xs); }
    .thp { padding: var(--space-m); }
    .thp__summary { grid-template-columns: 1fr; }
}

/* Skórka WS Form w kolorach marki. Wtyczka wstrzykuje własną skórkę (inline, po tym pliku),
   więc każda reguła ma prefiks body.receptomaty-lite .wsf-form i wygrywa specyficznością.
   Kalendarz xdsoft zostaje przy skórce wtyczki (używa !important). */
body.receptomaty-lite .wsf-form {
    --wsf-brand: var(--color-accent);
    --wsf-focus-ring: color-mix(in srgb, var(--wsf-brand) 18%, transparent);
    --wsf-brand-strong: var(--color-accent-strong, var(--color-deep));
    --wsf-brand-soft: var(--color-accent-soft, var(--color-soft));
    --wsf-border: var(--color-field-border);
    --wsf-on-brand: var(--color-on-deep);
    --wsf-danger: var(--color-danger-strong);
    --wsf-success: var(--color-positive, var(--color-success));
    color: var(--color-ink);
    font-family: inherit;
}
body.receptomaty-lite .wsf-form .wsf-label, body.receptomaty-lite .wsf-form .wsf-help,
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field + label.wsf-label,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field + label.wsf-label { color: var(--color-ink); }
body.receptomaty-lite .wsf-form a:not(.wsf-button) { color: var(--wsf-brand); text-decoration: underline; }
body.receptomaty-lite .wsf-form a:not(.wsf-button):hover { color: var(--wsf-brand-strong); }

/* Pola */
body.receptomaty-lite .wsf-form input.wsf-field:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file]),
body.receptomaty-lite .wsf-form input[type=file].wsf-field,
body.receptomaty-lite .wsf-form select.wsf-field,
body.receptomaty-lite .wsf-form textarea.wsf-field,
body.receptomaty-lite .wsf-form select.wsf-field ~ .select2-container .select2-selection--single,
body.receptomaty-lite .wsf-form select.wsf-field ~ .select2-container .select2-selection--multiple,
body.receptomaty-lite .wsf-form .wsf-input-group-prepend, body.receptomaty-lite .wsf-form .wsf-input-group-append {
    border-color: var(--wsf-border); background-color: var(--color-surface); color: var(--color-ink);
}
body.receptomaty-lite .wsf-form .wsf-input-group-prepend, body.receptomaty-lite .wsf-form .wsf-input-group-append { background-color: var(--color-soft); }
body.receptomaty-lite .wsf-form .wsf-field::placeholder { color: var(--color-muted); }
body.receptomaty-lite .wsf-form input.wsf-field:not([type=checkbox], [type=radio]):focus,
body.receptomaty-lite .wsf-form select.wsf-field:focus, body.receptomaty-lite .wsf-form textarea.wsf-field:focus,
body.receptomaty-lite .wsf-form select.wsf-field ~ .select2-container--focus .select2-selection--single,
body.receptomaty-lite .wsf-form select.wsf-field ~ .select2-container--focus .select2-selection--multiple {
    border-color: var(--wsf-brand); box-shadow: 0 0 0 3px var(--wsf-focus-ring); outline: 0;
}
body.receptomaty-lite .wsf-form .wsf-field:disabled { background-color: var(--color-soft); color: var(--color-muted); -webkit-text-fill-color: var(--color-muted); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field:disabled + label.wsf-label,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field:disabled + label.wsf-label,
body.receptomaty-lite .wsf-form ul.wsf-group-tabs > li > a.wsf-tab-disabled { color: var(--color-muted); }
body.receptomaty-lite .wsf-form [data-wsf-tooltip]:after { background-color: var(--color-deep); color: var(--color-on-deep); }
body.receptomaty-lite .wsf-form [data-wsf-tooltip]:before { border-top-color: var(--color-deep); }
body.receptomaty-lite .wsf-form .wsf-label-position-inside input.wsf-field + label,
body.receptomaty-lite .wsf-form .wsf-label-position-inside select.wsf-field + label,
body.receptomaty-lite .wsf-form .wsf-label-position-inside textarea.wsf-field + label { background-color: var(--color-surface); }

/* Zaznaczenia: checkbox, radio, przełącznik, przyciski wyboru, obrazy */
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field + label.wsf-label:before,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field + label.wsf-label:before { border-color: var(--wsf-border); background-color: var(--color-surface); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field:checked + label.wsf-label:before,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field:checked + label.wsf-label:before { border-color: var(--wsf-brand); background-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field:focus + label.wsf-label:before,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field:focus + label.wsf-label:before { border-color: var(--wsf-brand); box-shadow: 0 0 0 3px var(--wsf-focus-ring); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-switch + label.wsf-label:after,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-switch + label.wsf-label:after { background-color: var(--wsf-border); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-switch:checked + label.wsf-label:after,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-switch:checked + label.wsf-label:after { background-color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-button + label.wsf-label,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-button + label.wsf-label { border-color: var(--wsf-border); background-color: var(--color-surface); color: var(--color-ink); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-button:checked + label.wsf-label,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-button:checked + label.wsf-label { border-color: var(--wsf-brand); background-color: var(--wsf-brand); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-image + label.wsf-label > img,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-image + label.wsf-label > img { border-color: var(--wsf-border); background-color: var(--color-surface); }
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-image:checked + label.wsf-label > img,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-image:checked + label.wsf-label > img,
body.receptomaty-lite .wsf-form input[type=checkbox].wsf-field.wsf-color:checked + label.wsf-label > span,
body.receptomaty-lite .wsf-form input[type=radio].wsf-field.wsf-color:checked + label.wsf-label > span { border-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form input[type=range].wsf-field { --wsf-color-lower-track: var(--wsf-brand); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form input[type=range].wsf-field::-webkit-slider-thumb { background-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form input[type=range].wsf-field::-moz-range-thumb { background-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-select2-dropdown .select2-results .select2-results__option--highlighted[aria-selected] { background-color: var(--color-accent); color: var(--color-on-deep); }

/* Błędy i komunikaty */
body.receptomaty-lite .wsf-form .wsf-invalid-feedback { color: var(--wsf-danger); }
body.receptomaty-lite .wsf-form .wsf-validated .wsf-field:invalid,
body.receptomaty-lite .wsf-form.wsf-validated .wsf-field:invalid,
body.receptomaty-lite .wsf-form.wsf-validated input[type=checkbox].wsf-field:invalid + label.wsf-label:before,
body.receptomaty-lite .wsf-form.wsf-validated input[type=radio].wsf-field:invalid + label.wsf-label:before,
body.receptomaty-lite .wsf-form.wsf-validated select.wsf-field:invalid ~ .select2-container .select2-selection--single { border-color: var(--color-danger); }
body.receptomaty-lite .wsf-form .wsf-alert { border-color: var(--color-line); background-color: var(--color-soft); color: var(--color-ink); }
body.receptomaty-lite .wsf-form .wsf-alert.wsf-alert-danger { border-color: var(--color-danger); background-color: var(--color-danger-soft); color: var(--wsf-danger); }
body.receptomaty-lite .wsf-form .wsf-alert.wsf-alert-success { border-color: var(--wsf-success); background-color: var(--color-success-soft); color: var(--color-success-strong); }
body.receptomaty-lite .wsf-form .wsf-alert.wsf-alert-information { border-color: var(--wsf-brand); background-color: var(--wsf-brand-soft); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form .wsf-alert a { color: inherit; }
body.receptomaty-lite .wsf-form .wsf-text-primary { color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form .wsf-text-danger { color: var(--wsf-danger); }
body.receptomaty-lite .wsf-form .wsf-text-success { color: var(--wsf-success); }

/* Postęp i kroki */
body.receptomaty-lite .wsf-form progress.wsf-progress[value] { background-color: var(--wsf-brand-soft); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form progress.wsf-progress[value]::-webkit-progress-bar { background-color: var(--wsf-brand-soft); }
body.receptomaty-lite .wsf-form progress.wsf-progress[value]::-webkit-progress-value { background-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form progress.wsf-progress[value]::-moz-progress-bar { background-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs { border-color: var(--color-line); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs > li > a { color: var(--color-ink); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs > li.wsf-tab-active > a { border-color: var(--color-line); background-color: var(--color-surface); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li > a:before { border-color: var(--wsf-brand); background-color: var(--wsf-brand); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li.wsf-tab-active > a:before { border-color: var(--wsf-brand); background-color: var(--color-surface); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li > a:not(.wsf-tab-disabled):focus:before { border-color: var(--wsf-brand-strong); box-shadow: 0 0 0 3px var(--wsf-focus-ring); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li > a:after { background-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li.wsf-tab-active ~ li > a:before { border-color: var(--wsf-border); background-color: var(--color-surface); color: var(--color-ink); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li.wsf-tab-active ~ li > a:after { background-color: var(--color-line); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps > li > a.wsf-tab-disabled:before { border-color: var(--color-line); color: var(--color-muted); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps.wsf-steps-success > li > a:before { border-color: var(--wsf-success); background-color: var(--wsf-success); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps.wsf-steps-success > li > a:after { background-color: var(--wsf-success); }
body.receptomaty-lite .wsf-form ul.wsf-group-tabs.wsf-steps.wsf-steps-success > li.wsf-tab-active > a:before { background-color: var(--color-surface); color: var(--wsf-success); }

/* Przyciski: główny, drugorzędny, odwrócony */
body.receptomaty-lite .wsf-form button.wsf-button { border-color: var(--wsf-border); background-color: var(--color-surface); color: var(--color-ink); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-primary { border-color: var(--wsf-brand); background-color: var(--wsf-brand); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-primary:hover,
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-primary:focus,
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-primary:active { border-color: var(--wsf-brand-strong); background-color: var(--wsf-brand-strong); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-secondary { border-color: var(--wsf-brand-soft); background-color: var(--wsf-brand-soft); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-secondary:hover,
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-secondary:focus { border-color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-inverted,
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-inverted.wsf-button-primary { border-color: var(--wsf-brand); background-color: var(--color-surface); color: var(--wsf-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-inverted:hover,
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-inverted:focus,
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-inverted.wsf-button-primary:focus { background-color: var(--wsf-brand); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-information { border-color: var(--wsf-brand-strong); background-color: var(--wsf-brand-strong); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-danger { border-color: var(--wsf-danger); background-color: var(--wsf-danger); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form button.wsf-button.wsf-button-success { border-color: var(--wsf-success); background-color: var(--wsf-success); color: var(--wsf-on-brand); }
body.receptomaty-lite .wsf-form button.wsf-button:focus-visible { outline: 3px solid var(--wsf-brand); outline-offset: 2px; }
body.receptomaty-lite .wsf-form button.wsf-button:disabled { opacity: .6; }

/* Jeden styl pól (input, select, textarea, wybory-przyciski): token --color-field-border.
   Prefiks .lite-main przebija regułę selectów z CSS wtyczki (.form--light ... .wsf-field-wrapper select). */
body.receptomaty-lite .lite-main .wsf-form :is(input.wsf-field:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file]), input[type=file].wsf-field, select.wsf-field, textarea.wsf-field) {
    border: 1px solid var(--color-field-border); border-radius: var(--radius-field); transition: border-color .15s ease, box-shadow .15s ease;
}
body.receptomaty-lite .lite-main .wsf-form :is(input[type=checkbox], input[type=radio]).wsf-field.wsf-button + label.wsf-label { border-color: var(--color-field-border); border-radius: var(--radius-field); }
body.receptomaty-lite .lite-main .wsf-form :is(input.wsf-field:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file]), input[type=file].wsf-field, select.wsf-field, textarea.wsf-field):hover,
body.receptomaty-lite .lite-main .wsf-form :is(input[type=checkbox], input[type=radio]).wsf-field:not(:checked):hover + label.wsf-label,
body.receptomaty-lite .lite-main .wsf-form :is(input[type=checkbox], input[type=radio]).wsf-field:not(:checked) + label.wsf-label:hover:before { border-color: var(--color-field-border-hover); }
body.receptomaty-lite .lite-main .wsf-form :is(input.wsf-field:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file]), input[type=file].wsf-field, select.wsf-field, textarea.wsf-field):focus,
body.receptomaty-lite .lite-main .wsf-form :is(input[type=checkbox], input[type=radio]).wsf-field.wsf-button:focus + label.wsf-label {
    border-color: var(--wsf-brand); box-shadow: 0 0 0 3px var(--wsf-focus-ring); outline: 0;
}
body.receptomaty-lite .lite-main .wsf-form :is(input[type=checkbox], input[type=radio]).wsf-field.wsf-button:checked + label.wsf-label { border-color: var(--wsf-brand); }
body.receptomaty-lite .lite-main .wsf-form.wsf-validated :is(input, select, textarea).wsf-field:invalid,
body.receptomaty-lite .lite-main .wsf-form .wsf-validated :is(input, select, textarea).wsf-field:invalid { border-color: var(--color-danger); }

/* Komunikat DSP o większej liczbie opakowań: łagodne wysunięcie zamiast nagłego pojawienia się. */
body.receptomaty-lite .dsp-packaging-upsell-info { overflow: hidden; animation: rm-wysuniecie-upsell .5s ease-in-out backwards; }
@keyframes rm-wysuniecie-upsell {
    from { opacity: 0; max-height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; transform: translateY(-6px); }
    to { opacity: 1; max-height: 9rem; transform: none; }
}
@media (prefers-reduced-motion: reduce) { body.receptomaty-lite .dsp-packaging-upsell-info { animation: none; } }
