/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Noto Sans KR', sans-serif; color: #1e293b; background: #f8fafc; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Variables ────────────────────────────────── */
:root {
    --blue: #3b82f6; --blue-dark: #2563eb;
    --gray-100: #f1f5f9; --gray-200: #e2e8f0; --gray-400: #94a3b8;
    --gray-600: #475569; --gray-800: #1e293b;
    --red: #ef4444; --green: #22c55e; --yellow: #eab308;
    --radius: 12px; --shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ── Layout ───────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.see-all { color: var(--blue); font-size: .9rem; }

/* ── Navbar ───────────────────────────────────── */
.navbar { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--gray-200); }
.navbar__inner { display: flex; align-items: center; gap: 1rem; height: 80px; }
.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; font-weight: 700; color: var(--blue); }
.navbar__search { flex: 1; display: flex; align-items: center; border: 1.5px solid var(--gray-200); border-radius: 999px; overflow: visible; max-width: 680px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.navbar__search select { border: none; outline: none; background: transparent; font-size: .88rem; padding: .5rem .8rem; cursor: pointer; color: var(--gray-700); white-space: nowrap; }
.navbar__search select:first-child { border-radius: 999px 0 0 999px; padding-left: 1.2rem; }
.nav-divider { width: 1px; height: 22px; background: var(--gray-200); flex-shrink: 0; }
.navbar__search .search-wrap { flex: 1; min-width: 0; }
.navbar__search input { width: 100%; border: none; padding: .5rem .8rem; outline: none; font-size: .88rem; background: transparent; }
.navbar__search button { flex-shrink: 0; padding: .5rem 1.2rem; background: var(--blue); color: #fff; border-radius: 0 999px 999px 0; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.navbar__actions { display: flex; gap: .5rem; }

/* ── Buttons ──────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .5rem 1.2rem; border-radius: 999px; font-size: .9rem; font-weight: 500; transition: .15s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { border: 1.5px solid var(--gray-200); color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: .3rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; border-radius: var(--radius); }

/* ── Hero ─────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); color: #fff; padding: 5rem 1.5rem; text-align: center; }
.hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: .75rem; }
.hero p { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; }
.hero__search { display: flex; gap: .5rem; max-width: 640px; margin: 0 auto; }
.hero__search input { flex: 1; padding: .75rem 1.25rem; border-radius: var(--radius); border: none; font-size: 1rem; }
.hero__content { position: relative; z-index: 1; }

/* ── Category Grid ────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.cat-card { background: #fff; border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center; box-shadow: var(--shadow); cursor: pointer; transition: .15s; border: 1.5px solid transparent; }
.cat-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.cat-card__icon { font-size: 2rem; margin-bottom: .5rem; }
.cat-card__name { font-size: .9rem; font-weight: 600; }
.cat-card__count { font-size: .75rem; color: var(--gray-400); margin-top: .25rem; }

/* ── Business Grid ────────────────────────────── */
.business-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.biz-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: .15s; }
.biz-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.biz-card__img { height: 160px; background: linear-gradient(135deg, var(--gray-200), var(--gray-100)); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.biz-card__img img { width: 100%; height: 100%; object-fit: cover; }
.biz-card__body { padding: 1rem; }
.biz-card__cat { font-size: .75rem; color: var(--blue); font-weight: 600; text-transform: uppercase; margin-bottom: .25rem; }
.biz-card__name { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.biz-card__meta { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--gray-600); }
.stars { color: var(--yellow); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; padding: .15rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600; }
.badge-blue { background: #eff6ff; color: var(--blue); }
.badge-green { background: #f0fdf4; color: var(--green); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── Search Layout ────────────────────────────── */
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; padding-top: 2rem; padding-bottom: 2rem; }
.filters { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); height: fit-content; position: sticky; top: 80px; }
.filters__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .5rem; color: var(--gray-600); }
.filter-option { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .9rem; cursor: pointer; }
.filter-option input { cursor: pointer; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { padding: .3rem .8rem; border-radius: 999px; border: 1.5px solid var(--gray-200); font-size: .85rem; transition: .15s; }
.pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.star-btns button { display: block; width: 100%; text-align: left; padding: .35rem 0; font-size: .9rem; color: var(--gray-600); }
.star-btns button:hover, .star-btns button.active { color: var(--blue); font-weight: 600; }
.results__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.results-meta { font-size: .9rem; color: var(--gray-600); }
.results__header select { padding: .4rem .75rem; border-radius: 8px; border: 1.5px solid var(--gray-200); font-size: .9rem; }

/* ── Pagination ───────────────────────────────── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination button { padding: .4rem .8rem; border-radius: 8px; border: 1.5px solid var(--gray-200); font-size: .9rem; }
.pagination button.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Business Detail ──────────────────────────── */
.biz-detail { max-width: 960px; margin: 2rem auto; }
.biz-detail__header { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.biz-detail__photos { display: flex; gap: .5rem; margin-bottom: 1.5rem; overflow-x: auto; }
.biz-detail__photos img { height: 200px; border-radius: 8px; object-fit: cover; }
.biz-detail__title { font-size: 1.8rem; font-weight: 800; margin-bottom: .5rem; }
.biz-detail__meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--gray-600); margin-bottom: 1rem; }
.biz-detail__meta span { display: flex; align-items: center; gap: .25rem; }
.biz-detail__map { height: 300px; border-radius: var(--radius); background: var(--gray-100); margin-top: 1rem; }
.reviews-section { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.review-card { border-bottom: 1px solid var(--gray-200); padding: 1rem 0; }
.review-card:last-child { border-bottom: none; }
.review-card__header { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.review-card__user { font-weight: 600; }
.owner-reply { background: var(--gray-100); border-radius: 8px; padding: .75rem; margin-top: .5rem; font-size: .9rem; }

/* ── Admin ────────────────────────────────────── */
.admin-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--gray-200); }
.tab { padding: .6rem 1.2rem; font-size: .9rem; font-weight: 500; color: var(--gray-600); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab.tab-danger { color: var(--red); }
.tab.tab-danger.active { color: var(--red); border-bottom-color: var(--red); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); text-align: center; }
.stat-card__num { font-size: 2rem; font-weight: 800; color: var(--blue); }
.stat-card__label { font-size: .85rem; color: var(--gray-600); margin-top: .25rem; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--gray-100); padding: .75rem 1rem; text-align: left; font-size: .85rem; color: var(--gray-600); }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-200); font-size: .9rem; }
.data-table tr:last-child td { border-bottom: none; }

