/* -----------------------------------------
   WRAPPER
------------------------------------------ */
.ordering-wrapper {
    background: linear-gradient(180deg, #eef6ff 0%, #ffffff 100%);
    padding: 60px 20px;
}

/* -----------------------------------------
   HEADER
------------------------------------------ */
.ordering-header {
    max-width: 1050px;
    margin: 0 auto 40px;
}

.ordering-header h2 {
    font-size: 2.6rem;
    color: #1a478b;
    font-weight: 800;
}

.ordering-header p {
    margin-top: 8px;
    color: #555;
    font-size: 1.1rem;
}

/* -----------------------------------------
   LAYOUT
------------------------------------------ */
.ordering-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
}

@media (max-width: 900px) {
    .ordering-container {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   LISTA PRODUKTÓW — jedna kolumna
------------------------------------------ */
.ordering-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* -----------------------------------------
   KARTA PRODUKTU — nowy design
------------------------------------------ */
.ordering-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: 0.25s ease;
}

.ordering-card:hover {
    transform: translateY(-4px);
}

.ordering-card img {
    width: 100%;
    height: 260px;
    object-fit: contain;
}

/* BODY */
.ordering-card-body {
    padding: 22px;
}

.ordering-card-body h3 {
    font-size: 1.25rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-bottom: 16px;
}

/* FOOTER */
.ordering-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ordering-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a478b;
}

/* -----------------------------------------
   QTY
------------------------------------------ */
.ordering-qty {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #eef3fc;
    padding: 6px 10px;
    border-radius: 50px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #d5e2fb;
    color: #1a478b;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.qty-btn:hover {
    background: #c2d3f8;
}

.qty-value {
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* -----------------------------------------
   PODSUMOWANIE (prawa kolumna)
------------------------------------------ */
.ordering-summary {
    background: #ffffff;
    padding: 24px;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 130px;
    height: fit-content;
}

@media (max-width: 900px) {
    .ordering-summary {
        position: static;
    }
}

.ordering-summary h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1a478b;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.summary-row:last-child {
    border-bottom: none;
}

.ordering-summary-total {
    margin-top: 20px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a478b;
}

/* -----------------------------------------
   BUTTONY (krok 1 i krok 2)
------------------------------------------ */
.ordering-summary-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ordering-summary-btn {
    display: block;
    margin-top: 24px;
    padding: 15px;
    border-radius: 14px;
    font-weight: 700;
    text-align: center;
    font-size: 1.05rem;
    transition: 0.2s ease;
    border: none;
    cursor: pointer;
}

#step-next,
#step-submit {
    background: linear-gradient(135deg, #1a478b 0%, #3d7cff 100%);
    color: #fff;
}

/* POWRÓT */
.ordering-btn-secondary,
#step-back {
    background: #f1f4fb;
    color: #1a478b;
    border: 1px solid #d4ddf0;
}

#step2-buttons {
    display: none;
    flex-direction: row;
    gap: 12px;
}

#step2-buttons .ordering-summary-btn {
    flex: 1;
}

/* -----------------------------------------
   STICKY CTA MOBILE
------------------------------------------ */
.ordering-sticky-btn {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
    z-index: 5000;
}

@media (max-width: 992px) {
    .ordering-sticky-btn {
        display: block;
    }

    #step-next,
    #step2-buttons {
        display: none !important;
    }

    #sticky-step2 {
        display: flex;
        gap: 12px;
    }

    #sticky-next,
    #sticky-step2 button {
        width: 100%;
        padding: 15px;
        border-radius: 14px;
        font-weight: 700;
        font-size: 1.05rem;
        border: none;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    }
}

#sticky-next,
#sticky-step2 button {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    box-shadow: none;
}

#sticky-next,
#sticky-submit {
    background: linear-gradient(135deg, #1a478b 0%, #3d7cff 100%);
    color: #fff;
}

#sticky-back {
    background: #f1f4fb;
    color: #1a478b;
    border: 1px solid #d4ddf0;
}

/* -----------------------------------------
   FORMULARZ — KROK 2
------------------------------------------ */
.ordering-form-step {
    background: #fff;
    padding: 24px;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.ordering-form-step h3 {
    margin-bottom: 18px;
    color: #1a478b;
    font-size: 1.4rem;
    font-weight: 800;
}

.ordering-form-group {
    display: flex;
    flex-direction: column;
}

.ordering-form-group label {
    font-weight: 600;
    margin-bottom: 6px;
}

.ordering-form-group input:not([type="checkbox"]) {
    padding: 12px;
    border: 1px solid #cdd6e5;
    border-radius: 10px;
    font-size: 1rem;
}

.ordering-form-group .error-msg,
.ordering-form-group-checkbox .error-msg {
    display: block;
    height: 18px;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #d33;
    visibility: hidden;
    line-height: 18px;
}

.ordering-form-group .error-msg.active,
.ordering-form-group-checkbox .error-msg.active {
    visibility: visible;
}

input.error {
    border-color: #ff5f5f !important;
    background: #ffecec !important;
}

/* -----------------------------------------
   CHECKBOXY – FINALNA WERSJA
------------------------------------------ */

.ordering-form-group-checkbox {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 10px 0 18px;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
}

.styled-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #1a478b;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: 0.2s ease;
}

.styled-checkbox:hover {
    border-color: #2c5ec4;
}

.styled-checkbox:checked {
    background: #1a478b;
    border-color: #1a478b;
}

.styled-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-line label {
    cursor: pointer;
    font-size: 14px;
    color: #555;
    line-height: 1.45;
}

.checkbox-line a {
    color: #1a478b;
    text-decoration: underline;
}

.checkbox-line a:hover {
    color: #2c5ec4;
}

.ordering-form-group-checkbox .error-msg {
    margin-top: 2px;
    height: 16px;
    line-height: 16px;
}

/* polityka – ciaśniej */
.privacy-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 6px 0;
}

.privacy-line .styled-checkbox.checkbox-error {
    border-color: #ff5f5f !important;
    background: #ffecec !important;
}

/* -----------------------------------------
   MIASTO
------------------------------------------ */
#city-wrapper .city-flex {
    display: flex;
    gap: 12px;
}

#city-wrapper select,
#city-wrapper input {
    flex: 1;
    padding: 12px;
    border: 1px solid #cdd6e5;
    border-radius: 10px;
    font-size: 1rem;
}

#order-city-other {
    display: none;
}

@media (max-width: 600px) {
    #city-wrapper .city-flex {
        flex-direction: column;
    }
}

.hp-field {
    display: none !important;
    visibility: hidden !important;
}

.ordering-error-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 99999;
    background: #ffe8e8;
    color: #b84040;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid #f3c2c2;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    padding: 12px 20px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.ordering-error-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------
   NAPRAWA: VAT jako ROW, Polityka jako COLUMN
------------------------------------------ */

/* Domyślnie — VAT i inne checkboxy w jednej linii */
.ordering-form-group-checkbox {
    flex-direction: row;
    gap: 10px;
    margin: 10px 0 18px;
}

.privacy-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 10px 0 18px;
    gap: 0;
}
.privacy-wrapper .privacy-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 6px 0 0 0;
}
.privacy-wrapper .error-msg {
    margin-top: 2px;
    height: 16px;
    line-height: 16px;
}

button.loading {
    position: relative;
    color: transparent !important; /* ukryj tekst */
}

button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}