/* Mobil alt menü — her zaman sabit, viewport değişiminden etkilenmez */

body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar-root {
  display: none;
}

@media (max-width: 767px) {
  body.statione-market-layout.statione-is-authenticated {
    --statione-mobile-bottom-bar-h: 4.25rem;
    --statione-mobile-bottom-bar-accent: #b91c1c;
  }

  /*
   * Tam ekran 100dvh katmanı yok — iOS kaydırınca dvh değişip barı oynatıyordu.
   * Bar doğrudan viewport altına sabitlenir.
   * Kaydırma body’de değil .studio-select-view içinde (aşağıda) — fixed bozulmasın.
   */
  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar-root {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    /* Home-indicator altındaki boşluğu da beyaza boya (bar kutusunun dışı) */
    box-shadow: 0 48px 0 0 #ffffff;
    pointer-events: none;
    box-sizing: border-box;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    justify-items: stretch;
    width: 100%;
    margin: 0;
    /*
     * fixed + body inset zaten safe kenarda; env(safe-area) ile toplamak
     * ikonları gereksiz yukarı iter (altında boş şerit).
     */
    padding: 0.45rem 0.25rem 0.45rem;
    background: #ffffff;
    border-top: 1px solid color-mix(in srgb, #000000 8%, transparent);
    box-sizing: border-box;
    pointer-events: auto;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__item {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    min-width: 0;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.1rem 0.1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8b8b93;
    font: inherit;
    cursor: pointer;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__item.is-active {
    color: var(--statione-mobile-bottom-bar-accent);
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__icon-wrap svg {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__app-icon {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    object-fit: contain;
    object-position: center;
  }

  /* Diğer stroke ikonlar gibi: pasif #8b8b93, aktif marka kırmızısı */
  body.statione-market-layout.statione-is-authenticated
    .statione-mobile-bottom-bar__item:not(.is-active)
    .statione-mobile-bottom-bar__app-icon {
    opacity: 1;
    /* kırmızı PNG → düz gri (#8b8b93 ≈ invert %55) */
    filter: grayscale(1) brightness(0) invert(55%);
  }

  body.statione-market-layout.statione-is-authenticated
    .statione-mobile-bottom-bar__item.is-active
    .statione-mobile-bottom-bar__app-icon {
    opacity: 1;
    filter: none;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__badge {
    position: absolute;
    top: -0.35rem;
    right: -0.55rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #e11d48;
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    box-sizing: border-box;
  }

  body.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__label {
    max-width: 100%;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.statione-market-layout.statione-is-authenticated
    .statione-mobile-bottom-bar__item.is-active
    .statione-mobile-bottom-bar__label {
    font-weight: 600;
    color: #1a1a1f;
  }

  body.statione-market-layout.statione-is-authenticated .studio-select-inner {
    /* Alt bar + ekstra nefes — içerik barın arkasında kalmasın */
    padding-bottom: calc(var(--statione-mobile-bottom-bar-h, 4.25rem) + 2.25rem);
  }

  /*
   * iOS: document kaydırınca fixed alt bar bozulur.
   * Body sabit; kırmızı chrome sabit; kaydırma yalnızca beyaz sacın içinde.
   */
  html:has(body.statione-market-layout.statione-is-authenticated) {
    height: 100%;
    overflow: hidden;
  }

  body.statione-market-layout.statione-is-authenticated {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.statione-market-layout.statione-is-authenticated #root {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  body.statione-market-layout.statione-is-authenticated .statione-main {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.statione-market-layout.statione-is-authenticated .studio-select-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.statione-market-layout.statione-is-authenticated .statione-market-chrome {
    flex: 0 0 auto;
  }

  body.statione-market-layout.statione-is-authenticated .studio-select-inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  /*
   * iOS Safari: computed font-size < 16px olan input focus’ta sayfayı zoom’lar
   * ve çoğu zaman geri gelmez. İşlem satırları vb. daha spesifik kurallarla
   * 0.75–0.875rem verdiği için !important şart.
   */
  body.statione-market-layout.statione-is-authenticated input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='hidden']):not([type='file']),
  body.statione-market-layout.statione-is-authenticated textarea,
  body.statione-market-layout.statione-is-authenticated select,
  body.statione-market-layout.statione-is-authenticated .statione-operation-sheet__input,
  body.statione-market-layout.statione-is-authenticated .statione-cari-search-panel__input,
  body.statione-market-layout.statione-is-authenticated .statione-defter-header__search-input,
  body.statione-market-layout.statione-is-authenticated .statione-calc-block__input,
  body.statione-market-layout.statione-is-authenticated .statione-vardiya-shift-field__input,
  body.statione-market-layout.statione-is-authenticated .studio-search-menu__input,
  body.statione-market-layout.statione-is-authenticated .statione-mobile-hero__search-input,
  body.statione-market-layout.statione-is-authenticated .statione-market-header__search-input {
    font-size: 16px !important;
  }
}


/* FORCE_MOBILE_CHROME: same as max-width 767px */

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated {
    --statione-mobile-bottom-bar-h: 4.25rem;
    --statione-mobile-bottom-bar-accent: #b91c1c;
  }

  /*
   * Tam ekran 100dvh katmanı yok — iOS kaydırınca dvh değişip barı oynatıyordu.
   * Bar doğrudan viewport altına sabitlenir.
   * Kaydırma body’de değil .studio-select-view içinde (aşağıda) — fixed bozulmasın.
   */
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar-root {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    pointer-events: none;
    box-sizing: border-box;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    justify-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.25rem 0.45rem;
    background: #ffffff;
    border-top: 1px solid color-mix(in srgb, #000000 8%, transparent);
    box-sizing: border-box;
    pointer-events: auto;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__item {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    min-width: 0;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.1rem 0.1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8b8b93;
    font: inherit;
    cursor: pointer;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__item.is-active {
    color: var(--statione-mobile-bottom-bar-accent);
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__icon-wrap svg {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__app-icon {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    object-fit: contain;
    object-position: center;
  }

  /* Diğer stroke ikonlar gibi: pasif #8b8b93, aktif marka kırmızısı */
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated
    .statione-mobile-bottom-bar__item:not(.is-active)
    .statione-mobile-bottom-bar__app-icon {
    opacity: 1;
    /* kırmızı PNG → düz gri (#8b8b93 ≈ invert %55) */
    filter: grayscale(1) brightness(0) invert(55%);
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated
    .statione-mobile-bottom-bar__item.is-active
    .statione-mobile-bottom-bar__app-icon {
    opacity: 1;
    filter: none;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__badge {
    position: absolute;
    top: -0.35rem;
    right: -0.55rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #e11d48;
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    box-sizing: border-box;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar__label {
    max-width: 100%;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated
    .statione-mobile-bottom-bar__item.is-active
    .statione-mobile-bottom-bar__label {
    font-weight: 600;
    color: #1a1a1f;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .studio-select-inner {
    /* Alt bar + ekstra nefes — içerik barın arkasında kalmasın */
    padding-bottom: calc(var(--statione-mobile-bottom-bar-h, 4.25rem) + 2.25rem);
  }

  /*
   * iOS: document kaydırınca fixed alt bar bozulur.
   * Body sabit; kırmızı chrome sabit; kaydırma yalnızca beyaz sacın içinde.
   */
  html:has(body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated) {
    height: 100%;
    overflow: hidden;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated #root {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-main {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .studio-select-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-market-chrome {
    flex: 0 0 auto;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .studio-select-inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  /*
   * iOS Safari: computed font-size < 16px olan input focus’ta sayfayı zoom’lar
   * ve çoğu zaman geri gelmez. İşlem satırları vb. daha spesifik kurallarla
   * 0.75–0.875rem verdiği için !important şart.
   */
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='hidden']):not([type='file']),
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated textarea,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated select,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-operation-sheet__input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-cari-search-panel__input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-defter-header__search-input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-calc-block__input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-vardiya-shift-field__input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .studio-search-menu__input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-hero__search-input,
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-market-header__search-input {
    font-size: 16px !important;
  }

/* Masaüstü (force-mobile): alt bar yok — menü hero search yanında */
@media (min-width: 768px) {
  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated {
    --statione-mobile-bottom-bar-h: 0px;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .statione-mobile-bottom-bar-root {
    display: none !important;
  }

  body.statione-force-mobile-chrome.statione-market-layout.statione-is-authenticated .studio-select-inner {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }
}
