/* APP THEME START */
/**
 * Mobile-first UI Theme (CepteSat)
 * - Scoped to `.mobile` body and `.app-shell` wrapper
 * - Design tokens via CSS variables
 */

:root{
  /* Colors */
  --app-bg: #f6f7fb;
  --app-surface: #ffffff;
  --app-surface-2: #f2f4f8;
  --app-text: #0b1220;
  --app-text-2: #5b6476;
  --app-border: rgba(17, 24, 39, .10);

  --app-primary: #ef4444;
  --app-primary-2: #dc2626;
  --app-success: #16a34a;
  --app-warn: #f59e0b;

  /* Typography */
  --app-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --app-fs-1: 12px;
  --app-fs-2: 14px;
  --app-fs-3: 16px;
  --app-fs-4: 18px;
  --app-fs-5: 22px;

  /* Radius */
  --app-r-1: 10px;
  --app-r-2: 14px;
  --app-r-3: 18px;
  --app-r-pill: 999px;

  /* Shadow */
  --app-shadow-1: 0 6px 20px rgba(17, 24, 39, .08);
  --app-shadow-2: 0 14px 40px rgba(17, 24, 39, .12);

  /* Spacing scale */
  --app-s-0: 0px;
  --app-s-1: 4px;
  --app-s-2: 8px;
  --app-s-3: 12px;
  --app-s-4: 16px;
  --app-s-5: 20px;
  --app-s-6: 24px;

  /* Layout */
  --app-topbar-h: 56px;
  --app-bottomnav-h: 60px;

  /* Motion */
  --app-ease: cubic-bezier(.2,.8,.2,1);
  --app-press-scale: .985;
}

/* ---------- Base shell ---------- */
body.mobile{
  font-family: var(--app-font);
  background: var(--app-bg);
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 0; /* override legacy bottom bar padding */
}

body.mobile.app-shell{
  min-height: 100svh;
  background: var(--app-bg);
}

body.mobile .app-content{
  /* keep content clear from fixed bottom nav */
  padding-bottom: calc(var(--app-bottomnav-h) + env(safe-area-inset-bottom, 0px) + var(--app-s-4));
}

/* Make default container feel "native" (no hard max-width on mobile if theme expects full width) */
body.mobile .container{
  max-width: 100%;
}

/* ---------- Sticky header (existing .topbar + new .app-topbar) ---------- */
body.mobile .app-topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 247, 251, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--app-border);
  padding-top: env(safe-area-inset-top, 0px);
}

body.mobile .app-topbar .topbar-inner{
  height: var(--app-topbar-h);
}

/* Compact header buttons */
body.mobile .app-topbar .icon-btn{
  border-radius: var(--app-r-2);
}

/* City badge -> chip feel */
body.mobile .app-topbar .city-badge{
  border-radius: var(--app-r-pill);
  background: rgba(255,255,255,.85);
  border: 1px solid var(--app-border);
  padding: 8px 10px;
  gap: 6px;
}

/* ---------- Bottom nav (existing .bottombar + new .app-bottomnav) ---------- */
body.mobile .app-bottomnav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--app-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: var(--app-bottomnav-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(17, 24, 39, .08);
}

body.mobile .app-bottomnav .bb-item{
  border-radius: var(--app-r-2);
  transition: transform 120ms var(--app-ease), background-color 120ms var(--app-ease), color 120ms var(--app-ease);
  padding: 6px 10px;
  gap: 4px;
  min-width: 56px;
}

body.mobile .app-bottomnav .bb-item.app-is-active{
  color: var(--app-primary);
}

body.mobile .app-bottomnav .bb-item.app-pressed{
  transform: scale(var(--app-press-scale));
  background: rgba(239, 68, 68, .08);
}

/* Badge: make it more "app" */
body.mobile .app-bottomnav .bb-badge{
  border-radius: var(--app-r-pill);
  box-shadow: var(--app-shadow-1);
}

/* Compact + modern bottom nav tweaks */
body.mobile .app-bottomnav .bb-ico{ width: 22px; height: 22px; }
body.mobile .app-bottomnav .bb-text{ font-size: 10px; line-height: 1; }
body.mobile .app-bottomnav .bb-primary{
  width: 48px;
  height: 48px;
  border-radius: 16px;
  transform: translateY(-8px);
}
body.mobile .app-bottomnav .bb-primary .bb-ico{ width: 24px; height: 24px; }


