/*
 * Envio24 Order Form - BASE (Core UI Components)
 *
 * @version 3.2.5
 * @package envio24-core/assets/css/order-form/
 *
 * ZMIANY 3.2.5 (PL):
 * - Poprawka 1.1 (Base-Box): dodano dodatkowy padding-top dla .e24-order-form-container,
 *   aby górny pasek postępu nie był „na styk” z ramką kontenera.
 * - Poprawka 1.2 (Stage 1 Footer): usunięto separator (border-top) nad przyciskami w E1
 *   oraz ustawiono padding góra/dół na 20px dla spójności z E2/E3.
 *
 * ZMIANY 3.2.4 (PL):
 * - FIX RWD (Mobile): Usunięto padding z kontenera głównego (.e24-order-form-container),
 *   aby paski postępu i nagłówki sekcji mogły zająć 100% szerokości.
 *   Paddingi przeniesiono do wnętrza sekcji (.e24-section).
 * - Ujednolicono szerokość nagłówków sekcji na mobile (brak marginesów).
 */

/* ========================================
 * 1. TOKENY KOLORYSTYCZNE
 * ===================================== */
/* (Przeniesione do theme-tokens.css) */

/* ========================================
 * 2. TOKENY RESPONSYWNE
 * ===================================== */
#e24-order-form{
    --e24-container-pad-y: 32px;
    --e24-container-pad-x: 40px;

    --e24-fs-title: 20px;
    --e24-fs-subtitle: 14px;
    --e24-fs-label: 13px;
    --e24-fs-input: 18px;
    --e24-fs-placeholder: 16px;
    --e24-fs-unit: 17px;

    --e24-sec-pad-y: 20px;
    --e24-sec-pad-x: 8px;
    --e24-sec-pad-bottom: 26px;

    --e24-gap-1: 10px;
    --e24-gap-2: 16px;
    --e24-gap-3: 44px;

    --e24-input-min-height: 42px;
    --e24-input-pad-y: 5px;
    --e24-input-pad-x: 14px;

    --e24-unit-min-width: 60px;
    --e24-unit-pad-x: 10px;

    --e24-section-body-max-width: calc(100% - 200px);

    --e24-sec1-grid-gap: 54px;
    --e24-sec1-grid-cols: 4;
    --e24-sec1-grid-col-min: 0px;

    --e24-sec1-dims-gap: 22px;

    --e24-sec1-documento-width-factor: 0.695;

    --e24-sec1-palete-gap: 34px;
    --e24-sec1-palete-col-1: 0.78fr;
    --e24-sec1-palete-col-2: 1.85fr;
    --e24-sec1-palete-type-shift: 20px;
    --e24-sec1-palete-type-width: 96%;

    --e24-msg-gap-top: 4px;
    --e24-msg-gap-after: 0px;
    --e24-msg-min-height: 24px;
}

/* ========================================
 * 3. PODSTAWOWY KONTENER + AKORDEON
 * ===================================== */

.e24-order-form-container {
    max-width: 1180px;
    margin: 0 auto;
    color: var(--e24-text-main);
    font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Poprawka 1.1 (PL): dodatkowy oddech na górze Base-Box */
    padding-top: calc(var(--e24-container-pad-y) + 16px);
    padding-right: var(--e24-container-pad-x);
    padding-bottom: var(--e24-container-pad-y);
    padding-left: var(--e24-container-pad-x);

    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.e24-section {
    padding: var(--e24-sec-pad-y) var(--e24-sec-pad-x) var(--e24-sec-pad-bottom) var(--e24-sec-pad-x);
}

.e24-section + .e24-section {
    border-top: 1px solid #E9E9E9;
}

.e24-section__header {
    display: flex;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0;
    padding-left: 4px;
    cursor: pointer;
    transition: margin-bottom 0.2s ease-out;
}

.e24-section__header:hover .e24-section__title {
    border-bottom-color: var(--e24-orange);
}

.e24-section__header:hover .e24-section-toggle__circle {
    transform: scale(1.1);
}

.e24-section--open .e24-section__header {
    margin-bottom: 18px;
}

.e24-section__header::after {
    display: none;
}

.e24-section-toggle {
    position: relative;
    z-index: 2;
    border: none !important;
    background: transparent !important;
    padding: 0;
    margin-right: 18px;
    margin-top: 5px;
    cursor: pointer;
    outline: none;
    box-shadow: none !important;
}

.e24-section-toggle__circle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out;
}

.e24-section-toggle__circle svg {
    width: 32px;
    height: 32px;
    display: block;
}

