/* ========================================
   MOBILE.CSS - Адаптивність для мобільних
   ======================================== */

/* ========================================
   TABLET (768px - 1024px)
   ======================================== */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 220px 1fr;
  }
}

/* ========================================
   MOBILE (до 860px)
   ======================================== */

@media (max-width: 860px) {
  /* === LAYOUT === */
  .layout {
    grid-template-columns: 1fr;
  }
  
  aside {
    position: static;
    height: auto;
  }
  
  .aside-inner {
    height: auto;
  }
  
  main {
    padding: 24px;
  }
  
  /* Зменшуємо відступи зверху після меню */
  .mobile-header {
    margin-bottom: 8px !important;
  }

  /* Меню-кнопка (nav-toggle) — менше "повітря" */
  .nav-toggle {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
  }

  /* Хлібні крихти — було дуже багато padding */
  .breadcrumbs {
    margin-top: 4px;
    margin-bottom: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  /* Заголовок секції — стандартний margin завеликий */
  .section h1 {
     margin-top: 4px;
  }
  
   main {
    padding-top: 8px !important;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 16px;
  }

  .breadcrumbs {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
  }

  .section h1 {
    margin-top: 6px !important;
  }
  
  /* === МОБІЛЬНИЙ ХЕДЕР === */
  .mobile-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  
  .logo-link-mobile {
    display: flex;
    align-items: center;
  }
  
  .logo-image-mobile,
  .logo-placeholder-mobile {
    height: 40px;
    width: auto;
    max-width: 120px;
    border-radius: 8px;
  }
  
  .logo-placeholder-mobile {
    display: none;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    align-items: center;
    justify-content: center;
    padding: 0 16px;
  }
  
  .logo-placeholder-mobile .logo-initial {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
  }
  
  .btn-mobile-contact {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
  }
  
  /* Ховаємо десктопні елементи */
  .brand,
  .cta {
    display: none;
  }
  
  /* === КНОПКА МЕНЮ === */
  .nav-toggle {
    display: block;
    width: calc(100% - 32px);
    margin: 12px 16px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
    transition: all 0.2s;
  }
  
  .nav-toggle::after {
    content: '▼';
    float: right;
    transition: transform 0.3s;
    font-size: 12px;
  }
  
  .nav-toggle.open::after {
    transform: rotate(180deg);
  }
  
  .nav-toggle:hover {
    background: var(--bg);
    box-shadow: var(--shadow);
  }
  
  /* === НАВІГАЦІЯ === */
   aside nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
  }
  
  aside nav.open {
    max-height: 600px;
    padding: 0 16px 16px;
  }
  
  .nav-link {
    padding: 10px 12px;
    font-size: 15px;
  }
  
  .nav-title {
    margin: 12px 0 8px;
    font-size: 11px;
  }
  
  /* === ПЕРЕКЛЮЧАТЕЛЬ ТЕМИ В МЕНЮ === */
  .theme-toggle-mobile {
    display: block;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  
  .theme-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
  }
  
  .theme-buttons .btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
  }
  
  .theme-buttons .btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  
  /* === HERO СЕКЦІЯ === */
  .hero {
    grid-template-columns: 1fr;
  }
  
  /* === СІТКИ === */
  .grid.cols-3 {
    grid-template-columns: 1fr 1fr;
  }
  
  /* === ФОРМИ === */
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  /* === GPT === */
  .gpt-detail .gpt-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .gpt-icon-large {
    margin: 0 auto;
  }
  
  .gpt-header-content h1 {
    font-size: 2rem;
  }
  
  .gpt-description {
    font-size: 1.1rem;
  }
  
  .gpt-meta {
    justify-content: center;
  }
  
  .gpt-footer {
    flex-direction: column;
  }
  
  .btn-large {
    width: 100%;
    text-align: center;
  }
  
  /* === ФІЛЬТРИ === */
  .filter-tag {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* ========================================
   EXTRA SMALL MOBILE (до 560px)
   ======================================== */

@media (max-width: 560px) {
  .grid.cols-3,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
  
  main {
    padding: 16px;
  }
  
  .section h1 {
    font-size: 26px;
  }
  
  .section h2 {
    font-size: 20px;
  }
}

/* ===== Компактні відступи на мобільному для шапки крафтів ===== */
@media (max-width: 860px) {

  /* Менше повітря між логотипом і "Меню" */
  .nav-toggle {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
  }

  /* Зменшуємо загальний верхній padding контенту */
  main {
    padding-top: 8px !important;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 16px;
  }

  /* Перша секція (де H1) — не 36px згори, а набагато менше */
  .section {
    margin-top: 12px !important;
  }

  .section:first-of-type {
    margin-top: 8px !important;
  }

  /* breadcrumbs між меню і H1 без зайвого повітря */
  .breadcrumbs {
    margin-top: 4px !important;
    margin-bottom: 30px !important;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 860px) {

  /* Нижче — якщо хочеш ще щільніше */
  .mobile-header .logo-link-mobile {
    margin: 0 !important;
  }

  .mobile-header .btn-mobile-contact {
    padding: 6px 10px !important;
  }

  aside {
    border-right: none !important;
  }

  .aside-inner {
    padding: 0 !important;
    gap: 0 !important;
  }
}

.logo-link-mobile .logo-text {
  font-size: 24px;
}

@media (max-width: 860px) {

    .logo-link-mobile {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .btn-mobile-contact {
        margin-left: auto; /* отправляет кнопку вправо */
    }
}

