/* =====================================================================
   BEXGRAM — sayfa başlıkları ortak ritim
   Yükseklik, odak, ikon, avatar, safe-area. Kompozisyon sayfa sınıfında.
   ===================================================================== */

/* ====================================================================
   GLOBAL RESPONSIVE FIXES
   ==================================================================== */


/* Neutralise stray heights for notifications page */
body.page-notifications #bildirim-main-section,
body.page-notifications main {
height: auto !important;
min-height: 0 !important;
max-height: none !important;
overflow-y: visible !important;
}

/* Minimum touch-target size for icons/buttons */
.icon-btn, .bex-nav-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Install button */
#installBtn, #btn-pwa-install {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
}

/* ====================================================================
   MOBILE SIDEBAR OVERLAYS
   ==================================================================== */
@media (max-width: 767px) {
    body.show-sidebar #bildirim-desktop-sidebar {
        display: flex !important;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: var(--wa-surface, #fff);
    }
    #bildirim-main-section {
        padding-bottom: 0;
    }

    body.show-sidebar #kesfet-desktop-sidebar,
    body.show-sidebar #odalar-desktop-sidebar {
        display: flex !important;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: var(--wa-surface, #fff);
    }
}

/* ====================================================================
   BXH — BASE HEADER COMPONENT
   ==================================================================== */
