/* ============================
📱 МОБИЛЬНАЯ АДАПТАЦИЯ
============================ */
@media (max-width: 1100px) {

    .nav-links {
        display: none;
    }

    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
  }

  /* --- ОБЩИЕ ПРАВИЛА --- */
  body {
      overflow-x: hidden;
      background-color: #330066;
  }

  .container {
        width: 100%;
        max-width: 100%;
        padding: 32px 16px;
        margin: 0 auto;
        box-sizing: border-box;
    }

  /* Заголовки и текст */
  section h2 {
      font-size: 22px;
      margin-bottom: 18px;
  }

  section p {
        text-align: left;
        text-indent: 0;
        font-size: 15px;
        line-height: 1.45;
        opacity: 0.95;
        margin-bottom: 16px;
        opacity: 0.95;
  }

  /* Картинки */
  section img {
        max-width: 95%;
        margin: 20px auto;
        box-shadow: none;
    }

  .hero-image img {
        max-width: 100%;
        border-radius: 14px;
        margin: 15px auto;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    header h1 {
        font-size: clamp(26px, 4.5vw, 32px);
    }

  /* --- НАВБАР --- */
  .navbar {
      padding: 14px 18px;
      border-radius: 14px;
      position: sticky;
      top: 0;
      z-index: 1000;
  }

  .burger {
        position: absolute;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        z-index: 10060;

        width: 32px;
        height: 22px;
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
  }

  .burger span {
        height: 3px;
        width: 100%;
        background: #330066;
        border-radius: 2px;
        transition: 0.3s ease;
        display: block !important;
        opacity: 1 !important;
  }

  .burger.active span {
        background: #330066;
    }

  .burger.active span:nth-child(1) {
      transform: translateY(9px) rotate(45deg);
  }
  .burger.active span:nth-child(2) {
      opacity: 0;
  }
  .burger.active span:nth-child(3) {
      transform: translateY(-9px) rotate(-45deg);
  }

    .mobile-menu {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 900;
    }

    .mobile-menu.open {
        right: 0;
    }

  /* --- СЕКЦИИ --- */
  section {
        padding: 0;
        margin: 32px auto;
        max-width: 100%;
        box-sizing: border-box;
    }

  /* --- СПИСКИ --- */
  section ul {
      padding-left: 18px;
      margin-bottom: 16px;
  }

  section li {
      font-size: 14px;
      margin-bottom: 6px;
  }

  /* --- ГЛАВНАЯ КНОПКА --- */
  .cta-btn,
  button,
  .review-btn,
  .modal-content button {
      width: 100%;
      padding: 14px;
      font-size: 18px;
      border-radius: 14px;

      background: linear-gradient(135deg,
          #D4AF37 0%,
          #FFD700 50%,
          #B8860B 100%
      );
  }

  /* --- HERO --- */
  .hero-image {
      margin: 20px 0 30px;
  }

  .hero h1 {
        font-size: clamp(26px, 5vw, 32px);
        line-height: 1.2;
    }

  .hero p {
        font-size: 16px;
    }

  /* --- ABOUT --- */
  #about p:nth-of-type(1) {
      font-weight: 500;
      opacity: 1;
  }

  #about p strong {
      font-size: 16px;
      display: block;
      text-align: center;
      margin: 12px 0;
  }

  /* --- COURSES --- */
  #courses .subjects {
      padding-left: 16px;
  }

  #courses .subjects li {
      font-size: 15px;
      margin-bottom: 7px;
  }

  /* --- TEACHERS --- */
  .teachers-section {
      margin-top: 20px;
      padding: 10px;
  }

  .teachers-grid {
      display: flex;
      flex-direction: column;
      gap: 20px;
  }

  .teacher-photo-wrap {
        max-width: 100%;   /* ← КЛЮЧЕВАЯ СТРОКА */
        margin: 0 auto;     /* центрируем */
        aspect-ratio: 4 / 5;
        border-radius: 12px;
        overflow: hidden;
        background: #eee;
    }

    .teacher-photo {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 15%;
        display: block;
    }

  .teacher-card {
        width: 100%;
        max-width: 340px;   /* ← ВАЖНО */
        margin: 0 auto;     /* центр */
        padding: 16px 18px;
        border-radius: 14px;
    }

  .review-card {
        padding: 16px 18px;
        font-size: 14px;
        line-height: 1.35;
        border-radius: 12px;
        max-width: 100%;
        margin: 0;
    }

    .swiper-slide {
        display: flex;
        justify-content: center;
    }

    .reviews-swiper .swiper-slide {
        width: 85% !important;
        max-width: none !important;
        transform: none !important;
    }

  /* --- REVIEWS --- */
  #reviews {
      padding: 10px;
  }

  /* --- CONTACTS --- */
    #contacts .contact-list li a {
        display: block;
        padding: 14px 0;
        font-size: 16px;
    }

    #contacts .contact-list li {
        font-size: 16px;
    }



  /* --- MODAL --- */
  .modal-content {
      max-width: 90%;
      padding: 26px;
      border-radius: 20px;
  }

  .modal-content input,
  .modal-content textarea {
      font-size: 16px;
      padding: 14px 16px;
      border-radius: 12px;
  }

  .modal-content button {
      margin-top: 10px;
  }

    .back-top {
        display: block;
        text-align: center;
        margin-top: 30px;
        font-size: 16px;
        color: #330066;
    }

    section p, section li {
        font-weight: 400;
    }

    section p:not(:first-of-type) {
        opacity: 0.85;
    }

    .nav-links.open a {
        padding: 12px 0;
        font-size: 18px;
    }

    /* КНОПКА "НАВЕРХ" — мобильная версия */
    .back-to-top {
        bottom: 16px;
        right: 16px;

        width: 48px;
        height: 48px;

        background: linear-gradient(135deg,
        #D4AF37 0%,
        #FFD700 50%,
        #B8860B 100%
        );

        border-radius: 50%;
    }

    /* стрелка внутри */
    .arrow-up {
        width: 26px;
        height: 26px;
    }

    .swiper-button-next,
    .swiper-button-prev {
        transform: scale(0.8);
    }

    /* ТЁМНЫЙ ФОН ПРИ ОТКРЫТОМ МЕНЮ */
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: .3s ease;
        z-index: 9998;
    }

    /* ВЫЕЗЖАЮЩЕЕ МЕНЮ */
    /* затемнение фона */
    .mobile-menu-overlay{
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        opacity: 0;
        pointer-events: none;
        transition: .25s ease;
        z-index: 9998;
    }
    .mobile-menu-overlay.active{
        opacity: 1;
        pointer-events: all;
    }

    /* выезжающее меню — через transform (так НЕ “торчит” сбоку) */
    .mobile-menu{
        position: fixed;
        top: 0;
        right: 0;

        width: min(320px, 86vw);
        height: 100dvh;

        background: #fff;
        box-shadow: -4px 0 18px rgba(0,0,0,0.12);

        padding: 70px 22px 24px; /* сверху место под крестик */
        display: flex;
        flex-direction: column;
        gap: 22px;

        transform: translateX(110%);
        transition: transform .3s ease;

        z-index: 9999;
    }
    .mobile-menu.open{
        transform: translateX(0);
    }

    /* ссылки внутри меню */
    .mobile-menu a{
        font-size: 18px;
        color: #330066;
        text-decoration: none;   /* чтобы не было “синих подчёркнутых” */
        font-weight: 500;
    }

    /* активный пункт в мобильном меню */
    .mobile-menu a.active {
        color: #D4AF37;          /* золото */
        font-weight: 700;
    }

    /* крестик ВНУТРИ меню, поэтому position:absolute */
    .menu-close{
        position: absolute;
        top: 16px;
        right: 16px;

        width: 44px;
        height: 44px;

        border: none;
        background: transparent;
        color: #330066;
        font-size: 34px;
        line-height: 1;
        cursor: pointer;

        display: grid;
        place-items: center;
    }

    /* запрет прокрутки страницы */
    body.no-scroll{
        overflow: hidden;
    }

    .about-inner {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .about-image {
        max-width: 100%;
        margin: 12px auto 0;
    }

    .about-image img {
        width: 100%;           /* ← ВОТ ЭТО и есть «в 2 раза меньше» */
        height: auto;

        max-width: 380px;
        max-height: 420px;

        object-fit: cover;
        object-position: center 30%;

        display: block;
        margin: 0 auto;  /* центрируем и убираем лишний воздух */
        border-radius: 18px;
    }

    .about-text {
        margin-bottom: 12px;
    }

    .about-section p {
        margin-bottom: 14px;
    }

    /* ===== ABOUT: убираем лишний воздух на мобилке ===== */

    #about p:last-of-type {
        margin-bottom: 8px;   /* было слишком много */
    }

    #about p strong {
        margin: 8px 0 0;
    }

    #about img {
        margin-top: 8px;      /* ← КЛЮЧ */
        margin-bottom: 0;
    }

    /* Иконки в мобильном меню */
    .mobile-menu .nav-icon {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        flex-shrink: 0;
        display: inline-block !important;
    }

    /* Ссылки меню — выравниваем иконку + текст */
    .mobile-menu a {
        display: flex;
        align-items: center;
        gap: 10px;
    }

}