/**
 * Mobil sağdan sola tam yükseklik sheet şablonu — geri + başlık + isteğe bağlı alt şerit + içerik.
 * Konum: üstten --mobile-promo-sheet-top (logo şeridi, footer.js); alttan viewport sonu.
 * z-index 1060: header-bc (1051) + hızlı erişim kısayolları + ürün menüsü üstünde; logo şeridi (top:65px) altta kalır.
 * JS: window.MobileRightSheet.open({ title, subbarHtml?, bodyHtml?, ... })
 */

body:not(.mobile-site) .mobile-right-sheet-overlay {
  display: none !important;
}

body.mobile-site .mobile-right-sheet-overlay {
  display: flex !important;
}

.mobile-right-sheet-overlay {
  position: fixed;
  inset: auto;
  top: var(--mobile-promo-sheet-top, var(--mobile-top-bar-height, 64px));
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1060;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  -webkit-overflow-scrolling: touch;
}

.mobile-right-sheet-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-right-sheet {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(100deg, #2b0a3d 0%, #0a0828 55%, #050520 100%);
  color: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.mobile-right-sheet-overlay.is-open .mobile-right-sheet {
  transform: translateX(0);
}

.mobile-right-sheet[role="dialog"] {
  outline: none;
}

.mobile-right-sheet__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 10px;
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  font-size: 13px;
  line-height: 1.3;
  background: #0d0d12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  justify-content: space-between;
}

.mobile-right-sheet__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  min-width: 1.3em;
  min-height: 1.3em;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(210, 210, 220, 0.42);
  color: rgba(28, 28, 36, 0.95);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s;
  order: -1;
}

.mobile-right-sheet__back:active {
  transform: scale(0.96);
}

.mobile-right-sheet__back:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.7);
  outline-offset: 2px;
}

.mobile-right-sheet__back-icon {
  display: block;
  margin-left: -1px;
  width: 1em;
  height: 1em;
}

.mobile-right-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  min-width: 1.3em;
  min-height: 1.3em;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(210, 210, 220, 0.42);
  color: rgba(28, 28, 36, 0.95);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s;
  order: 1;
}

.mobile-right-sheet__close:active {
  transform: scale(0.96);
}

.mobile-right-sheet__close:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.7);
  outline-offset: 2px;
}

.mobile-right-sheet__close-icon {
  display: block;
  width: 1em;
  height: 1em;
}

.mobile-right-sheet__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 1em;
  font-weight: 700;
  line-height: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  overflow-wrap: anywhere;
}

.mobile-right-sheet__subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 6px 12px;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  font-size: 12px;
  font-weight: 600;
  color: #8b8bb3;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-right-sheet__subbar[hidden] {
  display: none !important;
}

.mobile-right-sheet__subbar button {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #a09ed0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-right-sheet__subbar button:hover {
  color: #c4c0e8;
}

.mobile-right-sheet__subbar button:active {
  opacity: 0.85;
}

.mobile-right-sheet__clear-btn {
  margin-left: auto;
}

.mobile-right-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

/* Smart menü bildirimleri: toolbar + liste (notification-drawer__*) */
.mobile-notification-sheet-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.mobile-right-sheet__body .mobile-notification-sheet-content .notification-drawer__list {
  flex: 1;
  min-height: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-right-sheet__body .mobile-notification-sheet-content .notification-drawer__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  background: linear-gradient(90deg, rgba(133, 15, 131, 0.32) 0%, rgba(74, 49, 135, 0.38) 55%, rgba(36, 20, 80, 0.40) 100%);
  border-radius: 8px;
  border: 1px solid rgba(170, 110, 200, 0.30);
}

/* Toolbar in subbar: override subbar styling for toolbar display */
.mobile-right-sheet__subbar .notification-drawer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  width: 100%;
  flex: 1;
  background: none;
  border-bottom: none;
}

/* Smart menü favoriler: sekmeler + gövde */
.mobile-favorites-sheet-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.mobile-right-sheet__body .mobile-favorites-sheet-content .favorites-sidebar__tabs {
  padding-left: 0;
  padding-right: 0;
  margin-top: -4px;
}

.mobile-right-sheet__body .mobile-favorites-sheet-content .favorites-sidebar__body {
  flex: 1;
  min-height: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 16px;
  padding-bottom: 8px;
}

/* Smart menü ayarlar: dropdown alanları */
.mobile-settings-sheet-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.mobile-right-sheet__body .mobile-settings-sheet-content .settings-sidebar__body {
  gap: 14px;
  padding-top: 4px;
  padding-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-right-sheet-overlay,
  .mobile-right-sheet {
    transition-duration: 0.01ms !important;
  }
}