.e24-section-toggle__icon {
    display: none !important;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.e24-section-toggle[aria-expanded="false"] .e24-section-toggle__icon--plus {
    display: flex !important;
}

.e24-section-toggle[aria-expanded="true"] .e24-section-toggle__icon--minus {
    display: flex !important;
}

.e24-section__title-wrapper {
    flex: 1 1 auto;
    text-align: left;
    padding-right: 15px;
}

.e24-section__title {
    margin: 0 0 5px 0;
    font-family: "Rubik", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: var(--e24-fs-title);
    font-weight: 700;
    color: var(--e24-text-main);

    border-bottom: 2px solid #E0E0E0;
    padding-bottom: 5px;
    transition: border-color 0.12s ease-out;
    display: block;
}

.e24-section--open .e24-section__title {
    border-bottom-color: var(--e24-orange);
}

.e24-section__subtitle {
    margin: 0;
    font-size: var(--e24-fs-subtitle);
    color: var(--e24-text-muted);
}

.e24-section--collapsed .e24-section__subtitle {
    display: none;
}

.e24-section__help-link {
    color: var(--e24-orange) !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.12s;
    cursor: pointer;
}
.e24-section__help-link:hover {
    color: #BE4C00 !important;
    text-decoration: underline;
}

.e24-section__body {
    margin-top: 24px;
    max-width: var(--e24-section-body-max-width);
    margin-left: auto;
    margin-right: auto;
}

.e24-section--collapsed .e24-section__body{
    display: none;
}

/* ========================================
 * 4. SYSTEM INPUTÓW
 * ===================================== */

#e24-order-form .e24-input {
    margin-bottom: 12px;
}

#e24-order-form .e24-input__label {
    display: block;
    margin-bottom: 4px;
    font-size: var(--e24-fs-label);
    color: var(--e24-text-main);
    font-weight: 600;
}

#e24-order-form .e24-input__field {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--e24-input-border) !important;
    border-radius: 6px !important;
    background-color: #FFFFFF;
    overflow: hidden;
    transition: all 0.2s ease-out;
    box-shadow: none !important;
}

#e24-order-form .e24-input__unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--e24-input-pad-y) var(--e24-unit-pad-x) !important;
    min-width: var(--e24-unit-min-width) !important;
    background-color: var(--e24-input-unit-bg);
    color: var(--e24-text-unit) !important;
    font-size: var(--e24-fs-unit) !important;
    font-weight: 600 !important;
    border-right: 2px solid var(--e24-input-border) !important;
    transition: background-color 0.2s ease-out;
}

#e24-order-form .e24-input__value {
    flex: 1 1 auto;
    border: none !important;
    outline: none !important;
    padding: var(--e24-input-pad-y) var(--e24-input-pad-x) !important;
    font-size: var(--e24-fs-input) !important;
    color: var(--e24-text-input) !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: var(--e24-input-min-height);
}

#e24-order-form .e24-input__value::placeholder {
    font-size: var(--e24-fs-placeholder) !important;
    color: #B0B0B0 !important;
    opacity: 1;
}

#e24-order-form input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}
#e24-order-form input[type="number"]::-webkit-outer-spin-button,
#e24-order-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

#e24-order-form .e24-input__field:focus-within {
    border-color: var(--e24-input-focus-border) !important;
    background-color: var(--e24-input-focus-bg) !important;
    box-shadow: 0 0 0 2px rgba(211, 84, 0, 0.10) !important;
}
#e24-order-form .e24-input__field:focus-within .e24-input__unit {
    background-color: var(--e24-input-focus-bg) !important;
    border-right-color: var(--e24-input-focus-border) !important;
}

#e24-order-form .e24-input.is-filled .e24-input__field {
    border-color: var(--e24-input-focus-border) !important;
    background-color: var(--e24-input-filled-bg) !important;
}
#e24-order-form .e24-input.is-filled .e24-input__unit {
    background-color: var(--e24-input-filled-bg) !important;
    border-right-color: var(--e24-input-focus-border) !important;
}
#e24-order-form .e24-input.is-filled .e24-input__field:focus-within {
    background-color: var(--e24-input-focus-bg) !important;
}
#e24-order-form .e24-input.is-filled .e24-input__field:focus-within .e24-input__unit {
    background-color: var(--e24-input-focus-bg) !important;
}

#e24-order-form .e24-input.e24-input--disabled .e24-input__field,
#e24-order-form .e24-input__value:disabled {
    cursor: default;
    border-color: var(--e24-input-border) !important;
    background-color: var(--e24-input-unit-bg) !important;
    box-shadow: none !important;
}
#e24-order-form .e24-input.e24-input--disabled .e24-input__unit,
#e24-order-form .e24-input.e24-input--disabled.is-filled .e24-input__unit {
    color: var(--e24-text-disabled) !important;
    background-color: var(--e24-input-unit-bg) !important;
    border-right-color: var(--e24-input-border) !important;
}
#e24-order-form .e24-input.e24-input--disabled .e24-input__value {
    color: var(--e24-text-disabled) !important;
}

