* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
    overflow-y: auto;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Обёртка для основного контента и карты */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Боковая панель с картой (только для ПК) */
@media (min-width: 1025px) {
    .map-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 50%;
        height: 75vh;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border-right: 1px solid rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        z-index: 1;
    }

    .map-block {
        padding: 20px;
        position: relative;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .map-title {
        font-size: 1.5rem;
        color: #2d3436;
        margin-bottom: 10px;
        text-align: center;
    }

    .map-address {
        color: #2d3436;
        font-size: 2rem;
        text-align: center;
        margin-bottom: 15px;
        font-weight: 600;
    }

    .yandex-map {
        width: 100%;
        height: calc(75vh - 140px);
        border-radius: 15px;
        overflow: hidden;
        border: 2px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 15px;
    }

    .location-btn {
        width: 100%;
        padding: 12px;
        background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        border: none;
        border-radius: 10px;
        color: #fff;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        transition: transform 0.3s, box-shadow 0.3s;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .location-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
    }

    .location-btn:active {
        transform: translateY(0);
    }

    .selected-address {
        background: rgba(52, 152, 219, 0.1);
        border: 1px solid rgba(52, 152, 219, 0.3);
        border-radius: 10px;
        padding: 12px 15px;
        color: #2980b9;
        font-size: 0.95rem;
        font-weight: 500;
        text-align: center;
        margin-bottom: 15px;
        min-height: 20px;
        word-wrap: break-word;
    }

    .selected-address:empty {
        display: none;
    }

    .map-phone {
        color: #2d3436;
        font-size: 1.2rem;
        text-align: center;
        margin: 0;
    }

    .map-phone a {
        color: #2d3436;
        text-decoration: none;
        font-weight: bold;
    }

    .map-phone a:hover {
        text-decoration: underline;
    }

    .main-wrapper .container {
        margin-left: 50%;
        width: 50%;
        max-width: 100%;
        flex: 1;
    }

    /* Скрываем мобильную карту на ПК */
    .mobile-map-block {
        display: none;
    }
}

header {
    text-align: center;
    padding: 15px 0;
    flex-shrink: 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: #2d3436;
    text-align: center;
}

.address {
    color: #333;
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
}

.header-phone {
    color: #2d3436;
    font-size: 2rem;
    font-weight: bold;
    margin: 5px 0 0 0;
}

.subtitle-block {
    flex-shrink: 0;
    padding: 10px 15px;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
    text-align: left;
    margin: 0;
}

.date-header {
    margin-bottom: 10px;
}

.date-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.booking-form {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
}

