/* Убираем стандартные отступы Tilda */
body, html {
    margin: 0 !important;
    padding: 0 !important;
}

.t-records, [data-tilda-project-id], #allrecords {
    padding: 0 !important;
    margin: 0 !important;
}

/* СТИЛИ ДЛЯ СИСТЕМЫ БРОНИРОВАНИЯ */
.booking-button-wrapper {
    display: inline-block;
    position: relative;
    z-index: 1000;
}

.booking-button {
    width: 235px;
    height: 34px;
    background: #FF6F00;
    border-radius: 17px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 20px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s cubic-bezier(0.25,0.46,0.45,0.94);
    margin: 0;
    box-sizing: border-box;
}

.booking-button::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #FF6F00;
    border-radius: 21px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.booking-button:hover::before {
    opacity: 1;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 23px;
}

.booking-button:hover {
    background: #E65C00;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.4), inset 0 -2px 4px rgba(0,0,0,0.2);
}

.booking-button:active {
    transform: translateY(4px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 4px 8px rgba(0,0,0,0.3), inset 0 -1px 2px rgba(255,255,255,0.1);
    background: #B34700;
}

.booking-button:active::before {
    opacity: 0;
}

.button-text {
    color: white;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3), 0 -1px 1px rgba(0,0,0,0.2);
}

.circle-arrow {
    width: 26px;
    height: 26px;
    background: #ADC9D6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2), inset 0 -2px 4px rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.2);
}

.arrow {
    width: 14px;
    height: 10px;
    transform: rotate(45deg);
    position: relative;
}

.arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 10px;
    height: 3.5px;
    background: white;
    border-radius: 1.8px;
    transform: translateY(-50%);
}

.arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid white;
    transform: translateY(-50%);
}

/* МОДАЛЬНОЕ ОКНО */
.booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100000;
    backdrop-filter: blur(8px);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.booking-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.5s ease;
    z-index: 100001;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: #ADC9D6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    transition: all 0.3s ease;
    z-index: 100002;
}

.modal-close:hover {
    background: #9BB5C2;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 15px;
    padding-right: 30px;
}

.modal-title {
    font-family: 'Raleway', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #FF6F00;
    margin: 0 0 5px 0;
    text-transform: uppercase;
}

.modal-subtitle {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    color: #979797;
    font-weight: 500;
    margin: 0;
}

/* ФОРМА */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #FF6F00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
    font-family: 'Raleway', sans-serif;
    padding: 12px 15px;
    border: 2px solid #ADC9D6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #FF6F00;
    box-shadow: 0 0 0 3px rgba(255,111,0,0.1);
}

.form-select {
    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='%23ADC9D6' 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 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.4;
}

.dates-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.submit-button {
    font-family: 'Raleway', sans-serif;
    background: linear-gradient(135deg, #FF6F00 0%, #E65C00 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(255,111,0,0.3);
    width: 100%;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,111,0,0.4);
}

/* СООБЩЕНИЯ */
.form-success {
    display: none;
    text-align: center;
    padding: 25px 15px;
}

.success-icon {
    font-size: 35px;
    color: #FF6F00;
    margin-bottom: 10px;
}

.success-title {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #FF6F00;
    margin-bottom: 8px;
}

.success-message {
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    color: #979797;
    line-height: 1.4;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 3px solid rgba(255, 111, 0, 0.3);
    border-radius: 50%;
    border-top: 3px solid #FF6F00;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    display: none;
    text-align: center;
    padding: 12px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    margin-top: 8px;
}

.error-text {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    color: #ff4444;
    font-weight: 500;
}

/* КАЛЕНДАРЬ ДОСТУПНОСТИ */
.availability-calendar {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ADC9D6;
}

.calendar-mini {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.calendar-day-mini {
    padding: 4px 1px;
    text-align: center;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calendar-day-mini.header {
    background: #ADC9D6;
    color: white;
    font-weight: bold;
    font-size: 8px;
}

.calendar-day-mini.available {
    background: #ADC9D6;
    color: white;
}

.calendar-day-mini.booked {
    background: #FF6F00;
    color: white;
    font-weight: bold;
}

.calendar-day-mini.other-month {
    color: #ccc;
    background: #f5f5f5;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-available {
    background: #ADC9D6;
}

.legend-booked {
    background: #FF6F00;
}

/* Навигация календаря */
.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.calendar-nav-btn {
    background: #ADC9D6;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 9px;
    transition: all 0.3s ease;
}

.calendar-nav-btn:hover {
    background: #9BB5C2;
}

.calendar-month {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    color: #FF6F00;
    font-size: 10px;
    text-align: center;
}

.calendar-has-bookings {
    color: #FF6F00;
    font-size: 7px;
    margin-top: 2px;
    text-align: center;
}

/* Скрытие формы Tilda */
#rec1589983391 {
    display: none;
    visibility: hidden;
    opacity: 0;
    height: 0;
    width: 0;
    position: absolute;
    left: -9999px;
    top: -9999px;
    pointer-events: none;
    z-index: -9999;
    overflow: hidden;
}

#rec1589983391 * {
    display: none;
    visibility: hidden;
    opacity: 0;
    height: 0;
    width: 0;
    pointer-events: none;
}

/* Дополнительные стили календаря */
.calendar-day-mini.checkout-day {
    background: #ADC9D6;
    border: 1px solid #2196f3;
    color: white;
    font-weight: bold;
    position: relative;
}

/* Скрываем оригинальную легенду - ИСПРАВЛЕННЫЙ СЕЛЕКТОР */
.calendar-legend > .legend-item {
    display: none;
}

/* Стили для кастомной легенды */
.legend-custom {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 8px;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .booking-modal {
        padding: 10px;
        align-items: center;
    }
    
    .modal-content {
        padding: 15px;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .modal-title { font-size: 18px; }
    .modal-subtitle { font-size: 11px; }
    .booking-form { gap: 10px; }
    .form-input, .form-select, .form-textarea { padding: 10px 12px; font-size: 16px; }
    .dates-row { grid-template-columns: 1fr; gap: 6px; }
    .submit-button { padding: 10px 16px; font-size: 13px; }
    .availability-calendar { margin: 8px 0; padding: 8px; }
    .calendar-mini { gap: 1px; }
    .calendar-day-mini { padding: 3px 0; font-size: 8px; min-height: 18px; }
    .calendar-day-mini.header { font-size: 7px; }
    .calendar-legend { font-size: 7px; }
    .calendar-day-mini.checkout-day { padding: 2px 0; font-size: 7px; border-width: 1px; }
    .legend-custom { font-size: 7px; gap: 6px; }
}