/* Убираем стандартные отступы 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;
    align-items: center;
    justify-content: center;
}

.booking-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 25px 20px 20px 20px;
    width: 100%;
    max-width: 380px; /* КОМПАКТНЕЕ */
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.5s ease;
    z-index: 100001;
    box-sizing: border-box;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    background: #ADC9D6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    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: 20px; /* МЕНЬШЕ */
    padding-right: 30px;
}

.modal-title {
    font-family: 'Raleway', sans-serif;
    font-size: 18px; /* МЕНЬШЕ */
    font-weight: 700;
    color: #FF6F00;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    line-height: 1.2;
}

.modal-subtitle {
    font-family: 'Raleway', sans-serif;
    font-size: 11px; /* МЕНЬШЕ */
    color: #979797;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

/* ФОРМА - КОМПАКТНАЯ С СИММЕТРИЧНЫМИ ОТСТУПАМИ */
.booking-form {
    display: flex;
    flex-direction: column;
}

/* СИММЕТРИЧНЫЕ ОТСТУПЫ МЕЖДУ ГРУППАМИ */
.form-group {
    margin-bottom: 14px; /* СИММЕТРИЧНЫЙ отступ между всеми группами */
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #FF6F00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    margin-bottom: 6px; /* СИММЕТРИЧНЫЙ отступ до поля */
    display: block;
}

.form-input, .form-select, .form-textarea {
    font-family: 'Raleway', sans-serif;
    padding: 10px 12px; /* КОМПАКТНЕЕ */
    border: 2px solid #ADC9D6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    line-height: 1.4;
    height: 40px; /* КОМПАКТНЕЕ */
    min-height: 40px;
    display: block;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #FF6F00;
    box-shadow: 0 0 0 2px 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 10px center;
    background-size: 14px;
    padding-right: 35px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px; /* КОМПАКТНЕЕ */
    line-height: 1.4;
    height: auto;
    min-height: 80px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ДАТЫ В ОДНУ ЛИНИЮ */
.dates-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px; /* СИММЕТРИЧНЫЙ отступ между датами */
    margin-bottom: 14px; /* ТАКОЙ ЖЕ как у других групп */
}

.submit-button {
    font-family: 'Raleway', sans-serif;
    background: linear-gradient(135deg, #FF6F00 0%, #E65C00 100%);
    color: white;
    border: none;
    padding: 12px 18px; /* КОМПАКТНЕЕ */
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px; /* СИММЕТРИЧНЫЙ отступ сверху */
    box-shadow: 0 4px 10px rgba(255,111,0,0.3);
    width: 100%;
    line-height: 1.2;
    height: 42px; /* КОМПАКТНЕЕ */
    display: block;
}

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

/* КОМПАКТНЫЙ ЧЕКБОКС */
.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    font-size: 12px; /* МЕНЬШЕ */
    line-height: 1.4;
    color: #333;
    user-select: none;
}

/* ВИДИМЫЙ ЧЕКБОКС */
.privacy-checkbox input[type="checkbox"] {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin: 2px 8px 0 0 !important; /* КОМПАКТНЕЕ */
    vertical-align: top !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    position: static !important;
}

/* ТЕКСТ ЧЕКБОКСА В ОДНУ СТРОКУ */
.privacy-checkbox .checkbox-text {
    display: inline;
    vertical-align: top;
    line-height: 1.4;
    flex: 1;
}

/* ССЫЛКА ВНУТРИ ТЕКСТА */
.privacy-link {
    color: #FF6F00 !important;
    text-decoration: underline !important;
    cursor: pointer;
    transition: color 0.3s;
    font-weight: 500;
    display: inline !important;
    white-space: nowrap;
}

.privacy-link:hover {
    color: #e65c00 !important;
    text-decoration: none !important;
}

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

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

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

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

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

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

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

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

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

/* КАЛЕНДАРЬ ДОСТУПНОСТИ - КОМПАКТНЫЙ */
.availability-calendar {
    margin: 15px 0; /* СИММЕТРИЧНЫЙ отступ */
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ADC9D6;
}

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

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

.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: 8px;
    font-size: 8px;
    flex-wrap: wrap;
}

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

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

.legend-available {
    background: #ADC9D6;
}

.legend-booked {
    background: #FF6F00;
}

/* Навигация календаря */
.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 5px;
    position: relative;
    z-index: 1000;
}

.calendar-nav-btn {
    background: #ADC9D6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
    user-select: none;
}

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

.calendar-month {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    color: #FF6F00;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    flex-grow: 1;
    padding: 0 8px;
    white-space: nowrap;
}

/* Скрытие формы 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;
}

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

/* Стили для прошедших дней в календаре */
.calendar-day-mini.past-day {
    background-color: #CCCCCC !important;
    color: #888888 !important;
    cursor: not-allowed !important;
}

.calendar-day-mini.past-day.booked {
    background-color: #AAAAAA !important;
    color: #666666 !important;
}

.calendar-day-mini.past-day.available {
    background-color: #CCCCCC !important;
    color: #888888 !important;
}

/* ФИКС ДЛЯ ПРЕДОТВРАЩЕНИЯ ПРЫЖКОВ */
#bookingModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: none !important;
    z-index: 100000 !important;
}

#bookingModal.active {
    display: flex !important;
}

.modal-content {
    box-sizing: border-box !important;
    position: relative !important;
    transition: none !important;
}