.price-display {
    background: linear-gradient(135deg, rgba(45, 52, 54, 0.08) 0%, rgba(60, 70, 72, 0.08) 100%);
    border: 2px solid rgba(45, 52, 54, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.price-label {
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
}

.price-value {
    color: #2d3436;
    font-size: 1.5rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .price-display {
        flex-direction: column;
        text-align: center;
    }
    
    .price-value {
        font-size: 1.3rem;
    }
}

.booking-form::-webkit-scrollbar {
    width: 6px;
}

.booking-form::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.booking-form::-webkit-scrollbar-thumb {
    background: rgba(45, 52, 54, 0.5);
    border-radius: 3px;
}

.form-section {
    margin-bottom: 15px;
}

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

.form-section h2 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2d3436;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
    min-width: 20px;
    min-height: 20px;
}

.checkbox-label span {
    color: #333;
    font-size: 0.95rem;
    font-weight: bold;
    flex: 1;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    background: #fff;
    color: #333;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input[type="date"] {
    padding: 12px 15px;
    font-size: 1rem;
    cursor: pointer;
    min-height: 45px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.date-section input[type="date"] {
    padding: 14px 18px;
    font-size: 1.05rem;
    cursor: pointer;
    min-height: 50px;
    background: #ffffff;
    border-color: rgba(45, 52, 54, 0.5);
    color: #333;
    border-radius: 15px;
}

.date-section input[type="date"]:focus {
    background: #ffffff;
    border-color: #2d3436;
    box-shadow: 0 0 15px rgba(45, 52, 54, 0.3);
}

.date-section input[type="date"]::-webkit-calendar-picker-indicator {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2d3436;
}

.form-group input::placeholder {
    color: #999;
}

.form-group select option {
    background: #fff;
    color: #333;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
}

.time-slots::-webkit-scrollbar {
    width: 6px;
}

.time-slots::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.time-slots::-webkit-scrollbar-thumb {
    background: rgba(45, 52, 54, 0.5);
    border-radius: 3px;
}

.time-slot {
    padding: 10px 8px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
    color: #333;
}

.time-slot:hover {
    border-color: #2d3436;
    background: rgba(45, 52, 54, 0.1);
}

.time-slot.selected {
    border-color: #2d3436;
    background: #2d3436;
    color: #fff;
}

.time-slot.booked {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

.info-text {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

.info-text.no-slots {
    color: #e74c3c;
    font-style: normal;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    padding: 20px 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
    flex-shrink: 0;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(45, 52, 54, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.success-message,
.error-message {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.success-message h2 {
    color: #2ecc71;
    margin-bottom: 15px;
}

.error-message h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.success-message p,
.error-message p {
    color: #666;
    margin-bottom: 20px;
}

.cancel-section {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 10px;
    padding: 15px 20px;
    margin: 20px 0;
}

.cancel-section p {
    margin: 0 0 15px 0;
    color: #c0392b;
    font-weight: 500;
}

.cancel-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #999;
}

/* Адаптивность для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 15px;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .booking-form {
        padding: 25px;
    }
    
    .existing-booking {
        padding: 20px;
    }
}

/* Адаптивность для мобильных устройств - с прокруткой */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .container {
        max-width: 100%;
        padding: 10px;
        max-height: none;
        overflow: visible;
        display: block;
    }

    /* Скрываем боковую панель с картой на мобильных */
    .map-sidebar {
        display: none;
    }

    header {
        padding: 25px 0;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .address {
        font-size: 0.95rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .booking-form {
        padding: 20px;
        border-radius: 15px;
        overflow: visible;
    }

    .form-section {
        margin-bottom: 20px;
    }

    .form-section h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-group input,
    .form-group select {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .date-section input[type="date"] {
        padding: 16px 20px;
        font-size: 1.1rem;
        min-height: 55px;
    }

    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 8px;
        max-height: none;
        overflow: visible;
    }

    .time-slot {
        padding: 10px;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 14px;
        font-size: 1.1rem;
    }

    .success-message,
    .error-message {
        padding: 30px 20px;
    }

    /* Мобильная карта */
    .mobile-map-block {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(10px);
        border-radius: 15px;
        padding: 20px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin-bottom: 20px;
    }

    .mobile-map-title {
        font-size: 1.2rem;
        color: #2d3436;
        margin-bottom: 10px;
        text-align: center;
    }

    .mobile-map-address {
        color: #555;
        font-size: 1rem;
        text-align: center;
        margin-bottom: 15px;
    }

    .yandex-map-mobile {
        width: 100%;
        height: 300px;
        border-radius: 12px;
        overflow: hidden;
        border: 2px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 15px;
    }

    .location-btn-mobile {
        width: 100%;
        padding: 12px;
        background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        border: none;
        border-radius: 10px;
        color: #fff;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        transition: transform 0.3s, box-shadow 0.3s;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .location-btn-mobile:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
    }

    .location-btn-mobile:active {
        transform: translateY(0);
    }

    .selected-address-mobile {
        background: rgba(52, 152, 219, 0.1);
        border: 1px solid rgba(52, 152, 219, 0.3);
        border-radius: 10px;
        padding: 12px 15px;
        color: #2980b9;
        font-size: 0.95rem;
        font-weight: 500;
        text-align: center;
        margin-bottom: 15px;
        min-height: 20px;
        word-wrap: break-word;
    }

    .selected-address-mobile:empty {
        display: none;
    }

    .mobile-map-phone {
        color: #2d3436;
        font-size: 1.1rem;
        text-align: center;
        margin: 0;
    }

    .mobile-map-phone a {
        color: #2d3436;
        text-decoration: none;
        font-weight: bold;
    }

    .mobile-map-phone a:hover {
        text-decoration: underline;
    }
}

/* Адаптивность для маленьких экранов */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .address {
        font-size: 0.85rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .booking-form {
        padding: 15px;
        border-radius: 12px;
    }

    .form-section h2 {
        font-size: 1rem;
    }

    .date-section input[type="date"] {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 50px;
    }

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

    .time-slot {
        padding: 8px 5px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 12px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .success-message h2,
    .error-message h2 {
        font-size: 1.2rem;
    }

    .success-message p,
    .error-message p {
        font-size: 0.95rem;
    }

    footer {
        padding: 20px 0;
        font-size: 0.85rem;
    }
    
    /* Адаптивность для существующей записи */
    .existing-booking {
        padding: 15px 10px;
    }
    
    .existing-booking h2 {
        font-size: 1.1rem;
    }
    
    .booking-item {
        padding: 10px;
    }
    
    .booking-item-info p {
        font-size: 0.85rem;
    }
    
    .booking-item-actions button {
        padding: 9px;
        font-size: 0.8rem;
    }
    
    /* Адаптивность для модального окна */
    .modal-content {
        padding: 15px;
        max-height: 95vh;
    }
    
    .modal-content h3 {
        font-size: 1rem;
    }
    
    .modal-content .form-group input[type="date"] {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Улучшение для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .time-slot {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .form-group input,
    .form-group select,
    .submit-btn {
        min-height: 44px;
    }
}

/* Стили для существующей записи */
.existing-booking {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.existing-booking::-webkit-scrollbar {
    width: 6px;
}

.existing-booking::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.existing-booking::-webkit-scrollbar-thumb {
    background: rgba(45, 52, 54, 0.5);
    border-radius: 3px;
}

.existing-booking h2 {
    color: #2d3436;
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
}

.bookings-list {
    margin-bottom: 20px;
}

.booking-item {
    background: rgba(45, 52, 54, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.booking-item:last-child {
    margin-bottom: 0;
}

.booking-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.booking-item-header h4 {
    color: #2d3436;
    font-size: 1rem;
    margin: 0;
}

.booking-item-info p {
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95rem;
}

.booking-item-info p:last-child {
    margin-bottom: 0;
}

.booking-item-info strong {
    color: #2d3436;
}

.booking-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.booking-item-actions button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.booking-item-actions .change-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
}

.booking-item-actions .cancel-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.booking-item-actions .change-btn:hover,
.booking-item-actions .cancel-btn:hover {
    transform: translateY(-2px);
}

.booking-item-actions .change-btn:hover {
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

.booking-item-actions .cancel-btn:hover {
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

.booking-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.max-bookings-message {
    color: #e74c3c;
    font-weight: 500;
    text-align: center;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
}

.change-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.change-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 25px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #2d3436;
    font-size: 1.3rem;
    margin-bottom: 10px;
    text-align: center;
}

.modal-info {
    color: #666;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-group input[type="date"] {
    padding: 14px 18px;
    font-size: 1.05rem;
    cursor: pointer;
    min-height: 50px;
    background: #ffffff;
    border: 2px solid rgba(45, 52, 54, 0.5);
    border-radius: 15px;
    color: #333;
    width: 100%;
    display: block;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.modal-content .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.modal-content .form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.modal-content .form-group input[type="date"]:focus {
    outline: none;
    border-color: #2d3436;
    box-shadow: 0 0 15px rgba(45, 52, 54, 0.3);
}

.modal-content .time-slots {
    max-height: 120px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        border-radius: 15px;
    }

    .modal-content h3 {
        font-size: 1.1rem;
    }

    .booking-actions {
        flex-direction: column;
    }
    
    /* Адаптивность для существующей записи */
    .existing-booking {
        padding: 20px 15px;
    }
    
    .existing-booking h2 {
        font-size: 1.2rem;
    }
    
    .booking-item {
        padding: 12px;
    }
    
    .booking-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .booking-item-info p {
        font-size: 0.9rem;
    }
    
    .booking-item-actions button {
        padding: 10px;
        font-size: 0.85rem;
    }
}