.e24-input--plain .e24-input__unit { display: none !important; }

#e24-order-form select.e24-input__value {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px !important;
    cursor: pointer;
}

/* ========================================
 * 5. PRZYCISKI AKCYJNE (WSPÓLNE)
 * ===================================== */
.e24-iconbtn {
    border: none;
    background: transparent !important;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.16) !important;
    transition: transform 0.12s, box-shadow 0.12s;
    border-radius: 8px;
}
.e24-iconbtn:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.18) !important;
    transform: translateY(-1px) scale(1.015);
}
.e24-iconbtn:active { transform: scale(1.00); }
.e24-iconbtn__svg {
    width: 64px;
    height: 64px;
    display: block;
}

/* ========================================
 * 6. KOMUNIKATY (WSPÓLNE)
 * ===================================== */
.e24-msg {
    display: inline-flex;
    align-items: center;
    margin-top: var(--e24-msg-gap-top);
    padding: 1px 8px;
    border-radius: 6px;
    border-width: 2px;
    border-style: solid;
    font-size: 12px;
}

#e24-order-form .e24-input__field + .e24-msg{
    min-height: var(--e24-msg-min-height);
    box-sizing: border-box;
}

#e24-order-form .e24-input__field + .e24-msg.e24-hidden{
    display: inline-flex !important;
    visibility: hidden !important;
    pointer-events: none;
}

.e24-msg--error {
    background-color: var(--e24-error-bg);
    border-color: var(--e24-error-border);
    color: var(--e24-error-text);
}
.e24-msg--warn {
    background-color: var(--e24-warn-bg);
    border-color: var(--e24-warn-border);
    color: var(--e24-warn-text);
}
.e24-msg__icon {
    font-weight: 700;
    margin-right: 4px;
}
.e24-hidden { display: none !important; }

/* ========================================
 * 7. RWD (GLOBALNE)
 * ===================================== */

@media (max-width: 1200px) {
    #e24-order-form{
        --e24-container-pad-x: 24px;
        --e24-container-pad-y: 24px;
        --e24-section-body-max-width: 100%;
        --e24-sec1-grid-gap: 36px;
        --e24-sec1-palete-gap: 20px;
    }
}

@media (max-width: 1024px) {
    #e24-order-form{
        --e24-container-pad-x: 20px;
        --e24-container-pad-y: 20px;
        --e24-fs-title: 19px;
        --e24-fs-input: 17px;
        --e24-fs-unit: 16px;
        --e24-section-body-max-width: 100%;
    }
}

@media (max-width: 768px) {
    #e24-order-form{
        --e24-container-pad-x: 16px;
        --e24-container-pad-y: 16px;
        --e24-fs-title: 18px;
        --e24-fs-input: 16px;
        --e24-fs-unit: 16px;
        --e24-fs-placeholder: 15px;
        --e24-input-min-height: 44px;
        --e24-section-body-max-width: 100%;
    }

    /* FIX 3.2.4: Reset kontenera głównego na mobile (full width) */
    .e24-order-form-container {
        padding: 0; /* Brak paddingu na kontenerze */
        box-shadow: none;
        background: transparent;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* FIX 3.2.4: Sekcje na pełną szerokość z wewnętrznym paddingiem */
    .e24-section {
        width: 100%;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-left: 16px; /* Wewnętrzny odstęp treści */
        padding-right: 16px;
        margin: 0;
    }

    .e24-section__header {
        width: 100%;
        max-width: 100% !important;
        margin: 0;
        padding-left: 0; /* Wyrównanie do krawędzi sekcji (padding jest w .e24-section) */
    }

    .e24-section__body {
        max-width: 100%;
        margin: 20px 0 0 0;
    }

    .e24-order-form-footer {
        flex-direction: column !important;
        align-items: center !important;
        padding-right: 0 !important;
        gap: 15px !important;
    }
    .e24-footer-msg {
        text-align: center;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }
    .e24-btn {
        width: 100%;
    }
}

/* ========================================
 * 8. DEBUG helper
 * ===================================== */
#e24-order-form .e24-form-debug .e24-hidden{
    display: block !important;
}

/* ========================================
 * 9. SYSTEM PRZYCISKÓW CTA
 * ===================================== */
.e24-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 25px;
    padding-right: 25px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border-style: solid;
    border-width: 2px;
    border-color: transparent;
    font-family: "Rubik", sans-serif;
    outline: none;
}

.e24-btn--primary {
    background-color: var(--e24-orange);
    color: #FFFFFF;
}

.e24-btn--primary:hover {
    background-color: #BE4C00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.20);
}

.e24-btn--secondary {
    background-color: transparent;
    border-color: var(--e24-orange);
    color: var(--e24-orange);
}

