
/* =========================
   CSS Variables & Base
========================= */
:root {
  --ab-bg: #FFF4EC;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--ab-bg);
  font-family: "Noto Sans KR", "Inter", system-ui, sans-serif;
  color: #111;
}

body.menu-open {
  overflow: hidden;
}


/* =========================
   Container
========================= */
.ab-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}


/* =========================
   Side Menu
========================= */
#ab-menu-panel[hidden] {
  display: none !important;
}

#ab-menu-panel {
  position: absolute;
  top: 65px;
  left: 12px;
  width: 140px;
  padding: 4px 0;
  height: auto;
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 12px;
  box-sizing: border-box;
  pointer-events: auto;
  z-index: 2000;
}

#ab-menu-panel a {
  display: block;
  border-radius: 8px;
}

#ab-menu-panel a:hover {
  background: rgba(0,0,0,0.04);
}

/* Menu List */
.ab-menu-list {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  gap: 0;
}

.ab-menu-list li {
  margin: 0;
}

.ab-menu-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
  padding: 14px 16px;
  border-radius: 0;
  font-size: 14px;
  color: #111;
  text-decoration: none;
  cursor: pointer;
  background: #fff;
  min-height: 48px;
  box-sizing: border-box;
}

.ab-menu-list li:first-child a {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.ab-menu-list li:last-child a {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.ab-menu-list a:hover:not(.is-active) {
  background: #f3f4f6;
}

.ab-menu-list a:focus,
.ab-menu-list a:active {
  outline: none;
}

/* 리갈 다큐 안보이기 */

.ab-menu-list a.is-active {
  background: #fff3eb;
  color: #ff7a3d;
  font-weight: 600;
  border-left: 3px solid #ff7a3d;
  padding-left: 13px;
}

.menu-legal-toggle{
  display:block;
  width:100%;
  padding:8px 0;
  background:none;
  border:none;
  font-size:14px;
  font-family:inherit;
  text-align:left;
  cursor:pointer;
  color:inherit;
}

.menu-legal-sub{
  display:none;
}

.menu-legal-sub.open{
  display:block;
}

/* =========================
   Header
========================= */
/* home.css 수정 */
.ab-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}


/* 중앙: 브랜드 */
.ab-brand {
  flex: 1;
  display: flex;
  justify-content: center;  /* 햄버거~location 사이 중앙 */
  pointer-events: none;   /* 🔥 클릭 통과 */
  z-index: 5;
}

.ab-brand-name {
 pointer-events: auto;   /* 링크만 클릭 가능 */
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ff7a00;
  text-decoration: none;
  pointer-events: none; /* 🔥 클릭 가로채지 않게 */
}
.ab-brand-name:first-letter {
  color: #ff7a00;
}

/* 오른쪽: zip + user */
.ab-location {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  
  max-width: 60%;  /* ⭐ 수정 */
 
}

.ab-header{
  height:52px;
  background:#fff;
 border-bottom:1px solid #eee;
}

#ab-zip {
  white-space: nowrap;
}

#ab-user-label {
   max-width: 80px; /* 닉네임 너무 길면 자름 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-beta-badge {
  margin-left: 4px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 6px;
  background: #ffffff;
  color: #ff7a00;
  line-height: 1;
}

/* Hamburger */
.ab-menu-btn {
  flex: 0 0 auto;
  position: relative;
  z-index: 1100;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  pointer-events: auto !important;
  /* left, top, transform 제거 */
}

.menu-divider{
height:1px;
background:#e5e5e5;
margin:12px 0;
}

.ab-change-location {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-bottom: 1px dashed #999; /* 클릭 가능 힌트 */
}
.ab-change-location:hover {
  color: #e87722; /* 브랜드 컬러 */
  border-bottom-color: #e87722;
}

/* Message Button */
.ab-message-btn,
.ab-message-btn * {
  pointer-events: auto !important;
  cursor: pointer;
  z-index: 3000;
}

.ab-message-btn {
  position: relative;
  z-index: 1100;
}

#ab-global-unread {
  position: absolute;
  top: -6px;
  right: -6px;
}