/* ---------- Cards (Listing) ---------- */
body.mobile .app-card{
  border-radius: var(--app-r-3);
  overflow: hidden;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-1);
  border: 1px solid rgba(17, 24, 39, .06);
}

body.mobile .app-card .card-link{
  color: inherit;
}

body.mobile .app-card .card-media{
  position: relative;
}

body.mobile .app-card .card-media img{
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--app-surface-2);
}

body.mobile .app-card .fav-btn{
  border-radius: var(--app-r-pill);
  box-shadow: var(--app-shadow-1);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(17, 24, 39, .08);
}

body.mobile .app-card .card-body{
  padding: var(--app-s-3) var(--app-s-3) var(--app-s-4);
}

body.mobile .app-card .price{
  display: flex;
  align-items: baseline;
  gap: 8px;
}

body.mobile .app-card .new-price{
  font-size: var(--app-fs-4);
  font-weight: 900;
  letter-spacing: -.01em;
}

body.mobile .app-card .old-price{
  font-size: var(--app-fs-2);
  color: var(--app-text-2);
  text-decoration: line-through;
}

body.mobile .app-card .meta{
  margin-top: 6px;
  font-size: var(--app-fs-2);
  color: var(--app-text);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.mobile .app-card .meta-row{
  margin-top: 8px;
  font-size: var(--app-fs-1);
  color: var(--app-text-2);
}

body.mobile .app-card.app-pressed{
  transform: scale(var(--app-press-scale));
}

body.mobile .app-card{
  transition: transform 140ms var(--app-ease);
}

/* ---------- Listing grid spacing ---------- */
body.mobile.app-shell .grid{
  gap: 6px; /* mobilde kart arası boşluk minimum */
}

@media (max-width: 520px){
  .app-shell .grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 8px;
    padding-right: 8px;
  }
  .app-shell .section-title{
    padding-left: var(--app-s-3);
    padding-right: var(--app-s-3);
  }
}

/* Kart iç boşlukları: daha sıkı */
body.mobile .app-card .card-body{padding:8px 8px 10px}
body.mobile .app-card .meta{margin-top:4px}
body.mobile .app-card .meta-row{margin-top:6px}

/* Alt menü: sadece ikon */
body.mobile .app-bottomnav .bb-item{flex-direction:column;gap:2px;padding:8px 4px}
body.mobile .app-bottomnav .bb-text{display:block !important;font-size:11px;line-height:1.1;margin-top:2px;font-weight:800}
body.mobile .app-bottomnav .bb-sub{display:block;font-size:10px;line-height:1.1;margin-top:1px;opacity:.72}
body.mobile .app-bottomnav .bb-item{gap:0}

/* ---------- Sections / titles ---------- */
body.mobile.app-shell .section-title h2{
  font-size: var(--app-fs-4);
  letter-spacing: -.01em;
}

/* ---------- Chips (filter) ---------- */
body.mobile .app-chipbar{
  display: flex;
  gap: var(--app-s-2);
  padding: var(--app-s-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
body.mobile .app-chipbar::-webkit-scrollbar{ display:none; }

body.mobile .app-chip{
  flex: 0 0 auto;
  border-radius: var(--app-r-pill);
  border: 1px solid var(--app-border);
  background: rgba(255,255,255,.9);
  padding: 10px 12px;
  font-size: var(--app-fs-2);
  color: var(--app-text);
  line-height: 1;
  transition: transform 120ms var(--app-ease), background-color 120ms var(--app-ease), color 120ms var(--app-ease);
}
body.mobile .app-chip[aria-pressed="true"],
body.mobile .app-chip.is-active{
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .28);
  color: var(--app-primary-2);
}

body.mobile .app-chip.app-pressed{
  transform: scale(var(--app-press-scale));
}

/* ---------- Touch feedback (generic) ---------- */
body.mobile .app-tappable{
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.mobile .app-pressed{
  transform: scale(var(--app-press-scale));
}

/* ---------- Forms: slightly more native ---------- */
body.mobile .input,
body.mobile select.input{
  border-radius: var(--app-r-2);
}

body.mobile .form{
  padding: var(--app-s-3);
}
body.mobile .form .row,
body.mobile .form .row1{
  gap: var(--app-s-3);
}

/* ---------- Detail page improvements (keep existing markup) ---------- */
body.mobile .detail{
  border-radius: var(--app-r-3);
  box-shadow: var(--app-shadow-1);
  border: 1px solid rgba(17, 24, 39, .06);
}

body.mobile .detail-body{
  padding: var(--app-s-4);
}

/* Keep bottom CTA buttons above nav */
body.mobile .detail-actions,
body.mobile .sticky-actions{
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--app-s-4));
}

