/* ============================================
   БАЗОВЫЕ СТИЛИ КАЛЬКУЛЯТОРА
   ============================================ */

.calc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ============================================
   АДАПТИВНАЯ СЕТКА: ОБЁРТКА ДЛЯ ФОРМЫ И КАЛЕНДАРЯ
   ============================================ */

.calc-layout {
    display: flex;
    flex-direction: column; /* По умолчанию (мобильные): вертикально */
    gap: 20px;
    margin-bottom: 20px;
}

/* Стили для карточек внутри обёртки */
.calc-form,
.calc-booking-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Десктоп: горизонтальное расположение */
@media (min-width: 992px) {
    .calc-layout {
        flex-direction: row; /* В ряд */
        align-items: flex-start; /* Выравнивание по верхнему краю */
    }
    
    .calc-form {
        flex: 1; /* Занимает 50% доступного пространства */
        min-width: 0; /* Важно для корректной работы flexbox с вложенными элементами */
    }
    
    .calc-booking-section {
        flex: 1; /* Занимает 50% доступного пространства */
        min-width: 0;
    }
}

/* ============================================
   ФОРМА КАЛЬКУЛЯТОРА
   ============================================ */

.calc-title {
    font-size: 24px;
    color: #333;
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.calc-field {
    margin-bottom: 25px;
}

.calc-field-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.calc-required {
    color: #f44336;
    font-weight: normal;
}

/* ============================================
   RADIO BUTTONS
   ============================================ */

.calc-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-radio-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.calc-radio-option:hover {
    border-color: #2196f3;
    background: #f5f9ff;
}

.calc-radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2196f3;
}

.calc-radio-option:has(input[type="radio"]:checked) {
    border-color: #2196f3;
    background: #e3f2fd;
}

.calc-radio-label {
    font-size: 15px;
    color: #555;
    flex: 1;
}

.calc-radio-option:has(input[type="radio"]:checked) .calc-radio-label {
    font-weight: 600;
    color: #1976d2;
}

/* ============================================
   SELECT
   ============================================ */

.calc-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    font-family: inherit;
}

.calc-select:focus {
    outline: none;
    border-color: #2196f3;
}

/* ============================================
   CHECKBOX
   ============================================ */

.calc-checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.calc-checkbox-option:hover {
    border-color: #4caf50;
    background: #f1f8e9;
}

.calc-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4caf50;
}

.calc-checkbox-option:has(.calc-checkbox:checked) {
    border-color: #4caf50;
    background: #e8f5e9;
}

.calc-checkbox-label {
    font-size: 15px;
    color: #555;
    flex: 1;
}

.calc-checkbox-option:has(.calc-checkbox:checked) .calc-checkbox-label {
    font-weight: 600;
    color: #2e7d32;
}

/* ============================================
   NUMBER INPUT
   ============================================ */

.calc-number-group {
    display: flex;
    align-items: center;
}

.calc-number-input {
    width: 120px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.2s;
    font-family: inherit;
}

.calc-number-input:focus {
    outline: none;
    border-color: #ff9800;
}

/* ============================================
   СЕКЦИЯ БРОНИРОВАНИЯ (КАЛЕНДАРЬ + СЛОТЫ)
   ============================================ */

.calc-section-title {
    font-size: 20px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
}

/* ============================================
   КАЛЕНДАРЬ
   ============================================ */

.calc-calendar {
    margin-bottom: 20px;
}