/* Unread Badge */
#ab-unread-badge,
#ab-unread-badge-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  position: relative;
}

/* Unread Dot */
.ab-user-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.ab-unread-dot {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  flex-shrink: 0;
  vertical-align: middle;
  font-size: 15px;
  line-height: 1;
  color: #333;
  background: none;
  width: auto;
  height: auto;
}

.ab-unread-dot.is-visible {
  display: inline-block;
}

.ab-unread-dot.is-visible::before {
  content: "💬";
}

body[data-user-id="0"] .ab-unread-dot {
  display: none !important;
}

.ab-menu-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
}

/* guest이면 login할수 있게  */

.ab-guest-link {
  color: #666;
  text-decoration: none;
  cursor: pointer;
}

.ab-guest-link:hover {
  color: #ff7a00;
}

/* =========================
   Search Bar (Sticky)
========================= */
.ab-search-bar {
  position: sticky;
  top: 52px;
  height: 52px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0;
  z-index: 999;
   border-bottom: 1px solid #eee;  /* 더 연하게 */
  box-shadow: none;              /* 혹시 생기는 그림자 제거 */
}

.ab-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  width: 100%;
  align-items: center;   /* 🔥 반드시 추가 */
}


.ab-select-wrap {
  position: relative;
  display: inline-block;
}

#ab-items-wrap.is-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 40vh;
}

.ab-mini-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;

  padding: 0 28px 0 10px;
  height: 40px;
  font-size: 12px;
  cursor: pointer;
}

/* 🔥 삼각형 */
.ab-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
  pointer-events: none;
}

#ab-mode-select {
  flex: 0 0 80px;
}

#ab-distance-select {
  flex: 0 0 40px;
}

/* wrap도 같이 줄여야 함 */
.ab-select-wrap:first-child {
  flex: 0 0 80px;
}

.ab-select-wrap:nth-child(2) {
  flex: 0 0 40px;
}

.ab-main-search {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  outline: none;
  line-height: normal;
}

.ab-main-search::placeholder {
  color: #9ca3af;
}

.ab-main-search:focus {
  border-color: #ff7a00;
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}

#ab-mode-select:hover,
#ab-distance-select:hover,
#ab-mode-select:focus,
#ab-distance-select:focus,
#ab-mode-select:active,
#ab-distance-select:active {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: none !important;
  outline: none !important;
}
#ab-mode-select,
#ab-distance-select,
.ab-main-search {
  height: 40px;
}

.ab-search-bar {
  min-height: 52px;
  padding: 6px 0;
}

/* Desktop / Mobile visibility */
.ab-desktop-only { display: flex; }
.ab-mobile-only  { display: none; }


/* =========================
   Category Tabs
========================= */
.ab-category-wrap {
  position: relative;
  background: var(--ab-bg);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
   z-index: 1000;  /* search-bar(999)보다 높게 */
  pointer-events: auto !important;
}

.ab-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  white-space: nowrap;
  scrollbar-width: none;
  background: transparent;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0;
  justify-content: center;  /* 그리드 중심과 맞춤 */
}

.ab-category-tabs::-webkit-scrollbar {
  display: none;
}

.ab-category-tabs .tab {
  flex: 0 0 auto;
  padding: 7px 16px;     /* 살짝 키움 */
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--ab-bg);
  color: #374151;
  border: 1px solid transparent;   /* 🔥 추가 */
  cursor: pointer;
  transition: all 0.15s ease;
}

.ab-category-tabs .tab:hover {
  background: #ffe9dc;
  color: #ff7a00;
}

.ab-category-tabs .tab.active {
  background: #fff;
  color: #ff7a00;
  border: 1px solid #ff7a00;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.category-description{
  position:absolute;
  left:-9999px;
  height:1px;
  width:1px;
  overflow:hidden;
}

/* =========================
   Home / Items Area
========================= */
.ab-hero,
.anabada-home {
  background: #fff8f2;
}

.anabada-home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ab-home-items {
  flex: 1;
}

#ab-items-wrap {
  margin-top: 0 !important;
  padding-top: 0 !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#ab-items-wrap.is-loading {
  opacity: 0.6;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

