#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Цвет фона экрана загрузки */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Выше всех элементов на сайте */
    transition: opacity 0.5s ease;
}

.no-preloader #preloader {
    display: none !important;
}

.loader {
    text-align: center;
}

.loader img {
    width: 100px; /* Размер вашего лого */
    margin-bottom: 20px;
}

/* Простая анимация крутилки (опционально) */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Класс для скрытия */
.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    margin: 0 auto;
}

.header {
    position: relative;
    background-image: url('images/header-bg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-align: center;
    /* Убираем justify-content: space-between, чтобы управлять отступами через margin */
}

.header-text {
    z-index: 1;
    margin: auto; /* Это магическое свойство выровняет текст ровно по центру */
    padding-top: 0; /* Обнуляем старый паддинг, он больше не нужен */
    padding-top: 50px;
}


.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 0;
}



.header-text h1 {
    margin: 0;
    font-size: 60px;
}

.header-text h1:nth-of-type(2) {
    font-family: 'Georgia', serif;
}


.buttons {
    margin-bottom: 20px;
    z-index: 1;
    position: relative;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;    
    gap: 15px;
    margin-bottom: 20px;
    z-index: 1;
    position: relative;
    width: 100%;
    overflow-x: auto;    
    scrollbar-width: none;  
    -webkit-overflow-scrolling: touch; 
}

.buttons::-webkit-scrollbar {
    display: none;
}

.buttons a {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 8px;
    min-width: 140px;
    text-align: center;
    font-size: 27px;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    flex-shrink: 0;      
    white-space: nowrap;   
}

.buttons a:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.buttons a[href="https://vkusnobystro.by/"] {
    background-color: #FF7F50;
}

.buttons a.active {
    background-color: #27E4F5;
    color: black;
    font-weight: bold;
}


.content {
    padding: 60px 40px;
}

.content p {
    margin-bottom: 25px;
    font-size: 19px;
    color: black;
}

.map, .gallery-image {
    width: 100%;
    max-width: 800px;
    margin: 30px auto 0;
}

.map iframe {
    width: 100%;
    height: 400px;
    border: none;
}

.gallery-image img {
    width: 100%;
    height: auto;
    border-radius: 3%;
    object-fit: contain;
}


@media (max-width: 768px) {
    .header { height: 240px; }
    .header-text h1 { font-size: 28px; }
    .buttons a { font-size: 18px; min-width: 100px; padding: 8px 15px; }
    .content { padding: 40px 20px; }
}


@media (max-width: 480px) {
    .header {
        /* Высота 180-200px позволит тексту быть крупным и не тесниться */
        height: 190px !important; 
    }

    .header-text {
        margin: auto; /* Оставляем центрирование */
        padding-top: 0;
        width: 90%;   /* Чтобы текст не упирался в края экрана */
    }

    .header-text h1 {
        /* Увеличиваем размер слова "Столовая" */
        font-size: 28px; 
        line-height: 1.1;
        margin-bottom: 5px;
    }

    .header-text h1:nth-of-type(2) {
        /* Делаем название "Вкусно и быстро" еще крупнее и заметнее */
        font-size: 32px; 
        line-height: 1.1;
    }

    .buttons {
        justify-content: center;
        gap: 6px;    
        margin-bottom: 12px;
    }

    .buttons a {
        font-size: 15px;
        padding: 8px 12px;
        min-width: auto;
    }
}