/* =========================================== */
/* ПЛАНШЕТЫ (горизонтально) */
/* =========================================== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .modal-content {
        max-width: 450px !important; /* ШИРЕ для планшетов */
        padding: 20px 25px !important;
    }
    
    .modal-title {
        font-size: 20px !important;
    }
    
    .modal-subtitle {
        font-size: 12px !important;
    }
    
    .form-group {
        margin-bottom: 16px !important;
    }
    
    .form-input, .form-select, .form-textarea {
        padding: 12px 14px !important;
        height: 44px !important;
        min-height: 44px !important;
        font-size: 15px !important;
    }
    
    .form-textarea {
        min-height: 90px !important;
    }
    
    .submit-button {
        padding: 14px 20px !important;
        height: 46px !important;
        font-size: 15px !important;
    }
    
    .privacy-checkbox {
        font-size: 13px !important;
    }
}

/* =========================================== */
/* МОБИЛЬНАЯ ВЕРСИЯ - КОМПАКТНАЯ */
/* =========================================== */
@media (max-width: 768px) {
    .booking-modal {
        padding: 15px !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
    }
    
    .modal-content {
        padding: 20px 18px 18px 18px !important;
        max-width: calc(100vw - 30px) !important;
        margin: 15px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        border-radius: 10px !important;
    }
    
    .modal-header {
        margin-bottom: 18px !important;
        padding-right: 25px !important;
    }
    
    .modal-title {
        font-size: 17px !important;
        margin-bottom: 6px !important;
    }
    
    .modal-subtitle {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }
    
    /* ТАКИЕ ЖЕ СИММЕТРИЧНЫЕ ОТСТУПЫ */
    .form-group {
        margin-bottom: 14px !important;
    }
    
    .form-label {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    
    .form-input, .form-select, .form-textarea {
        padding: 11px 13px !important;
        font-size: 15px !important;
        height: 42px !important;
        min-height: 42px !important;
        line-height: 1.4 !important;
        -webkit-appearance: none !important;
        border-radius: 6px !important;
    }
    
    .form-textarea {
        min-height: 80px !important;
        height: auto !important;
        padding-top: 11px !important;
        padding-bottom: 11px !important;
    }
    
    .dates-row {
        gap: 10px !important;
        margin-bottom: 14px !important;
    }
    
    .submit-button {
        padding: 13px 18px !important;
        font-size: 14px !important;
        border-radius: 50px !important;
        line-height: 1.2 !important;
        height: 44px !important;
        margin-top: 8px !important;
    }
    
    /* ЧЕКБОКС НА МОБИЛЬНЫХ */
    .privacy-checkbox {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    
    .privacy-checkbox input[type="checkbox"] {
        width: 16px !important;
        height: 16px !important;
        margin: 2px 8px 0 0 !important;
    }
    
    .privacy-link {
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    .availability-calendar {
        margin: 14px 0 !important;
        padding: 10px !important;
    }
    
    .calendar-navigation {
        margin-bottom: 10px !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .calendar-nav-btn {
        padding: 8px 12px !important;
        min-height: 36px !important;
        font-size: 12px !important;
        min-width: 65px !important;
        margin: 0 5px !important;
    }
    
    .calendar-month {
        font-size: 12px !important;
        padding: 0 8px !important;
        min-width: 120px !important;
    }
    
    .calendar-mini {
        gap: 2px !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    .calendar-day-mini {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 11px !important;
        line-height: 36px !important;
        padding: 0 !important;
        margin: 0 auto !important;
    }
    
    .calendar-day-mini.header {
        font-size: 9px !important;
        height: 30px !important;
        line-height: 30px !important;
    }
    
    .calendar-legend {
        font-size: 9px !important;
        gap: 8px !important;
        margin-top: 8px !important;
    }
    
    .legend-custom {
        font-size: 9px !important;
        gap: 8px !important;
    }
    
    input[type="date"] {
        min-height: 42px !important;
        font-size: 15px !important;
    }
    
    .form-success {
        padding: 25px 15px !important;
    }
    
    .success-icon {
        font-size: 35px !important;
        margin-bottom: 12px !important;
    }
    
    .success-title {
        font-size: 17px !important;
        margin-bottom: 10px !important;
    }
    
    .success-message {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    
    .loading-spinner {
        padding: 25px 15px !important;
    }
    
    .spinner {
        width: 35px !important;
        height: 35px !important;
        margin-bottom: 12px !important;
    }
}

/* ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ */
@media (max-width: 480px) {
    .modal-content {
        padding: 18px 15px 15px 15px !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    .form-group {
        margin-bottom: 12px !important;
    }
    
    .form-input, .form-select, .form-textarea {
        padding: 10px 12px !important;
        font-size: 14px !important;
        height: 40px !important;
        min-height: 40px !important;
    }
    
    .form-textarea {
        min-height: 70px !important;
    }
    
    .calendar-day-mini {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 10px !important;
        line-height: 32px !important;
    }
    
    .calendar-nav-btn {
        padding: 7px 10px !important;
        min-width: 60px !important;
        font-size: 11px !important;
        margin: 0 4px !important;
    }
    
    .calendar-month {
        font-size: 11px !important;
        min-width: 110px !important;
    }
    
    .calendar-legend,
    .legend-custom {
        font-size: 8px !important;
        gap: 6px !important;
    }
    
    .privacy-checkbox {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }
}

/* iOS SAFARI ФИКСЫ */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}