.e24-btn--secondary:hover {
    background-color: rgba(211, 84, 0, 0.05);
    transform: translateY(-1px);
    color: var(--e24-btn);
}

.e24-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

/* FIX 3.1.7: Hard-lock widoczności w stopce */
#e24-order-form .e24-order-form-footer .e24-btn{
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#e24-order-form .e24-order-form-footer .e24-btn.is-disabled{
    opacity: 0.5 !important;
    pointer-events: none !important;
    filter: grayscale(1) !important;
}

#e24-order-form .e24-order-form-footer{
    visibility: visible !important;
    opacity: 1 !important;
}

/* FIX 3.1.9: Hard-lock dla #e24-btn-save / #e24-btn-next */
#e24-order-form #e24-form-footer #e24-btn-save::before,
#e24-order-form #e24-form-footer #e24-btn-save::after,
#e24-order-form #e24-form-footer #e24-btn-next::before,
#e24-order-form #e24-form-footer #e24-btn-next::after{
    content: none !important;
    display: none !important;
}

#e24-order-form #e24-form-footer #e24-btn-save,
#e24-order-form #e24-form-footer #e24-btn-next{
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-image: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition-property: transform, box-shadow, background-color, border-color, color, filter !important;
    transition-duration: 0.18s !important;
    transition-timing-function: ease !important;
}

#e24-order-form #e24-form-footer #e24-btn-save{
    background-color: transparent !important;
    border-color: var(--e24-orange) !important;
    border-width: 2px !important;
    border-style: solid !important;
    color: var(--e24-orange) !important;
}

#e24-order-form #e24-form-footer #e24-btn-next{
    background-color: var(--e24-orange) !important;
    border-color: transparent !important;
    border-width: 2px !important;
    border-style: solid !important;
    color: #FFFFFF !important;
}

#e24-order-form #e24-form-footer #e24-btn-save:hover{
    background-color: rgba(211, 84, 0, 0.05) !important;
    color: var(--e24-btn) !important;
    transform: translateY(-1px) !important;
}

#e24-order-form #e24-form-footer #e24-btn-next:hover{
    background-color: #BE4C00 !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.20) !important;
}

#e24-order-form #e24-form-footer #e24-btn-save:active,
#e24-order-form #e24-form-footer #e24-btn-next:active{
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
    transform: translateY(0) scale(0.99) !important;
}

#e24-order-form #e24-form-footer #e24-btn-next:active{
    background-color: #BE4C00 !important;
    color: #FFFFFF !important;
}

#e24-order-form #e24-form-footer #e24-btn-save:active{
    background-color: rgba(211, 84, 0, 0.08) !important;
    color: var(--e24-btn) !important;
}

#e24-order-form #e24-form-footer #e24-btn-save:focus,
#e24-order-form #e24-form-footer #e24-btn-save:focus-visible,
#e24-order-form #e24-form-footer #e24-btn-next:focus,
#e24-order-form #e24-form-footer #e24-btn-next:focus-visible{
    outline: none !important;
    box-shadow: none !important;
}

#e24-order-form #e24-form-footer #e24-btn-save.is-disabled,
#e24-order-form #e24-form-footer #e24-btn-next.is-disabled{
    opacity: 0.5 !important;
    pointer-events: none !important;
    filter: grayscale(1) !important;
    transform: none !important;
    box-shadow: none !important;
}

#e24-order-form #e24-form-footer #e24-btn-save.is-disabled:active,
#e24-order-form #e24-form-footer #e24-btn-save.is-disabled:focus,
#e24-order-form #e24-form-footer #e24-btn-save.is-disabled:focus-visible,
#e24-order-form #e24-form-footer #e24-btn-next.is-disabled:active,
#e24-order-form #e24-form-footer #e24-btn-next.is-disabled:focus,
#e24-order-form #e24-form-footer #e24-btn-next.is-disabled:focus-visible{
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.e24-order-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 20px;

    /* Poprawka 1.2 (PL): usuwamy separator nad przyciskami w E1 */
    border-top: none;

    /* Poprawka 1.2 (PL): spójniejszy padding góra/dół */
    padding-top: 20px;
    padding-bottom: 20px;

    /* pozostałe bez zmian */
    padding-right: 40px;

    gap: 25px;
}

.e24-footer-msg {
    font-size: 16px;
    font-weight: 600;
    color: var(--e24-text-input);
    font-style: italic;
    margin-right: 10px;
}

/* FIX GLOBALNY: .e24-btn--secondary */
.e24-btn--secondary:active,
.e24-btn--secondary:focus,
.e24-btn--secondary:focus-visible {
    background-color: transparent !important;
    color: var(--e24-orange) !important;
    border-color: var(--e24-orange) !important;
    outline: none !important;
    box-shadow: none !important;
}