/* APP THEME END */


/* ---------- Modern listing cards ---------- */
body.mobile .app-card{
  border-radius: var(--app-r-3);
  box-shadow: var(--app-shadow-1);
  overflow: hidden;
}

body.mobile .app-card .card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px 6px 12px;
  gap: 12px;
}

body.mobile .app-card .seller{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

body.mobile .app-card .seller-avatar{
  width: 32px;
  height: 32px;
  border-radius: 12px;
  font-size: 13px;
}

body.mobile .app-card .seller-name{
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

body.mobile .status-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display:inline-block;
  background: #9CA3AF;
  box-shadow: 0 0 0 3px rgba(156,163,175,.18);
}

body.mobile .status-dot.online{
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}

body.mobile .card-media{
  border-radius: 0;
}

body.mobile .app-card .card-body{
  padding: 10px 12px 12px 12px;
}

body.mobile .app-card .card-title{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.mobile .app-card .card-price{
  margin-top: 4px;
  font-weight: 800;
  font-size: 15px;
}

body.mobile .app-card .card-badges{
  margin-top: 8px;
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
}

body.mobile .app-card .pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,122,0,.22);
  background: linear-gradient(135deg, rgba(255,122,0,.92), rgba(255,154,61,.86));
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

body.mobile .app-card .pill-type{
  border-color: rgba(255,122,0,.22);
  background: linear-gradient(135deg, rgba(255,122,0,.88), rgba(255,154,61,.80));
}

body.mobile .app-card .pill-more{
  border-color: rgba(255,122,0,.20);
  background: linear-gradient(135deg, rgba(255,122,0,.82), rgba(255,154,61,.76));
}

/* Upload/tag pills (ilan yükleme & düzenleme) */
body.mobile .tag-pills{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
body.mobile .tag-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,122,0,.22);
  background: rgba(255,122,0,.08);
  color: #1f2937;
  font-weight: 800;
  font-size: 12px;
}
body.mobile .tag-pill input{
  width: 16px;
  height: 16px;
}


/* ---------- Mobile feel tweaks (non-breaking) ---------- */
body.mobile{
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS Safari auto-zoom on inputs */
body.mobile input, 
body.mobile select, 
body.mobile textarea{
  font-size: 16px;
}

/* ---------- Listing card badge slider (tags) ---------- */
.badge-slider{
  display:block;
  height:28px;
  overflow:hidden;
  pointer-events:none;
}
.badge-slider .badge-item{
  position:absolute;
  left:0;
  bottom:0;
  white-space:nowrap;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  opacity:0;
  transform:translateY(120%);
  animation-name: badgeSlide;
  animation-duration: calc(var(--badge-count, 1) * var(--badge-step, 2.6s));
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: calc(var(--i, 0) * var(--badge-step, 2.6s));
}
.badge-slider.single .badge-item{
  position:static;
  opacity:1;
  transform:none;
  animation:none;
}
@keyframes badgeSlide{
  0%{opacity:0;transform:translateY(120%)}
  8%{opacity:1;transform:translateY(0)}
  38%{opacity:1;transform:translateY(0)}
  50%{opacity:0;transform:translateY(-120%)}
  100%{opacity:0;transform:translateY(-120%)}
}
@media (prefers-reduced-motion: reduce){
  .badge-slider .badge-item{animation:none;opacity:1;transform:none;position:static;}
}

/* Home page: legacy bottom nav (icons only) */
body.mobile.home-legacy-bottomnav .app-bottomnav .bb-text,
body.mobile.home-legacy-bottomnav .app-bottomnav .bb-sub{display:none !important}
body.mobile.home-legacy-bottomnav .app-bottomnav .bb-item{
  flex-direction: row;
  gap: 0;
  padding: 6px 10px;
}
