/* galeri-49 (18 Ekim 2026): mobil iyileştirmeler. Geri alma: bash galeri/galeri-49-mobil.sh geri-al */

/* Sayfa yükleyici: içerik hazırken boş ekranda dönen tekerlek gösterilmesin */
#page-loader { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
/* galeri-50: uzun kelimeler (ör. token numarası) sütunu taşırmasın */
dd, .list-terms-minimal { overflow-wrap: anywhere; }

/* Alt menü ve eser satış çubuğu (yalnız telefonda görünür) */
.g49-altmenu, .g49-eser-cubuk { display: none; }

@media (max-width: 767.98px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* iOS: 16 pikselin altındaki form alanına dokununca sayfa yakınlaşmasın */
  input, select, textarea { font-size: 16px !important; }

  /* Okunabilirlik */
  body, p { font-size: 16px; line-height: 1.6; }
  dd, dl, .list-terms-minimal { overflow-wrap: anywhere; }

  /* Üst çubuk: logo daha görünür */
  .rd-navbar-brand img.img-logo { max-width: 132px !important; width: 132px; height: auto; }

  /* Yüzen WhatsApp düğmesi yerine alt menüdeki WhatsApp */
  .floating-wpp { display: none !important; }

  /* Alt bilgi: dokunma alanları ve sakin sosyal simgeler */
  .page-footer a, footer a { display: inline-block; min-height: 40px; line-height: 40px; }
  a[class^="ico"] { transform: scale(.78); margin: 0 -2px; }

  /* Ana sayfa kategorileri: alt alta 8 kutu yerine yana kayan şerit */
  .g49-kategori { flex-wrap: nowrap !important; overflow-x: auto; scroll-snap-type: x proximity;
                  -webkit-overflow-scrolling: touch; margin: 0 -15px !important; padding: 4px 15px 10px; scrollbar-width: none; }
  .g49-kategori::-webkit-scrollbar { display: none; }
  .g49-kategori > div { flex: 0 0 auto !important; max-width: none !important; width: auto !important; padding: 0 4px !important; margin: 0 !important; scroll-snap-align: start; }
  .g49-kategori a.button { padding: 10px 18px !important; border-radius: 999px; font-size: 13px; white-space: nowrap; min-height: 44px; }

  /* Alt menü */
  .g49-altmenu { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
                 height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
                 background: rgba(255,255,255,.96); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
                 border-top: 1px solid #e6e2da; }
  .g49-altmenu a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                   color: #555; font: 500 11px/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-decoration: none; }
  .g49-altmenu a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .g49-altmenu a.g49-etkin { color: #14204a; font-weight: 700; }
  .g49-altmenu a.g49-wp { color: #128c4b; }

  /* Eser sayfası: alt menü yerine satış çubuğu */
  body.g49-eser .g49-altmenu { display: none; }
  .g49-eser-cubuk { display: flex; gap: 8px; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
                    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
                    border-top: 1px solid #e6e2da; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
  .g49-eser-cubuk a, .g49-eser-cubuk button { min-height: 46px; border-radius: 12px; border: 0; display: inline-flex; align-items: center;
                    justify-content: center; gap: 6px; font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-decoration: none; }
  .g49-eser-cubuk .g49-ana { flex: 1 1 auto; background: #14204a; color: #fff; }
  .g49-eser-cubuk .g49-ikinci { flex: 0 0 auto; padding: 0 14px; background: #f1eee8; color: #14204a; }
  .g49-eser-cubuk .g49-paylas { flex: 0 0 46px; background: #f1eee8; color: #14204a; }
  .g49-eser-cubuk svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
  .g49-bildirim { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px;
                  border-radius: 10px; font-size: 14px; z-index: 1050; }
}

/* galeri-51: yan menü (arkadaşın videoları, 18 Ekim): ok işaretine dokununca alt menü açılsın; menü açıkken arka sayfa
   kaymasın, tıklanmasın; boşluğa dokununca menü kapansın */
@media (max-width: 1199.98px) {
  .rd-navbar-fixed .rd-navbar-submenu-toggle { pointer-events: none; }
  .rd-navbar-fixed .rd-navbar-nav > li > a { min-height: 44px; display: flex; align-items: center; }
  .rd-navbar-nav-wrap { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  html.g49-menu-acik, html.g49-menu-acik body { overflow: hidden !important; touch-action: none; }
  html.g49-menu-acik .rd-navbar-nav-wrap { touch-action: pan-y; }
  .g49-perde { position: fixed; inset: 0; z-index: 1; background: rgba(20, 20, 30, .38); opacity: 0; pointer-events: none;
               transition: opacity .2s ease; }
  html.g49-menu-acik .g49-perde { opacity: 1; pointer-events: auto; }
  html.g49-menu-acik .g49-altmenu, html.g49-menu-acik .g49-eser-cubuk { display: none !important; }
}

/* galeri-52: sıkı denetim düzeltmeleri */
.g52-kart { display: none; }
.g52-bos { padding: 48px 16px; text-align: center; color: #555; font-size: 17px; line-height: 1.6; }
@media (max-width: 767.98px) {
  /* Eser kartı: telefonda dokununca doğrudan eser sayfası (masaüstünde hızlı görünüm kalır) */
  .product-img-wrap { position: relative; }
  .g52-kart { display: block; position: absolute; inset: 0; z-index: 5; }
  /* Teklif penceresi: telefonda sığsın, gönder düğmesi görünür olsun */
  #offerModal .modal-dialog { margin: 8px; }
  #offerModal .form-wrap { margin-top: 10px !important; }
  #offerModal .form-input { min-height: 48px; padding-top: 10px; padding-bottom: 10px; }
  #offerModal textarea.form-input { height: 110px; min-height: 110px; }
  .modal { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  /* Açılır pencere, büyütme ve hızlı görünüm açıkken alt çubuklar gizli, arka sayfa kilitli */
  body.modal-open .g49-altmenu, body.modal-open .g49-eser-cubuk,
  html.g52-katman .g49-altmenu, html.g52-katman .g49-eser-cubuk,
  .fancybox-active .g49-altmenu, .fancybox-active .g49-eser-cubuk, .fancybox-lock .g49-altmenu, .fancybox-lock .g49-eser-cubuk { display: none !important; }
  html.g52-katman, html.g52-katman body { overflow: hidden !important; }
}

/* galeri-54: kategoriler yana kaymasın, hepsi bir bakışta görünsün (3'erli ızgara; arkadaşın önerisi, 18 Ekim);
   "Ana ekrana ekle" önerisi ve menü öğesi */
.g54-yukle, .g54-oneri, .g54-ios { display: none; }
@media (max-width: 767.98px) {
  .g49-kategori { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
                  overflow: visible; scroll-snap-type: none; margin: 0 !important; padding: 4px 0 12px; }
  .g49-kategori > div { grid-column: span 2; padding: 0 !important; }
  .g49-kategori > div:nth-child(3n+1):nth-last-child(2), .g49-kategori > div:nth-child(3n+1):nth-last-child(2) ~ div { grid-column: span 3; }
  .g49-kategori > div:nth-child(3n+1):last-child { grid-column: 1 / -1; }
  .g49-kategori a.button { display: flex !important; align-items: center; justify-content: center; width: 100%; height: 100%;
                           min-height: 52px; margin: 0 !important; padding: 8px 6px !important; border-radius: 14px;
                           white-space: normal; text-align: center; line-height: 1.25; font-size: 12px; letter-spacing: .03em; }

  .g54-yukle { display: list-item; }
  .g54-oneri { display: flex; align-items: center; gap: 12px; position: fixed; left: 10px; right: 10px; z-index: 1045;
               bottom: calc(70px + env(safe-area-inset-bottom)); padding: 12px 12px 12px 14px; background: #fff; color: #222;
               border: 1px solid #e6e2da; border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.16);
               font: 400 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; animation: g54-gir .25s ease-out; }
  .g54-oneri img { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 11px; }
  .g54-oneri .g54-metin { flex: 1 1 auto; min-width: 0; }
  .g54-oneri strong { display: block; font-weight: 600; color: #14204a; }
  .g54-oneri span { color: #666; font-size: 13px; }
  .g54-oneri .g54-ekle { flex: 0 0 auto; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: #14204a; color: #fff;
                         font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  .g54-oneri .g54-kapat { flex: 0 0 32px; width: 32px; height: 40px; margin-right: -4px; padding: 0; border: 0; background: none; color: #888; font-size: 24px; line-height: 1; }
  .g54-ios { display: block; position: fixed; inset: 0; z-index: 1060; background: rgba(20,20,30,.42); }
  .g54-ios .g54-sayfa { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
                        background: #fff; border-radius: 18px 18px 0 0; font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #222; }
  .g54-ios h2 { margin: 0 0 12px; font-size: 19px; line-height: 1.3; font-weight: 600; color: #14204a; letter-spacing: 0; text-transform: none; }
  .g54-ios ol { margin: 0 0 18px; padding-left: 22px; list-style: decimal; }
  .g54-ios li { margin: 6px 0; }
  .g54-ios svg { width: 18px; height: 18px; vertical-align: -3px; stroke: #0a64d6; fill: none; stroke-width: 1.8; }
  .g54-ios button { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: #14204a; color: #fff;
                    font: 600 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  html.g49-menu-acik .g54-oneri, body.modal-open .g54-oneri, html.g52-katman .g54-oneri { display: none; }
}
@media (max-width: 359.98px) {
  .g49-kategori > div, .g49-kategori > div:nth-child(3n+1):nth-last-child(2), .g49-kategori > div:nth-child(3n+1):nth-last-child(2) ~ div { grid-column: span 3; }
}
@keyframes g54-gir { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