.bxh {
  --bxh-h: 56px;
  --bxh-icon: 22px;
  --bxh-avatar: 36px;
  --bxh-pad-x: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--bxh-h);
  padding: max(6px, env(safe-area-inset-top, 0px)) max(var(--bxh-pad-x), env(safe-area-inset-right, 0px)) 6px max(var(--bxh-pad-x), env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  color: var(--wa-text, var(--color-bg-dark));
  background: var(--wa-bar, var(--wa-surface, #fff));
  border-bottom: 1px solid var(--wa-line, rgba(0, 0, 0, 0.08));
  position: relative;
  z-index: 40;
}
html.dark .bxh { color: var(--wa-text, #e9edef); }

.bxh-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.bxh-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }

.bxh-title {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.bxh-kicker {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
  color: var(--wa-muted, #667781);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bxh-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-width: 0; }

.bxh-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--bex-primary, var(--color-primary));
  background: color-mix(in srgb, var(--bex-primary, var(--color-primary)) 12%, transparent);
}
.bxh-mark svg { width: var(--bxh-icon); height: var(--bxh-icon); display: block; }

.bxh-avatar {
  width: var(--bxh-avatar);
  height: var(--bxh-avatar);
  flex: 0 0 var(--bxh-avatar);
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  background: var(--wa-search, #f0f2f5);
  display: block;
}

a.bxh-avatar-link {
  width: var(--bxh-avatar);
  height: var(--bxh-avatar);
  flex: 0 0 var(--bxh-avatar);
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
}
a.bxh-avatar-link img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.bxh-iconbtn, .bxh-back {
width: 44px;
height: 44px;
min-width: 44px;
min-height: 44px;
position: relative;
z-index: 2;
pointer-events: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--wa-text, var(--color-bg-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex: 0 0 auto;
  touch-action: manipulation;
}
.bxh-iconbtn svg, .bxh-back svg { width: var(--bxh-icon); height: var(--bxh-icon); }
.bxh-iconbtn:hover, .bxh-back:hover { background: var(--wa-hover, rgba(0, 0, 0, 0.05)); }
.bxh-iconbtn:focus-visible, .bxh-back:focus-visible, .bxh-action:focus-visible, .bxh-search input:focus-visible {
  outline: 2px solid var(--bex-primary, var(--color-primary));
  outline-offset: 2px;
}

.bxh-action {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--bex-primary, var(--color-primary));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}
.bxh-action svg { width: 22px; height: 22px; }
.bxh-action.is-ghost {
  background: var(--wa-search, #f0f2f5);
  color: var(--wa-text, var(--color-bg-dark));
}

.bxh-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--wa-text, var(--color-bg-dark));
  background: var(--wa-search, #f0f2f5);
  white-space: nowrap;
  text-decoration: none;
}
.bxh-chip b { font-variant-numeric: tabular-nums; }

.bxh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wa-green-deep, #25d366);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa-green-deep, #25d366) 28%, transparent);
  flex: 0 0 auto;
}

.bxh-search {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--wa-search, #f0f2f5);
  color: var(--wa-muted, #667781);
}
.bxh-search input {
  border: 0;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: inherit;
}
.bxh-search svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* hide wide-only labels on small screens */
.bxh-only-wide { display: none; }
@media (min-width: 480px) { .bxh-only-wide { display: inline; } }

/* ====================================================================
   BXH — MESSENGER HEADER
   ==================================================================== */
body.page-messenger .bxh-messenger {
  grid-template-columns: auto minmax(0, 1fr) auto;
}


/* ====================================================================
   BXH — NOTIFICATIONS HEADER
   ==================================================================== */
body.page-notifications .bxh-notifications {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
body.page-notifications .bxh-notifications .bxh-copy { text-align: center; }
@media (max-width: 479px) {
  body.page-notifications .bxh-notifications { grid-template-columns: 44px minmax(0, 1fr); }
  body.page-notifications .bxh-notifications .bxh-copy { text-align: start; }
  body.page-notifications .bxh-notifications .bxh-tools { grid-column: 1 / -1; }
}

/* ====================================================================
   BXH — SEARCH / KESFET HEADER
   ==================================================================== */
body.page-search .bxh-search-header,
body.page-explore .bxh-explore,
body.page-rooms .bxh-rooms,
body.page-notifications .bxh-notes {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 10px;
}
@media (min-width: 768px) {
body.page-explore #kesfet-main-section .bxh-explore .bxh-back,
body.page-notifications #bildirim-main-section .bxh-notes .bxh-back,
body.page-rooms #odalar-main-section .bxh-rooms .bxh-back { display: none; }
body.page-rooms #odalar-desktop-sidebar .bxh-rooms {
grid-template-columns: auto minmax(0, 1fr) auto;
}
}

/* ====================================================================
   TABLET: narrow sidebars
   ==================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  body.page-explore #kesfet-desktop-sidebar,
  body.page-rooms #odalar-desktop-sidebar,
  body.page-notifications #bildirim-desktop-sidebar {
  width: min(300px, 34vw) !important;
  min-width: 0 !important;
  max-width: 320px !important;
  }
  }

/* ====================================================================
   DESKTOP: min-width for main sections
   ==================================================================== */
@media (min-width: 1024px) {
  body.page-explore #kesfet-main-section,
  body.page-rooms #odalar-main-section,
  body.page-notifications #bildirim-main-section {
  min-width: 0;
  }
  }


/* ====================================================================
   NOTIFICATIONS PAGE — LAYOUT
   ==================================================================== */
body.page-notifications main { display: flex; min-width: 0; min-height: 0; height: auto; overflow: visible; }
body.page-notifications #bildirim-main-section {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  body.page-notifications #bildirim-desktop-sidebar { display: flex !important; }
}
@media (max-width: 767px) {
  body.page-notifications #bildirim-desktop-sidebar { display: none !important; }
}

/* ====================================================================
   PWA INSTALL BUTTON
   ==================================================================== */
#btn-pwa-install {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 16px));
  right: 16px;
  z-index: 9999;
  background: var(--bex-primary, var(--color-primary));
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: none; /* shown by JS */
  align-items: center;
  gap: 6px;
  min-height: 44px;
  transition: opacity 0.2s;
}
#btn-pwa-install.hidden { display: none !important; }


/* Keşfet page layout fix for user_page_shell variant */
body.page-explore .bex-user-container {
  padding: 0 !important;
  max-width: 100% !important;
}
body.page-explore main { display: flex; gap: 0; min-width: 0; height: auto; overflow: visible; }
body.page-explore #kesfet-main-section {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 8px));
  scroll-padding-bottom: calc(56px + env(safe-area-inset-bottom, 8px));
  box-sizing: border-box;
}
@media (min-width: 768px) {
  body.page-explore #kesfet-main-section {
    height: auto;
    padding-bottom: 24px;
    scroll-padding-bottom: 24px;
  }
}