.calc-calendar-loading,
.calc-error {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

.calc-error {
    color: #f44336;
    background: #ffebee;
    border-radius: 8px;
    padding: 15px;
}

.calc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calc-calendar-header {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    padding: 8px 4px;
    text-transform: uppercase;
}

.calc-calendar-header.weekend {
    color: #f44336;
}

.calc-calendar-day {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: default;
    transition: all 0.2s;
    background: #f5f5f5;
    border: 2px solid transparent;
    padding: 4px;
    min-height: 70px;
}

.calc-calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calc-calendar-day.disabled {
    background: #f5f5f5;
    color: #bbb;
    cursor: not-allowed;
    opacity: 0.6;
}

.calc-calendar-day.available {
    background: #e8f5e9;
    cursor: pointer;
    border-color: #c8e6c9;
}

.calc-calendar-day.available:hover {
    background: #c8e6c9;
    border-color: #81c784;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calc-calendar-day.today {
    border-color: #2196f3;
    font-weight: 700;
    position: relative;
}

.calc-calendar-day.today::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #2196f3;
    border-radius: 50%;
    top: 4px;
    right: 4px;
}

.calc-calendar-day.selected {
    background: #2196f3;
    color: white;
    border-color: #1976d2;
    font-weight: 700;
}

.calc-calendar-day.selected .day-number,
.calc-calendar-day.selected .day-month {
    color: white;
}

.day-number {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1;
}

.day-month {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    line-height: 1;
}

.calc-calendar-day.disabled .day-number {
    color: #bbb;
}

/* ============================================
   СЛОТЫ (КНОПКИ ВРЕМЕНИ)
   ============================================ */

.calc-slots-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.calc-slots-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.calc-slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
    color: #333;
}

.calc-slots-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.calc-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}

