/* Homepage only. Keep the existing desktop design above 992px. */
@media (max-width: 992px) {
  .p-header__inner { height: auto; min-height: 112px; top: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .p-brand img { height: 48px !important; max-width: 140px; object-fit: contain; }
  .p-actions { min-width: 0; gap: 8px; }
  .p-search { grid-row: 2; }
  .p-searchBox { min-height: 46px; box-shadow: none; }
  .p-searchBox input { min-width: 0; font-size: 16px; }
  .p-grid { grid-template-columns: minmax(0, 1fr); }
  .p-side, .p-main { min-width: 0; }
  .p-hero { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  html { scroll-padding-top: 130px; -webkit-text-size-adjust: 100%; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .p-header__inner { padding: 8px 12px; }
  .p-header #login-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .p-header #user-button { min-width: 44px; min-height: 44px; padding: 8px; font-size: 0; }
  .notification-wrapper { margin-right: 0; }
  .p-actions #notifBtn { width: 44px !important; height: 44px !important; }
  .notif-dropdown { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: 65vh; max-height: 65dvh; }
  #user-dropdown { max-width: calc(100vw - 24px); }
  .p-search .arama-sonuclari-kutusu { max-height: 55vh; max-height: 55dvh; }
  .p-page { padding: 12px; }
  .p-hero { padding: 18px; gap: 14px; margin-bottom: 14px; border-radius: 14px; }
  .p-hero-content { flex-basis: 100%; min-width: 0; }
  .p-hero h1 { font-size: 20px; line-height: 1.3; }
  .p-hero p { font-size: 13px; line-height: 1.6; }
  .p-hero__actions { width: 100%; gap: 8px; }
  .p-hero .p-btn { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 8px; font-size: 12px; text-align: center; }
  .story-section { margin-bottom: 14px; min-width: 0; }
  .story-list { gap: 12px; overscroll-behavior-x: contain; }
  .story-item { flex: 0 0 64px; min-width: 64px; }
  .story-circle { width: 60px; height: 60px; }

  /* Bring listings forward without removing the sidebar's useful content. */
  .p-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 0; }
  .p-side, .p-main { display: contents; }
  .p-grid .p-card { width: 100%; min-width: 0; padding: 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; }
  .home-categories { order: 1; }
  .home-featured { order: 2; }
  .home-latest { order: 3; }
  .home-liked { order: 4; }
  .home-news { order: 5; }
  .p-card__title { font-size: 16px; }
  .cat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .cat-btn, .cat-btn:hover { min-width: 0; min-height: 52px; padding: 10px; gap: 8px; background: #f8fafc; font-size: 12px; line-height: 1.4; }
  .cat-btn i { flex: 0 0 22px; color: #2563eb; }
  .cat-btn span { overflow-wrap: anywhere; }
  .p-sectionHead { flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 12px; }
  .p-sectionHead h2 { font-size: 16px; }
  .p-sectionHead a { display: inline-flex; align-items: center; min-height: 36px; }
  .vitrin { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ilan-karti { min-width: 0; height: auto; }
  .ilan-karti:hover { transform: none; }
  .ilan-karti-media { height: auto; aspect-ratio: 4 / 3; }
  .ilan-karti-media img { width: 100%; height: 100%; object-fit: cover; }
  .ilan-detay { min-width: 0; padding: 10px; gap: 8px; }
  .baslik-alani { min-width: 0; flex-wrap: wrap; margin: 0; }
  .baslik-alani h3 { flex-basis: 100%; min-width: 0; min-height: 36px; font-size: 13px; overflow-wrap: anywhere; }
  .ilan-karti .fiyat { font-size: 14px; overflow-wrap: anywhere; }
  .fiyat-alani { align-items: flex-start; }
  .ozet-alani { flex-wrap: wrap; gap: 4px 6px; padding-top: 8px; font-size: 11px; }
  .ozet-item { min-width: 0; overflow-wrap: anywhere; }
  .ozet-divider { flex-shrink: 0; }
  .latest-ad-info, .top-liked-info { min-width: 0; overflow-wrap: anywhere; }
  .latest-ad-item img { flex-shrink: 0; width: 88px; height: 66px; object-fit: cover; }
  .news-list { grid-template-columns: minmax(0, 1fr); }
  .news-feature { min-height: 260px; border-radius: 12px; display: flex; align-items: flex-end; }
  .news-feature-content { position: relative; padding: 16px; }
  .news-feature-title { font-size: 20px; overflow-wrap: anywhere; }
  .news-mini-title, .news-mini-summary { overflow-wrap: anywhere; }
  .empty-state { padding: 28px 12px; margin: 0; }
  .empty-state h3 { font-size: 18px; }
  .empty-state p { font-size: 14px; }

  .tab-bar { height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .tab-item { min-width: 0; min-height: 48px; gap: 4px; font-size: 10px; }
  .tab-item i { font-size: 19px; }
  .tab-item.add-btn { top: 0; }
  .tab-item.add-btn .add-icon { width: 30px; height: 30px; border-radius: 10px; }
  .tab-item.add-btn span { margin-top: 0; }
  .cookie-consent { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .cookie-consent__card { padding: 14px; max-height: 55vh; max-height: 55dvh; overflow-y: auto; }
  .cookie-consent__icon { display: none; }
  .cookie-consent__title { font-size: 16px; }
  .cookie-consent__actions { flex-direction: row; gap: 8px; margin-top: 12px; }
  footer { margin-top: 20px; padding: 24px 16px 12px; }
  .footer-content { gap: 20px; }
  .footer-section { margin: 0; }
  .footer-section p img, .footer-bottom img { height: 28px !important; }
  .footer-section.links a { display: inline-block; padding: 8px; }
  .story-content-wrapper { height: 100vh; height: 100dvh; max-width: 100%; border-radius: 0; }
}

@media (max-width: 359px) {
  .vitrin { grid-template-columns: minmax(0, 1fr); }
  .p-hero__actions { flex-direction: column; }
}

/* Legible navigation labels on the white mobile bar. */
.tab-bar .tab-item{color:#52637a;}
.tab-bar .tab-item.active{color:#1d4ed8;}
