:root {
    --bg-color: #fffaf0;
    --primary-orange: #ff7a00;
    --dark-brown: #4a2c2a;
    --accent-brown: #a1887f;
    --white: #ffffff;
    --btn-color: #ff7a00;
    --error-red: #e53935;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--dark-brown);
    padding: 20px;
    display: flex;
    justify-content: center;
}

.page {
    width: 100%;
    max-width: 900px;
}

.container {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--primary-orange);
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-orange);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.company-info {
    text-align: right;
    font-size: 0.85em;
}

section {
    margin-bottom: 25px;
}

h2 {
    font-size: 1.2em;
    border-left: 4px solid var(--primary-orange);
    padding-left: 10px;
    margin-bottom: 15px;
}

h2 small {
    font-size: 0.8em;
    color: var(--accent-brown);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #fff3e0;
    padding: 10px;
    text-align: left;
    font-size: 0.85em;
    border-bottom: 1px solid #ffe0b2;
}

td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.product-link {
    color: var(--dark-brown);
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}

.product-link:hover {
    color: var(--primary-orange);
}

input, textarea, select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--accent-brown);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95em;
}

input[readonly] {
    background: #fffdf8;
}

.t-cena {
    text-align: left;
    padding-left: 6px;
}

.t-ilosc {
    text-align: right;
}

.t-wartosc {
    border: none;
    background: none;
    font-weight: bold;
    text-align: right;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.paczkomat-box {
    margin-top: 10px;
}

.total-box {
    background: #ffe0b2;
    padding: 20px;
    border-radius: 10px;
    text-align: right;
    font-size: 1.1em;
    margin-top: 15px;
}

.buttons {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    font-weight: bold;
}

.btn-send {
    background: var(--btn-color);
    color: #ffffff;
}

.btn-send:hover {
    background: #e56d00;
}

.btn-secondary {
    background: var(--dark-brown);
    color: #ffffff;
}

.btn-secondary:hover {
    background: #3a1f18;
}

.about-section {
    margin-top: 40px;
    background: #fff3e0;
    border-radius: 10px;
    border: 1px solid #ffe0b2;
    padding: 20px;
    font-size: 0.95em;
}

.about-text p {
    margin-bottom: 10px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--white);
    padding: 25px;
    border-radius: 15px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    border: 3px solid var(--primary-orange);

    /* najważniejsze — przewijanie */
    max-height: 90vh;
    overflow-y: auto;
}

.modal-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-images img {
    max-width: 100%;
    border-radius: 10px;
}

.btn-close {
    margin-top: 10px;
    background: var(--dark-brown);
    color: #ffffff;
}

/* Walidacja */
.error {
    border: 2px solid var(--error-red) !important;
    background-color: #fff8f8;
}

.error-msg {
    color: var(--error-red);
    font-size: 0.8em;
    margin-top: 3px;
    min-height: 1em;
}

/* Druk / PDF */
@media print {

    /* ukrywanie przycisków */
    .buttons,
    button {
        display: none !important;
    }

    /* ukrywanie pustych pozycji */
    .ukryj-w-pdf {
        display: none !important;
    }

    .modal {
        display: none !important;
    }

    body {
        background: #ffffff;
        padding: 0;
    }

    .page {
        max-width: 100%;
    }

    .container {
        border: none;
        border-radius: 0;
        padding: 10mm;
    }
}

/* RWD */
@media (max-width: 700px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .company-info {
        text-align: left;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}
