/* ===== TABLET (481-899px) ===== */
@media (min-width: 481px) and (max-width: 899px) {
  body { background: var(--gray-200); }
  .app { max-width: 600px; border-left: 1px solid var(--gray-300); border-right: 1px solid var(--gray-300); }
  .auth-screen { max-width: 500px; border-left: 1px solid var(--gray-300); border-right: 1px solid var(--gray-300); }
  .event-card { margin: 0 16px 12px; }
}

/* ===== DESKTOP (900px+) ===== */
@media (min-width: 900px) {
  body { overflow: auto; background: var(--bg-page); }
  .desktop-only { display: flex; }
  .mobile-only { display: none !important; }
  
  /* --- Auth screen: centered card, wider --- */
  .auth-screen {
    max-width: 480px;
    height: auto;
    min-height: 100vh;
    margin: 0 auto;
    box-shadow: none;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
  }
  .auth-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 32px;
    margin: 0 20px;
  }

  /* --- App shell: full width with sidebar --- */
  .app {
    max-width: 100%;
    height: 100vh;
    flex-direction: row;
    overflow: hidden;
    box-shadow: none;
  }
  .app.visible { display: flex; }

  /* --- Desktop header bar --- */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 500;
    padding: 8px 32px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    gap: 16px;
  }
  .header-search {
    max-width: 480px;
  }
  .header-city-selector {
    padding: 6px 14px;
    font-size: 14px;
  }

  /* --- Sidebar navigation (replaces bottom tabs) --- */
  .bottom-tabs {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 220px;
    height: auto;
    flex-direction: column;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    box-shadow: none;
    padding: 16px 0;
    z-index: 400;
    gap: 2px;
    align-items: stretch;
    justify-content: flex-start;
    padding-bottom: 0;
  }
  .tab-btn {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    color: var(--gray-600);
  }
  .tab-btn svg { width: 22px; height: 22px; transform: none !important; }
  .tab-btn.active { color: var(--orange-accent); background: var(--orange-accent-light); }
  .tab-btn.active svg { transform: none !important; }
  .tab-btn::after { display: none !important; }
  .tab-btn:hover { background: var(--gray-50); }
  .tab-btn span { font-size: 14px; }

  /* Hide elevated create button circle on desktop */
  .tab-btn.tab-create .tab-create-circle {
    width: 28px;
    height: 28px;
    margin-top: 0;
    box-shadow: none;
    border-radius: 8px;
  }
  .tab-btn.tab-create .tab-create-circle svg {
    width: 18px;
    height: 18px;
  }
  .tab-btn.tab-create span.tab-label { margin-top: 0; }

  /* --- Main content area offset by sidebar --- */
  .tab-content {
    margin-left: 220px;
    margin-top: 56px;
    flex: 1;
    height: calc(100vh - 56px);
    overflow-y: auto;
  }

  /* --- Hero section --- */
  .hero {
    padding: 32px 40px 28px;
    border-radius: 0;
  }
  .hero-title { font-size: 28px; }
  .hero-desc { font-size: 15px; }

  /* --- Stats bar --- */
  .stats-bar {
    padding: 16px 40px;
    gap: 16px;
  }
  .stat-item {
    padding: 14px 8px;
    border-radius: var(--radius-lg);
  }
  .stat-number { font-size: 22px; }
  .stat-label { font-size: 12px; }

  /* --- Section titles --- */
  .section-title {
    font-size: 20px;
    padding: 20px 40px 10px;
  }
  .section-subtitle {
    padding: 0 40px 12px;
    font-size: 14px;
  }

  /* --- Chips --- */
  .chips-scroll {
    padding: 12px 40px;
    flex-wrap: wrap;
  }

  /* --- Event cards in grid --- */
  #home-events-list,
  #search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding: 0 40px 20px;
  }
  #home-events-list .event-card,
  #search-results .event-card {
    margin: 0;
  }
  .event-card {
    margin: 0 40px 12px;
  }

  /* --- Mini cards horizontal scroll -> grid on desktop --- */
  .events-hscroll {
    padding: 0 40px 16px;
    flex-wrap: wrap;
    gap: 16px;
  }
  .event-card-mini {
    min-width: 260px;
    max-width: 340px;
    flex: 1;
  }

  /* --- Search bar --- */
  .search-bar {
    margin: 0 40px;
    max-width: 600px;
  }

  /* --- Banner carousel --- */
  .banner-carousel {
    margin: 16px 40px;
  }
  .banner-slide {
    height: 160px;
    padding: 32px;
  }
  .banner-title { font-size: 20px; }
  .banner-text { font-size: 15px; }

  /* --- Create form --- */
  .create-form {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 40px;
  }

  /* --- Page overlays as centered panels on desktop --- */
  .page-overlay {
    left: 220px;
    background: rgba(0,0,0,0);
    cursor: pointer;
    transition: background 0.3s ease;
  }
  .page-overlay.open {
    background: rgba(0,0,0,0.35);
  }
  .page-overlay .page-container {
    max-width: 700px;
    width: 700px;
    right: auto;
    left: 50%;
    transform: translateX(100%);
    border-radius: 0;
    box-shadow: -4px 0 40px rgba(0,0,0,0.12);
    cursor: default;
  }
  .page-overlay.open .page-container {
    transform: translateX(-50%);
  }

  /* --- Profile tab --- */
  .profile-header {
    max-width: 700px;
    margin: 0 auto;
    border-radius: 0 0 16px 16px;
  }
  .profile-stats {
    max-width: 700px;
    margin: 0 auto;
  }
  .profile-actions {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
  }
  .profile-registrations {
    max-width: 700px;
    margin: 0 auto;
  }

  /* --- Favorites grid --- */
  #favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding: 0 40px 20px;
  }
  #favorites-list .event-card {
    margin: 0;
  }

  /* --- City dropdown on desktop --- */
  .city-dropdown {
    left: auto;
    right: auto;
    max-width: 300px;
  }

  /* --- Footer --- */
  .app-footer {
    max-width: 640px;
    margin: 0 auto;
  }

  /* --- Form inputs slightly bigger on desktop --- */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px 16px;
    font-size: 15px;
  }

  /* --- Verification banner --- */
  .verification-banner {
    max-width: 640px;
    margin: 12px auto;
  }

  /* --- Notification/toast --- */
  .toast {
    left: 240px;
    right: 20px;
    max-width: 400px;
  }

  /* --- Map section desktop --- */
  #search-map-container {
    margin: 0 40px 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  /* --- Chat section in event detail --- */
  .chat-messages-list {
    max-height: 500px;
  }

  /* --- Settings overlay centered --- */
  .modal-overlay .modal {
    max-width: 500px;
  }

  /* --- Scrollbar styling for desktop --- */
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

  /* --- Tab labels always visible on desktop sidebar --- */
  .tab-btn .tab-label {
    display: inline;
    font-size: 14px;
  }

  /* --- Header flex with logo on desktop --- */
  .header {
    gap: 20px;
  }
  .header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 8px;
  }
  .header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
  }
  .header-search {
    flex: 1;
    max-width: 500px;
  }
}
/* Banner carousel */
.banner-carousel { margin: 12px 16px; position: relative; overflow: hidden; border-radius: 14px; }
.banner-track { display: flex; transition: transform 0.4s ease; }
.banner-slide { min-width: 100%; height: 120px; border-radius: 14px; padding: 20px; display: flex; align-items: center; color: #fff; }
.banner-content { position: relative; z-index: 1; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.banner-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.banner-text { font-size: 13px; opacity: 0.9; }
.banner-slide-ad { padding: 0; cursor: default; }
.banner-slide-ad .banner-content { display: none; }
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.banner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-300); cursor: pointer; transition: all 0.2s; }
.banner-dot.active { background: var(--orange-accent); width: 20px; border-radius: 4px; }


/* ===== YANDEX SUGGEST OVERRIDES ===== */
.ymaps-2-1-79-suggest,
.ymaps-2-1-79-suggest-list,
[class*="ymaps"][class*="suggest"] {
  z-index: 10000 !important;
}