/* ── Modals ───────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-wide { max-width: 680px; }
.modal__close { position: absolute; top: 1rem; right: 1rem; font-size: 1.2rem; color: var(--gray-400); }
.modal h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }
.modal__footer { text-align: center; margin-top: 1rem; font-size: .9rem; color: var(--gray-600); }
.modal__footer a { color: var(--blue); }

/* ── Forms ────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--gray-600); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: .6rem .9rem; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: .95rem; outline: none; transition: .15s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--blue); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.err { color: var(--red); font-size: .85rem; padding: .5rem; background: #fef2f2; border-radius: 8px; margin-bottom: .5rem; }

/* ── Star Rating ──────────────────────────────── */
.star-rating { display: flex; gap: .25rem; font-size: 2rem; color: var(--gray-200); cursor: pointer; margin-bottom: .5rem; }
.star-rating span.on { color: var(--yellow); }

/* ── User menu ────────────────────────────────── */
.user-menu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 1rem; }
.dropdown { display: none; position: absolute; right: 0; top: calc(100% + .5rem); background: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 160px; overflow: hidden; z-index: 50; }
.dropdown.open { display: block; }
.dropdown a { display: block; padding: .7rem 1rem; font-size: .9rem; color: var(--gray-800); }
.dropdown a:hover { background: var(--gray-100); }
.dropdown hr { border: none; border-top: 1px solid var(--gray-200); margin: .25rem 0; }

/* ── Toast ────────────────────────────────────── */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: #1e293b; color: #fff; padding: .75rem 1.5rem; border-radius: var(--radius); font-size: .9rem; opacity: 0; transform: translateY(10px); transition: .3s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ── Skeleton ─────────────────────────────────── */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); height: 120px; }
.skeleton-card { height: 260px; border-radius: var(--radius); }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Footer ───────────────────────────────────── */
.footer { background: var(--gray-800); color: var(--gray-400); padding: 2rem 0; margin-top: 4rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; }

/* ── Status badges ────────────────────────────── */
.status-pending   { color: #d97706; background: #fffbeb; }
.status-active    { color: #16a34a; background: #f0fdf4; }
.status-rejected  { color: var(--red); background: #fef2f2; }
.status-suspended { color: var(--gray-600); background: var(--gray-100); }

/* ── Autocomplete ── */
.search-wrap { position: relative; flex: 1; }
.suggestions-box { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 999; overflow: hidden; }
.suggestion-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; cursor: pointer; transition: background .15s; }
.suggestion-item:hover, .suggestion-item.active { background: var(--gray-100); }
.suggestion-item__icon { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.suggestion-item__icon.cat { background: #eff6ff; }
.suggestion-item__text { flex: 1; min-width: 0; }
.suggestion-item__label { font-size: .9rem; font-weight: 500; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-item__sub { font-size: .75rem; color: var(--gray-400); }
.suggestion-item__badge { font-size: .7rem; padding: .15rem .5rem; border-radius: 999px; background: #eff6ff; color: var(--blue); flex-shrink: 0; }

@media (max-width: 768px) {
    .search-layout { grid-template-columns: 1fr; }
    .filters { position: static; }
    .hero h1 { font-size: 1.5rem; }
    .hero__search { flex-direction: column; }
    .footer__inner { flex-direction: column; gap: 1rem; text-align: center; }
    .navbar__search { display: none; }
}
