/* Bookings styles - минимальный набор для формы бронирования */

/* Общие стили для модалки и формы bookings.css*/
#booking-form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

#booking-form input[type="text"],
#booking-form input[type="tel"],
#booking-form input[type="email"],
#booking-form input[type="date"],
#booking-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

#booking-form button[type="submit"] {
    background: #28a745;
    color: white;
    padding: 14px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

#booking-form button[type="submit"]:hover {
    background: #218838;
}

/* Депозит и промокод */
#deposit-info {
    font-size: 0.95em;
}

/* Детали брони сверху */
#booking-details {
    line-height: 1.5;
}

/* Улучшенные стили для формы бронирования */

/* Поля дат с календарём */
.booking-date-wrapper {
    position: relative;
}

.booking-date-wrapper input[type="date"],
.booking-date-wrapper input[type="text"] {
    padding-right: 40px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

/* Счётчик ночей */
#nights-count {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 12px;
    background: #e7f3ff;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
}

/* Дополнительные поля (скрытые) */
.booking-extra-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.booking-extra-fields.expanded {
    max-height: 500px;
    margin-top: 15px;
}

/* Кнопка "Дополнительно" */
.toggle-extra-fields {
    display: inline-block;
    padding: 8px 15px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #0073aa;
    transition: all 0.2s;
}

.toggle-extra-fields:hover {
    background: #f5f5f5;
    border-color: #0073aa;
}

.toggle-extra-fields.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Промокод с подсказкой */
.promocode-wrapper {
    position: relative;
}

.promocode-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.promocode-hint::before {
    content: "💡 ";
}

/* Анимация появления формы */
#booking-form-container {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Улучшенный summary блок */
#booking-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

#booking-summary > div {
    padding: 8px;
    background: white;
    border-radius: 5px;
    border-left: 3px solid #28a745;
}

/* Flatpickr кастомизация */
.flatpickr-calendar {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #28a745 !important;
    border-color: #28a745 !important;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #218838 !important;
}

.flatpickr-day.inRange {
    background: #d4edda !important;
    border-color: #d4edda !important;
    box-shadow: -5px 0 0 #d4edda, 5px 0 0 #d4edda !important;
}

/* Двойной календарь — стили */
.bookings-range-calendar {
    box-shadow: 0 6px 30px rgba(0,0,0,0.2) !important;
    border-radius: 10px !important;
}

.bookings-range-calendar .flatpickr-months {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

/* Range input стили */
#daterange-calendar,
#booking-daterange {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px !important;
}

/* Адаптивность для двойного календаря */
@media (max-width: 580px) {
    .flatpickr-calendar.showTimeInput.hasTime .flatpickr-months,
    .flatpickr-calendar {
        width: auto !important;
    }
    .bookings-range-calendar .flatpickr-innerContainer {
        flex-direction: column;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    #booking-summary {
        grid-template-columns: 1fr;
    }
}

    .hotel-rooms-container { margin: 20px 0; font-family: Arial, sans-serif; }
    .table-responsive-wrapper { overflow-x: auto; margin-bottom: 20px; }
    .hotel-room-table, .calculator-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
    .hotel-room-table th, .hotel-room-table td, .calculator-table td { padding: 8px 12px; border: 1px solid #ddd; text-align: left; }
    .hotel-room-table th { background-color: #f5f5f5; }
    .number-wrapper { position: relative; display: flex; align-items: center; gap: 0; width: 100%; max-width: 140px; margin-bottom: 5px; }
    .number-wrapper input[type="number"] { flex: 1; min-width: 0; text-align: center; padding: 5px 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; -moz-appearance: textfield; box-sizing: border-box; }
    .number-wrapper input::-webkit-outer-spin-button, .number-wrapper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .number-btn { width: 32px; height: 32px; background: #f0f0f0; border: 1px solid #ccc; border-radius: 4px; font-size: 18px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; transition: background 0.15s; }
    .number-btn:hover { background: #e0e0e0; }
    .number-btn:active { background: #d0d0d0; }
    .number-btn.minus { margin-right: -1px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
    .number-btn.plus { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
    .room-selection-row { transition: all 0.3s ease; }
    .room-selection-row:hover { background: #f0f8ff !important; }
    .calendar-container { transition: all 0.3s ease; }
    .calendar-container:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    @media (max-width: 767px) {
        .calculator-table { border: 0; }
        .calculator-table tr { display: block; margin-bottom: 20px; }
        .calculator-table td { display: block; width: 100% !important; border: none; padding: 10px 0; }
        .number-wrapper { max-width: 180px; }
        .number-btn { width: 44px; height: 44px; font-size: 22px; }
        .room-selection-row { margin-bottom: 10px !important; }
        .calendar-container { padding: 10px !important; }
    }
    .book-btn:hover { background: #218838 !important; }
    .add-room-btn:hover { background: #218838 !important; transform: scale(1.1); }
    .remove-room-btn:hover { background: #c82333 !important; transform: scale(1.1); }
    .flatpickr-input { background-color: white !important; }