/* ================= BREAKPOINTS (точные с psb-academy.ru) ================= */

/* === 1399px: сужаем padding, footer чуть уже === */
@media (max-width: 1399px) {
    .container { padding-left: 20px; padding-right: 20px; }
    .footer { padding-left: 20px; padding-right: 20px; padding-bottom: 20px; }
    .footer-card { grid-template-columns: minmax(0, 1fr) minmax(0, 352px); }
}

/* === 1219px: планшет — навигация скрывается, одна колонка === */
@media (max-width: 1219px) {
    body { padding-top: 66px; }

    /* Container */
    .container { max-width: 768px; }

    /* Header — мобильная адаптация */
    .header { overflow-x: hidden; }
    .header-inner {
        height: 66px;
        padding: 0 20px;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
    }
    .header-right-group {
        gap: 8px;
        min-width: 0;
        justify-content: flex-end;
    }
    .nav { display: none; }
    .btn-login { display: none !important; }
    .btn-burger { display: inline-flex !important; width: 42px; height: 42px; flex-shrink: 0; }
    .btn-eye { width: 42px; height: 42px; flex-shrink: 0; }
    .logo { width: 92px; height: 25px; flex-shrink: 0; }

    /* Footer — одна колонка */
    .footer-card {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        border-radius: 12px;
    }
    .footer-content { order: 2; gap: 0; padding: 0; }
    .footer-navigations {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
        padding: 18px;
        border-bottom: 1px solid var(--border-light);
    }
    .footer-logo { display: none !important; }
    .footer-bottom { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .footer-socials { order: 2; padding: 18px; }
    .footer-legal {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
        order: 1;
        padding: 18px;
        border-bottom: 1px solid var(--border-light);
    }
    .footer-feedback {
        order: 1;
        gap: 15px;
        padding: 18px;
        border-left: none;
        border-bottom: 1px solid var(--border-light);
    }

    /* Шрифты на планшете */
    .footer-link { font-size: 18px; }
    .footer-legal-link { font-size: 15px; }
    .footer-text { font-size: 16px; }
    .soc-icon { width: 42px; height: 42px; }
    .soc-icon svg { width: 20px; height: 20px; }
    .footer-btn { height: 42px; }

    /* Calendar */
    .calendar-header h1 { font-size: 28px; }
    /* Скрываем «Записаться» в ячейках на планшете */
    .day-cell.has-event .btn-signup { display: none !important; }
}

/* === 768px: мобильный — карточки событий === */
@media screen and (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 20px;
    }
    .calendar-header h1 { font-size: 24px; margin-bottom: 4px; }

    /* Calendar Controls Mobile — компактная строка */
    .calendar-controls {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: space-between;
    }
    .view-toggle { order: 0; height: 40px; }
    .month-nav {
        order: 1;
        flex: 1;
        min-width: 0;
        justify-content: center;
        margin: 0 8px;
    }
    .current-month { font-size: 16px; min-width: auto; font-weight: 600; }
    .btn-today { order: 2; padding: 0 18px; font-size: 13px; height: 40px; }

    /* Hide tooltip on mobile */
    .event-tooltip { display: none !important; }

    /* Календарь — сетка 7 колонок, квадратные ячейки */
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 8px;
    }
    .day-cell {
        aspect-ratio: 1;
        min-height: 0;
        padding: 12px;
    }
    /* Без текста на картинках — только дата и изображение */
    .day-cell.has-event .event-info { display: none !important; }
    .day-cell .event-title { font-size: 13px; }

    /* List View Mobile */
    .list-event-row { flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
    .list-event-date { min-width: auto; font-size: 13px; }
    .list-event-title { width: 100%; order: -1; font-size: 14px; }
    .list-event-category { min-width: auto; text-align: left; font-size: 11px; }
    .list-event-rating { font-size: 13px; }
    .list-btn-details { padding: 6px 12px; font-size: 11px; }
    .list-empty { padding: 40px 16px; font-size: 14px; }

    /* Event Modal Mobile — по центру, вертикальный layout */
    .modal-box {
        max-width: calc(100vw - 40px);
        max-height: 90vh;
        overflow: hidden;
    }
    .modal-body {
        flex-direction: column;
        padding: 20px 24px 28px !important;
        gap: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-left {
        width: 100%;
        order: -1;
    }
    .modal-img-container {
        width: 100%;
        height: 240px;
        border-radius: var(--box-radius);
        overflow: hidden;
    }
    .modal-img-container img { object-fit: cover; width: 100%; height: 100%; }
    .modal-top-row { flex-direction: column; gap: 10px; align-items: flex-start; }
    .modal-title { font-size: 20px; line-height: 1.3; }
    .rating-badge { font-size: 16px; padding: 6px 12px; }
    .date-tags { flex-direction: row; flex-wrap: wrap; }
    .modal-desc { font-size: 15px; margin-bottom: 20px; }
    .btn-modal-action { width: 100%; padding: 12px 20px; font-size: 15px; box-sizing: border-box; }
    /* На мобильном скрываем кнопку «Записаться» */
    .btn-modal-action { display: none !important; }
}

/* === 767px: мобильный контейнер === */
@media (max-width: 767px) {
    .container { max-width: 540px; padding-left: 24px; padding-right: 24px; margin-top: 24px; }
    .header-inner {
        padding-left: 16px;
        padding-right: 16px;
        gap: 10px;
    }
    .header-right-group { gap: 6px; }
    .logo { width: 80px; height: 22px; }
    .btn-burger, .btn-eye { width: 40px; height: 40px; }
    .footer { padding-left: 18px; padding-right: 18px; }
}

/* === 540px: маленький мобильный === */
@media (max-width: 540px) {
    .container { padding-left: 20px; padding-right: 20px; }
    .modal-box { max-width: calc(100vw - 32px); max-height: 88vh; }
    .modal-body { padding: 16px 20px 24px !important; gap: 16px; }
    .modal-img-container { height: 220px; }
    .modal-title { font-size: 18px; }
    .day-cell .event-title { font-size: 12px; }

    .header-inner {
        padding-left: 14px;
        padding-right: 14px;
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
    }
    .logo { width: 72px; height: 20px; }
    .btn-burger, .btn-eye { width: 38px; height: 38px; }
    .header-right-group { gap: 6px; }

    .footer { padding-bottom: 0; }
    .footer-card {
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
        margin: 0 -18px;
    }
}

/* === 374px: очень маленький экран === */
@media (max-width: 374px) {
    .container { padding-left: 16px; padding-right: 16px; }
    .header-inner {
        padding-left: 12px;
        padding-right: 12px;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 6px;
    }
    .logo { width: 64px; height: 18px; }
    .btn-burger, .btn-eye { width: 36px; height: 36px; }
    .header-right-group { gap: 4px; }

    .footer { padding-left: 12px; padding-right: 12px; }
    .footer-card { margin: 0 -12px; }
}