/* Post Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  column-gap: 20px;
  row-gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 0 !important;
  box-sizing: border-box;
  justify-content: center;
}


.ab-empty-items {
  /* grid-column 제거 — 부모가 single column일 때 의미없음 */
  width: 100%;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #666;
}


.empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  color: #999;
}

.ab-search-hint {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 14px 16px;
  background: #f6f7ff;
  border-radius: 12px;
  font-size: 14px;
  color: #444;
  text-align: center;
}

/* Loading Spinner */
.ab-loading-spinner {
  text-align: center;
  padding: 24px 0;
  color: #999;
  font-size: 14px;
}

.ab-loading-spinner::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: ab-spin 0.8s linear infinite;
}

@keyframes ab-spin {
  to { transform: rotate(360deg); }
}

.ab-no-more-items {
  text-align: center;
  padding: 28px 0 36px;
  color: #9ca3af;
  font-size: 13px;
}


/* =========================
   FAB (Post Button)
========================= */
.ab-fab-post {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ff7a00;
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  line-height: 56px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  z-index: 9999;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ab-fab-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}


/* =========================
   Chat Room (Panel open)
========================= */
body.chat-room-open #ab-global-search {
  pointer-events: none;
}


/* =========================
   Footer
========================= */
.ab-footer {
  margin-top: 60px;
  padding: 28px 16px;
  background: #fafafa;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #666;
}

.ab-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.ab-footer-copy {
  margin-bottom: 8px;
  font-weight: 500;
  color: #777;
}

.ab-footer-note {
  margin-bottom: 12px;
  color: #999;
  font-size: 12px;
}

.ab-footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
}

.ab-footer-links a {
  color: #666;
  text-decoration: none;
}

.ab-footer-links a:hover {
  color: #ff7a3d;
  text-decoration: underline;
}

#inapp-browser-warning{
position:fixed;
top:60px;
left:0;
width:100%;
z-index:9999;
}

.inapp-box {
  background: #fff;
  max-width: 420px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}

#open-external-browser {
  background: #ff7a00;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

/* Marketplace에서는 Community 메뉴 숨김 */

/* body 대신 .ab-page로 변경 */
.ab-page[data-page="marketplace"] .menu-community {
  display: none;
}
.ab-page[data-page="community"] .menu-marketplace {
  display: none;
}

/* =========================
   Complianz Consent Button
========================= */
.cmplz-manage-consent,
#cmplz-manage-consent {
  left: 20px !important;
  right: auto !important;
  bottom: 20px !important;
}

#cmplz-cookiebanner-container {
  pointer-events: none;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner {
  pointer-events: auto;
}

/* =========================
   📱 Mobile (≤360px)
========================= */
@media (max-width: 360px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================
   📱 Mobile (≤768px)
========================= */
@media (max-width: 768px) {
    
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ab-category-tabs {
    justify-content: flex-start;   /* 모바일은 왼쪽 정렬 */
    overflow-x: scroll !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
    margin: 0;
    padding: 10px 16px;  /* 40px → 16px */
  }
  
   .ab-search-bar .ab-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

   .ab-search-inner {
    padding-left: 0 !important;
    padding-right: 6px;
    gap: 4px;
  }
  
   #ab-mode-select,
   #ab-distance-select,
   .ab-main-search {
    height: 38px;
  }
}

/* 모바일에서 크기 조절 */
@media (max-width: 768px) {
  .ab-select-wrap:first-child {
    flex: 0 0 105px !important;
  }

  .ab-select-wrap:nth-child(2) {
    flex: 0 0 65px !important;
  }

  #ab-mode-select {
    width: 105px !important;
    padding: 0 20px 0 8px !important;
    font-size: 12px !important;
  }

  #ab-distance-select {
    width: 65px !important;
    padding: 0 16px 0 6px !important;
    font-size: 12px !important;
  }

  .ab-main-search {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 12px !important;
  }
}


/* =========================
   📲 Tablet (769–1024px)
========================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
    max-width: 960px;
    gap: 18px;
  }
}