/* === Podstawowe Style === */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}
.form-wrapper {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}
.form-header {
    background-color: #4a69bd;
    color: white;
    padding: 25px 30px;
    text-align: center;
}
.form-header h1 { margin: 0 0 5px 0; font-size: 24px; }
.form-header p { margin: 0; opacity: 0.9; }
form { padding: 30px; }
fieldset { border: none; padding: 0; margin: 0 0 30px 0; }
fieldset legend { font-size: 20px; font-weight: 600; color: #4a69bd; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #f0f2f5; width: 100%; }

/* === Pola Formularza === */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 15px; }
.form-group label { margin-bottom: 8px; font-weight: 500; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="tel"], .form-group input[type="date"], .form-group input[type="time"], .form-group textarea {
    padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #4a69bd; box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.2); }
.form-group small { margin-top: 5px; color: #777; font-size: 12px; }

/* === Karty Usług === */
.service-card { border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 15px; transition: box-shadow 0.2s; position: relative; }
.service-checkbox { display: none; }
.service-label { display: flex; padding: 15px; cursor: pointer; align-items: center; }
.service-image { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; margin-right: 15px; }
.service-info { flex-grow: 1; }
.service-name { margin: 0 0 5px 0; }
.service-desc { margin: 0; font-size: 14px; color: #666; }
.service-price { font-weight: 600; color: #333; margin-top: 8px; display: inline-block; }
.service-checkbox:checked + .service-label { background-color: #f0f5ff; }
.service-card.selected { border-color: #4a69bd; box-shadow: 0 0 10px rgba(74, 105, 189, 0.2); }

/* === Kontener na Atrybuty i Godzinę === */
.service-details-container { padding: 0 20px 20px 20px; border-top: 1px solid #e0e0e0; margin-top: 15px; }
.service-time-group { padding-top: 15px; }
.service-time-group label { font-weight: 600; }
.attribute-group { margin-top: 20px; }
.attribute-group h4 { margin: 0 0 10px 0; }
.option-item { display: flex; align-items: center; margin-bottom: 8px; }
.option-item label { margin-left: 10px; }
.option-price { margin-left: auto; color: #555; font-size: 14px; }
.option-image, .option-image-placeholder { width: 60px; height: 60px; object-fit: contain; border: 1px solid #eee; border-radius: 4px; margin-right: 10px; background-color: #f8f9fa; flex-shrink: 0; cursor: pointer; transition: transform 0.2s; }
.option-image:hover { transform: scale(1.1); }

/* === Podsumowanie === */
.summary-box { text-align: right; font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.total-price-value { color: #4a69bd; }
.submit-button { width: 100%; padding: 15px; font-size: 18px; font-weight: 600; background-color: #32cd32; color: white; border: none; border-radius: 6px; cursor: pointer; transition: background-color 0.2s; }
.submit-button:hover { background-color: #28a428; }

/* === STYLE DLA PODGLĄDU ZDJĘCIA (LIGHTBOX) === */
.lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); z-index: 2000; display: flex; justify-content: center; align-items: center; padding: 30px; }
.lightbox-content { max-width: 90%; max-height: 90%; object-fit: contain; border: 4px solid white; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: 20px; right: 30px; font-size: 40px; color: white; cursor: pointer; line-height: 1; transition: opacity 0.2s; }
.lightbox-close:hover { opacity: 0.7; }

/* Responsywność */
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
}

.inline-inputs {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}
.service-quantity-group, .service-time-group {
    padding-top: 15px;
}
.service-quantity-group label, .service-time-group label {
    font-weight: 600;
}
.service-quantity-group input, .service-time-group input {
    max-width: 120px;
}
.option-item input[type="number"] {
    width: 60px !important;
    padding: 8px !important;
    font-size: 14px !important;
    margin-left: 10px;
}

/* === STYLE DLA KOMUNIKATÓW O BŁĘDACH === */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* ==========================================================================
   PŁYWAJĄCY PASEK PODSUMOWANIA
   ========================================================================== */

/* 1. Sprawiamy, że pole z podsumowaniem jest "przyklejone" do dołu ekranu */
.summary-fieldset {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    
    /* Style wizualne, aby wyglądało jak pasek */
    background-color: #ffffff;
    margin: 0;
    padding: 15px 30px;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
    z-index: 100;

    /* Ułożenie elementów wewnątrz paska */
    display: flex;
    justify-content: center; /* POPRAWKA: Zmiana z 'flex-end' na 'center' */
    align-items: center;
    gap: 20px;
}

/* 2. Usuwamy zbędne elementy z podsumowania (legenda) */
.summary-fieldset legend {
    display: none;
}
.summary-box {
    margin-bottom: 0; /* Usuwamy stary margines */
}

/* 3. Zmieniamy rozmiar przycisku na pasku */
.submit-button {
    width: auto; /* Szerokość dopasowana do treści */
    padding: 12px 30px;
}

/* 4. NAJWAŻNIEJSZE: Dodajemy pustą przestrzeń na dole formularza, 
   aby ostatnia usługa nie była zasłaniana przez nasz pływający pasek. */
#order-form {
    padding-bottom: 120px; /* Wysokość paska + margines */
}

/* === STYLE DLA OKNA PODSUMOWANIA (MODAL) === */
.summary-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.summary-modal-content {
    background-color: #fff;
    padding: 20px 30px 30px 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.summary-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.summary-modal-header h3 {
    margin: 0;
    font-size: 22px;
}
.summary-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
    margin-top: 20px;
}
.summary-modal-footer .btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}
.summary-modal-footer .submit-button {
    width: auto;
    padding: 12px 25px;
    font-size: 16px;
}

/* Stylizacja listy w podsumowaniu */
.summary-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #f0f2f5;
}
.summary-item:last-child {
    border-bottom: none;
}
.summary-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
}
.summary-item-details {
    flex-grow: 1;
}
.summary-item-details h4 {
    margin: 0 0 8px 0;
}
.summary-item-attributes {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 14px;
    color: #555;
}
.summary-item-attributes li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}
.summary-item-attributes img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 8px;
}
.summary-final-price {
    text-align: right;
    font-size: 24px;
    font-weight: bold;
    margin-top: 20px;
}

.form-logo {
    max-width: 250px;
    margin-bottom: 20px;
}

/* NOWA SEKCJA: Style dla warstwy ładowania */
.loading-overlay {
    display: none; /* Domyślnie ukryta */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    text-align: center;
}
.loading-content p {
    margin-top: 20px;
    font-size: 1.1em;
}
.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--accent-gold, #c5a47e);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.service-card.disabled, .option-item.disabled { opacity: 0.6; pointer-events: none; background-color: #f8f9fa; }
.service-card.disabled-static { opacity: 0.6; background-color: #f8f9fa; }
.availability-status { font-weight: bold; color: #dc3545; margin-left: 10px; font-size: 0.9em; }
.btn-ask-availability { display: inline-block; margin-top: 10px; padding: 8px 15px; background-color: #6c757d; color: #fff; text-decoration: none; border-radius: 4px; font-size: 0.9em; }
.btn-ask-availability:hover { background-color: #5a6268; }