.calc-slot-button {
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.calc-slot-button:hover {
    border-color: #4caf50;
    background: #f1f8e9;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calc-slot-button.selected {
    background: #4caf50;
    color: white;
    border-color: #388e3c;
}

.calc-slots-empty {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.calc-slots-empty p {
    margin: 8px 0;
}

.calc-slots-hint {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* ============================================
   ВЫБРАННЫЙ СЛОТ (ИНФО-БЛОК)
   ============================================ */

.calc-selected-slot-info {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.calc-selected-slot-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.calc-selected-icon {
    font-size: 20px;
}

.calc-selected-text {
    flex: 1;
    font-size: 15px;
    color: #2e7d32;
}

.calc-selected-clear {
    background: transparent;
    border: 1px solid #ef5350;
    color: #ef5350;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}

.calc-selected-clear:hover {
    background: #ef5350;
    color: white;
}

/* ============================================
   БЛОК ЦЕНЫ
   ============================================ */

.calc-price-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    /* margin-top убран, так как gap в .calc-layout или стандартный поток обеспечит отступ */
}

.calc-price-label {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calc-price-value {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1;
}

.calc-price-value.calc-loading {
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

.calc-price-value.calc-error {
    color: #ffebee;
    font-size: 20px;
}

.calc-duration-value,
.calc-slot-value {
    font-size: 15px;
    opacity: 0.95;
    margin-top: 8px;
    background: rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.calc-duration-value {
    display: block;
    margin: 8px auto 0;
}

.calc-slot-value {
    display: block;
    margin: 8px auto 0;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}


/* ============================================
   ФОРМА КОНТАКТОВ
   ============================================ */

.calc-contact-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.calc-contact-subtitle {
    color: #666;
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.calc-contact-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Десктоп: два поля в ряд */
@media (min-width: 768px) {
    .calc-contact-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .calc-contact-field.full-width,
    .calc-contact-field:has(textarea),
    .calc-contact-field:has(.calc-preferred-contact-group),
    .calc-contact-field:has(.calc-submit-button) {
        grid-column: 1 / -1;
    }
}

.calc-contact-field {
    display: flex;
    flex-direction: column;
}

.calc-contact-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.calc-contact-label .calc-required {
    color: #f44336;
}

.calc-contact-input,
.calc-contact-textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: white;
}

.calc-contact-input:focus,
.calc-contact-textarea:focus {
    outline: none;
    border-color: #2196f3;
}

.calc-contact-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Предпочтительный способ связи */
.calc-preferred-contact-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calc-preferred-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-size: 14px;
}

.calc-preferred-option:hover {
    border-color: #2196f3;
    background: #f5f9ff;
}

.calc-preferred-option input[type="radio"] {
    margin-right: 8px;
    accent-color: #2196f3;
}

.calc-preferred-option:has(input[type="radio"]:checked) {
    border-color: #2196f3;
    background: #e3f2fd;
    font-weight: 600;
}

/* Кнопка отправки */
.calc-submit-button {
    padding: 16px 30px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.calc-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.calc-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.calc-submit-button:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* Сообщение валидации */
.calc-validation-message {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.calc-validation-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО УСПЕХА
   ============================================ */

.calc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calc-modal {
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc-modal-header {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

.calc-modal-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.calc-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.calc-modal-body {
    padding: 25px 30px;
}

.calc-modal-body p {
    margin: 0 0 20px;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.calc-modal-details {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
}

.calc-modal-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.calc-modal-detail-row:last-child {
    border-bottom: none;
}

.calc-modal-detail-label {
    color: #666;
    font-size: 14px;
}

.calc-modal-detail-value {
    color: #333;
    font-weight: 700;
    font-size: 14px;
}

.calc-modal-footer {
    padding: 0 30px 25px;
}

.calc-modal-close {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.calc-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Адаптивность модалки */
@media (max-width: 480px) {
    .calc-modal-header {
        padding: 20px;
    }
    
    .calc-modal-icon {
        font-size: 36px;
    }
    
    .calc-modal-title {
        font-size: 18px;
    }
    
    .calc-modal-body {
        padding: 20px;
    }
    
    .calc-modal-footer {
        padding: 0 20px 20px;
    }
}

/* Адаптивность формы контактов */
@media (max-width: 767px) {
    .calc-contact-section {
        padding: 20px;
    }
    
    .calc-preferred-contact-group {
        flex-direction: column;
    }
    
    .calc-preferred-option {
        width: auto;
    }
}

/* ============================================
   КОМПАКТНЫЙ РЕЖИМ ВИДЖЕТА
   ============================================ */

/* Уменьшаем отступы в основных секциях */
.calc-form,
.calc-booking-section,
.calc-contact-section {
    padding: 20px;
}

.calc-layout {
    gap: 15px;
    margin-bottom: 15px;
}

.calc-price-display {
    padding: 20px;
    margin-top: 15px;
}

/* Уменьшаем заголовки */
.calc-title {
    font-size: 20px;
    margin-bottom: 20px;
}

.calc-section-title {
    font-size: 18px;
    margin-bottom: 15px;
}

.calc-contact-subtitle {
    font-size: 13px;
    margin-bottom: 15px;
}

/* Уменьшаем поля формы */
.calc-field {
    margin-bottom: 15px;
}

.calc-field-label {
    font-size: 13px;
    margin-bottom: 6px;
}

/* Уменьшаем radio-кнопки */
.calc-radio-option {
    padding: 8px 12px;
    margin-bottom: 6px;
}

.calc-radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

.calc-radio-label {
    font-size: 13px;
}

/* Уменьшаем select */
.calc-select {
    padding: 8px 12px;
    font-size: 13px;
}

/* Уменьшаем checkbox */
.calc-checkbox-option {
    padding: 8px 12px;
}

.calc-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

.calc-checkbox-label {
    font-size: 13px;
}

/* Уменьшаем number input */
.calc-number-input {
    width: 100px;
    padding: 8px 12px;
    font-size: 14px;
}

/* Уменьшаем календарь */
.calc-calendar-grid {
    gap: 4px;
}

.calc-calendar-header {
    font-size: 11px;
    padding: 6px 2px;
}

.calc-calendar-day {
    min-height: 50px;
    padding: 3px;
}

.day-number {
    font-size: 14px;
}

.day-month {
    font-size: 8px;
}

/* Уменьшаем слоты */
.calc-slots-grid {
    gap: 6px;
}

.calc-slot-button {
    padding: 8px 6px;
    font-size: 13px;
}

.calc-slots-header {
    font-size: 13px;
    margin-bottom: 10px;
}

.calc-slots-count {
    font-size: 11px;
    padding: 3px 8px;
}

/* Уменьшаем блок цены */
.calc-price-label {
    font-size: 13px;
    margin-bottom: 5px;
}

.calc-price-value {
    font-size: 32px;
    margin-bottom: 8px;
}

.calc-duration-value,
.calc-slot-value {
    font-size: 13px;
    padding: 6px 12px;
    margin-top: 5px;
}

/* Уменьшаем форму контактов */
.calc-contact-field {
    margin-bottom: 12px;
}

.calc-contact-label {
    font-size: 12px;
    margin-bottom: 5px;
}

.calc-contact-input,
.calc-contact-textarea {
    padding: 8px 12px;
    font-size: 13px;
}

.calc-contact-textarea {
    min-height: 60px;
}

/* Уменьшаем радио-кнопки дополнительных способов связи */
.calc-preferred-option {
    padding: 6px 10px;
    font-size: 12px;
}

.calc-preferred-option input[type="radio"] {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

/* Уменьшаем кнопку отправки */
.calc-submit-button {
    padding: 12px 20px;
    font-size: 15px;
}

/* Уменьшаем сообщение валидации */
.calc-validation-message {
    padding: 8px 12px;
    font-size: 12px;
}

/* Уменьшаем выбранный слот */
.calc-selected-slot-info {
    padding: 10px;
    margin-top: 10px;
}

.calc-selected-text {
    font-size: 13px;
}

.calc-selected-clear {
    padding: 4px 8px;
    font-size: 11px;
}

/* Адаптивность для компактного режима */
@media (max-width: 991px) {
    .calc-form,
    .calc-booking-section,
    .calc-contact-section {
        padding: 15px;
    }
    
    .calc-title {
        font-size: 18px;
    }
    
    .calc-section-title {
        font-size: 16px;
    }
    
    .calc-price-value {
        font-size: 28px;
    }
    
    .calc-calendar-day {
        min-height: 45px;
    }
    
    .day-number {
        font-size: 13px;
    }
    
    .day-month {
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    .calc-form,
    .calc-booking-section,
    .calc-contact-section {
        padding: 12px;
    }
    
    .calc-title {
        font-size: 16px;
    }
    
    .calc-section-title {
        font-size: 14px;
    }
    
    .calc-price-value {
        font-size: 24px;
    }
    
    .calc-calendar-day {
        min-height: 40px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .day-month {
        font-size: 6px;
    }
    
    .calc-slot-button {
        padding: 6px 4px;
        font-size: 12px;
    }
}

/* ============================================
   АДАПТИВНОСТЬ (МОБИЛЬНЫЕ И ПЛАНШЕТЫ)
   ============================================ */

@media (max-width: 991px) {
    .calc-container {
        padding: 10px;
    }
    
    .calc-form,
    .calc-booking-section {
        padding: 20px;
    }
    
    .calc-title {
        font-size: 20px;
    }
    
    .calc-price-value {
        font-size: 32px;
    }
    
    .calc-calendar-grid {
        gap: 4px;
    }
    
    .calc-calendar-day {
        min-height: 60px;
    }
    
    .day-number {
        font-size: 15px;
    }
    
    .day-month {
        font-size: 9px;
    }
    
    .calc-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .calc-selected-slot-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .calc-selected-clear {
        align-self: flex-end;
    }
}

/* Очень маленькие экраны (мобильные < 480px) */
@media (max-width: 480px) {
    .calc-price-value {
        font-size: 28px;
    }
    
    .calc-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calc-calendar-day {
        min-height: 50px;
        padding: 2px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-month {
        font-size: 8px;
    }
    
    .calc-section-title {
        font-size: 18px;
    }
}