/* Стили для модального окна бронирования */
.booking-modal {
    display: none; /* Изначально скрыто */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(33, 37, 41, 0.7); /* Используем var(--text-dark) с прозрачностью */
    z-index: 10000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.booking-modal.active {
    display: block; /* Показываем, когда активна */
    opacity: 1;
}

.booking-modal-content {
    background-color: #fff; /* Используем переменную, если есть, или конкретный цвет */
    margin: 40px auto;
    max-width: 800px;
    width: 90%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transform: translateY(30px);
    opacity: 0;
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s; /* Задержка для контента, чтобы появлялся после фона */
}

.booking-modal.active .booking-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.booking-modal-header {
    background-color: #faa2c1; /* Новый розовый */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease 0.1s, opacity 0.3s ease 0.1s;
}

.booking-modal.active .booking-modal-header {
    transform: translateY(0);
    opacity: 1;
}

.booking-modal-header h3 {
    color: var(--text-light); /* Светлый текст на розовом */
    margin: 0;
    font-size: 1.5rem;
}

.booking-modal-close {
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: transform 0.2s ease;
}

.booking-modal-close:hover {
    transform: rotate(90deg);
}

.booking-modal-body {
    padding: 20px;
}

/* СТИЛИЗАЦИЯ СЕЛЕКТОРА ВЫБОРА УСЛУГИ */
.service-selection {
    position: relative;
}
.service-selection select {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border-radius: 8px;
    border: 1.5px solid rgba(0, 0, 0, 0.7);
    outline: none;
    background-color: #fff;
    color: #212529;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(134,142,150,0.08);
    transition: border-color 0.25s, box-shadow 0.25s;
    appearance: none;
    cursor: pointer;
    margin-top: 8px;
    height: 44px;
    line-height: 22px;
    background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 8l5 5 5-5" stroke="%23faa2c1" stroke-width="2.2" fill="none" fill-rule="evenodd"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px 20px;
}
.service-selection select:focus,
.service-selection select:hover {
    border-color: #faa2c1;
    box-shadow: 0 4px 18px rgba(250,162,193,0.19);
}
.service-selection option {
    color: #212529;
    background: #fff;
}
.service-selection option:checked {
    background: #faa2c1;
    color: #fff;
}
/* Стилизация стрелки вниз */
.service-selection select::-ms-expand {
    display: none;
}
@media (max-width: 600px) {
    .service-selection select {
        height: 40px;
        line-height: 20px;
        padding-right: 36px;
        background-size: 18px 18px;
        background-position: right 10px center;
    }
}

.booking-steps {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease 0.2s, opacity 0.3s ease 0.2s;
}

.booking-modal.active .booking-steps {
    transform: translateY(0);
    opacity: 1;
}

.booking-step {
    padding: 10px 20px;
    margin-right: 5px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.booking-step:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #faa2c1;
    transition: width 0.3s ease;
}

.booking-step:hover:after {
    width: 100%;
}

.booking-step.active {
    font-weight: 500;
    border-bottom-color: #faa2c1; /* Новый розовый для активной вкладки */
    color: #faa2c1;
}

.booking-step.active:after {
    width: 100%;
    background-color: #faa2c1;
}

/* Фикс невидимости: все .booking-step-content по умолчанию display:none, только .active display:block (с !important) */
.booking-step-content {
    display: none; /* Все шаги по умолчанию скрыты */
}

.booking-step-content.active {
    display: block; /* Только активный шаг отображается */
}

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

/* Стили для календаря */
.booking-calendar {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards 0.3s;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.calendar-nav {
    display: flex;
}

/* СТИЛИЗАЦИЯ КНОПОК ПЕРЕКЛЮЧЕНИЯ МЕСЯЦЕВ В КЛИЕНТСКОМ КАЛЕНДАРЕ */
#bookingModal .calendar-header button.calendar-prev,
#bookingModal .calendar-header button.calendar-next {
    background-color: #faa2c1;
    color: white !important; /* Важно для иконки */
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1; /* Убираем лишнюю высоту строки */
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px; /* Отступы между кнопками и заголовком месяца */
}

#bookingModal .calendar-header button.calendar-prev:hover,
#bookingModal .calendar-header button.calendar-next:hover {
    background-color: #f885b3;
    transform: scale(1.1);
}

#bookingModal .calendar-header button.calendar-prev i,
#bookingModal .calendar-header button.calendar-next i {
    color: white; /* Гарантируем белый цвет иконки */
    font-size: inherit; /* Наследуем размер от кнопки */
}

/* Для совместимости: если кнопки вне модального окна, оставить старый стиль */
.calendar-nav button {
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.7);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.3s;
    color: rgba(0, 0, 0, 0.7);
}

.calendar-nav button:hover {
    background-color: #faa2c1;
    color: var(--text-light);
    border-color: #faa2c1;
    transform: scale(1.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 500;
    padding: 5px;
    color: rgba(0, 0, 0, 0.7);
}

.calendar-day {
    border: 1px solid rgba(0, 0, 0, 0.7);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    color: #212529;
}

.calendar-day:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #faa2c1;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.calendar-day:hover:not(.disabled):not(.selected):before {
    opacity: 0.08;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    transform: translateY(-3px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    border-color: #faa2c1;
}

.calendar-day.today {
    background-color: #f0f0f0;
    font-weight: 500;
    border-color: rgba(0, 0, 0, 0.7);
}

.calendar-day.selected {
    background-color: #faa2c1;
    color: var(--text-light);
    border-color: #faa2c1;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

.calendar-day.selected:before { /* Для анимации пульса */
    box-shadow: 0 0 0 0 rgba(250, 162, 193, 0.4); /* Оттенок нового розового */
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 162, 193, 0.4); /* Оттенок нового розового */
    }
    70% {
        box-shadow: 0 0 0 10px rgba(250, 162, 193, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(250, 162, 193, 0);
    }
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: #f9f9f9;
    border-color: #eee;
}

.calendar-day.has-slots {
    position: relative;
}

.calendar-day.has-slots::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #faa2c1;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Стили для выбора времени */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 20px;
    opacity: 0;
    animation: fadeIn 0.5s forwards 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.time-slot {
    border: 1px solid rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    color: #212529;
}

.time-slot:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #faa2c1;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.time-slot:hover:not(.disabled):before {
    opacity: 0.08;
}

.time-slot:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    border-color: #faa2c1;
}

.time-slot.selected {
    background-color: #faa2c1;
    color: var(--text-light);
    border-color: #faa2c1;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.time-slot.disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: #f9f9f9;
    border-color: #eee;
}

/* Стили для формы информации клиента */
.client-form {
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 0.5s forwards 0.2s;
}

.client-form .form-group {
    margin-bottom: 15px;
    transform: translateY(10px);
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
}

.client-form .form-group:nth-child(1) { animation-delay: 0.1s; }
.client-form .form-group:nth-child(2) { animation-delay: 0.2s; }
.client-form .form-group:nth-child(3) { animation-delay: 0.3s; }
.client-form .form-group:nth-child(4) { animation-delay: 0.4s; }

.client-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.client-form input:focus + label,
.client-form textarea:focus + label {
    color: #faa2c1;
}

.client-form input,
.client-form select,
.client-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    color: #212529;
}

.client-form input:focus,
.client-form select:focus,
.client-form textarea:focus {
    outline: none;
    border-color: #faa2c1;
    box-shadow: 0 0 0 3px rgba(250, 162, 193, 0.3); /* Оттенок нового розового */
}

.client-form textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    opacity: 0;
    animation: fadeIn 0.5s forwards 0.5s;
}

.btn-back {
    background-color: var(--primary-color-grey); /* Новый серый */
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-back:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn-back:hover:before {
    transform: translateX(0);
}

.btn-back:hover {
    background-color: #6c757d; /* Темнее серый */
    transform: translateY(-2px);
}

.btn-next,
.btn-submit {
    background-color: #faa2c1; /* Новый розовый */
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-next:disabled,
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-next:before,
.btn-submit:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn-next:hover:not(:disabled):before,
.btn-submit:hover:not(:disabled):before {
    transform: translateX(0);
}

.btn-next:hover:not(:disabled),
.btn-submit:hover:not(:disabled) {
    background-color: #f783ac; /* Темнее розовый */
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Новый стиль для .btn-close, аналогичный .btn-submit */
.btn-close {
    display: inline-block;
    background: #faa2c1;
    color: #fff;
    font-weight: 500;
    border: none;
    border-radius: 24px;
    padding: 10px 32px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(134,142,150,0.07);
}

.btn-close:hover, .btn-close:focus {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    outline: none;
}

/* Стили для подтверждения бронирования */
.booking-confirmation {
    text-align: center;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.5s forwards 0.2s;
}

.booking-confirmation i {
    font-size: 50px;
    color: #28a745; /* Зеленый для успеха можно оставить */
    margin-bottom: 20px;
    animation: bounceIn 0.8s forwards;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.booking-details {
    margin: 20px auto;
    max-width: 400px;
    text-align: left;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.5s forwards 0.5s;
}

.booking-details p {
    margin: 10px 0;
    transform: translateX(-20px);
    opacity: 0;
    animation: slideInRight 0.5s forwards;
}

.booking-details p:nth-child(1) { animation-delay: 0.6s; }
.booking-details p:nth-child(2) { animation-delay: 0.7s; }
.booking-details p:nth-child(3) { animation-delay: 0.8s; }
.booking-details p:nth-child(4) { animation-delay: 0.9s; }
.booking-details p:nth-child(5) { animation-delay: 1.0s; }
.booking-details p:nth-child(6) { animation-delay: 1.1s; }

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

.booking-details strong {
    font-weight: 500;
    color: #faa2c1;
}

/* Добавляем анимацию для переключения между шагами */
@keyframes fadeOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-30px);
        opacity: 0;
    }
}

@keyframes fadeInFromRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(30px);
        opacity: 0;
    }
}

@keyframes fadeInFromLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .booking-steps {
        flex-direction: column;
        border-bottom: none;
    }

    .booking-step {
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 5px;
    }

    .booking-step:after {
        top: 0;
        bottom: 0;
        left: -3px;
        width: 3px;
        height: 0;
    }

    .booking-step:hover:after {
        height: 100%;
        width: 3px;
    }

    .booking-step.active:after {
        height: 100%;
        width: 3px;
    }

    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .booking-modal-content {
        margin: 20px auto;
        width: 95%;
    }

    .booking-step.active {
        /* border-left-color: var(--secondary-color-accent); уже используется :after */
    }

    /* Фикс невидимости для мобильного календаря — всегда видно только активный шаг */
    .booking-step-content {
        display: none;
    }
    .booking-step-content.active {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
