:root {
  --brand: #ff385c;
  --brand-dark: #e31c5f;
  --ink: #222222;
  --muted: #6a6a6a;
  --line: #dddddd;
  --soft: #f7f7f7;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  --max: 1760px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
img { display: block; max-width: 100%; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 80px); }
.container.narrow { max-width: 1200px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid #ebebeb; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.logo svg { width: 32px; height: 32px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.host-link { font-size: 14px; font-weight: 600; padding: 12px; border-radius: 22px; }
.host-link:hover { background: var(--soft); }
.user-menu { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 24px; padding: 5px 5px 5px 12px; transition: box-shadow .2s; }
.user-menu:hover { box-shadow: 0 2px 4px rgba(0,0,0,.18); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: #717171; color: #fff; display: grid; place-items: center; }
.user-avatar svg { width: 18px; height: 18px; }

/* ---------- Search pill ---------- */
.search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 40px; box-shadow: 0 3px 12px rgba(0,0,0,.08); background: #fff; max-width: 850px; width: 100%; margin: 0 auto; }
.search-field { flex: 1; padding: 12px 24px; border-radius: 40px; min-width: 0; cursor: pointer; }
.search-field:hover { background: #ebebeb; }
.search-field:focus-within { background: #fff; box-shadow: var(--shadow); }
.search-field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.search-field input, .search-field select { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); width: 100%; padding: 0; }
.search-field input::placeholder { color: var(--muted); }
.search-divider { width: 1px; height: 32px; background: var(--line); }
.search-btn { background: var(--brand); color: #fff; border-radius: 30px; height: 48px; min-width: 48px; margin: 8px; padding: 0 16px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.search-btn:hover { background: var(--brand-dark); }
.search-btn svg { width: 16px; height: 16px; }
.search-wrap { padding: 8px 0 24px; }

/* ---------- Categories ---------- */
.categories-bar { position: sticky; top: 80px; z-index: 40; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.categories-row { display: flex; align-items: center; gap: 24px; }
.categories { display: flex; gap: 36px; overflow-x: auto; scrollbar-width: none; flex: 1; padding-top: 12px; }
.categories::-webkit-scrollbar { display: none; }
.category { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; opacity: .8; }
.category span.icon { font-size: 24px; filter: grayscale(1); }
.category:hover { color: var(--ink); border-bottom-color: var(--line); opacity: 1; }
.category.active { color: var(--ink); border-bottom-color: var(--ink); opacity: 1; }
.category.active span.icon, .category:hover span.icon { filter: none; }
.filter-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.filter-btn:hover { border-color: var(--ink); }
.toggle { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.switch { width: 32px; height: 20px; border-radius: 12px; background: #b0b0b0; position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; }
.toggle[aria-pressed="true"] .switch { background: var(--ink); }
.toggle[aria-pressed="true"] .switch::after { transform: translateX(12px); }

/* ---------- Listing grid ---------- */
.results-meta { padding: 24px 0 0; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.clear-link { text-decoration: underline; font-weight: 600; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 40px 24px; padding: 24px 0 64px; }
.card { display: block; position: relative; }
.card-media { position: relative; aspect-ratio: 20 / 19; border-radius: var(--radius); overflow: hidden; background: #eee; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.card-badge { position: absolute; top: 12px; left: 12px; background: #fff; border-radius: 16px; padding: 5px 10px; font-size: 13px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.heart { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; z-index: 2; }
.heart svg { width: 24px; height: 24px; fill: rgba(0,0,0,.5); stroke: #fff; stroke-width: 2; transition: transform .15s; }
.heart:hover svg { transform: scale(1.1); }
.heart.saved svg { fill: var(--brand); }
.slide-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; opacity: 0; transition: opacity .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); z-index: 2; }
.slide-btn svg { width: 12px; height: 12px; }
.slide-btn.prev { left: 12px; }
.slide-btn.next { right: 12px; }
.card:hover .slide-btn { opacity: 1; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.6); }
.dots i.on { background: #fff; }
.card-body { padding-top: 12px; font-size: 15px; line-height: 1.35; }
.card-top { display: flex; justify-content: space-between; gap: 8px; }
.card-title { font-weight: 600; }
.card-rating { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-rating svg, .star svg { width: 12px; height: 12px; }
.card-sub { color: var(--muted); }
.card-price { margin-top: 6px; }
.card-price b { font-weight: 600; }
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 22px; margin: 0 0 8px; }
.btn-outline { display: inline-block; margin-top: 16px; border: 1px solid var(--ink); border-radius: 8px; padding: 12px 22px; font-weight: 600; color: var(--ink); }

/* ---------- Footer ---------- */
.footer { background: var(--soft); border-top: 1px solid var(--line); padding: 48px 0 24px; font-size: 14px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.footer h4 { margin: 0 0 16px; font-size: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.footer a:hover { text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; }

/* ---------- Listing detail ---------- */
.detail-head { padding-top: 24px; }
.detail-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.detail-title { font-size: 26px; font-weight: 600; margin: 0; }
.detail-actions { display: flex; gap: 8px; }
.ghost-btn { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: underline; padding: 8px; border-radius: 8px; }
.ghost-btn:hover { background: var(--soft); }
.ghost-btn svg { width: 16px; height: 16px; }
.ghost-btn.saved svg { fill: var(--brand); stroke: var(--brand); }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: min(56vw, 480px); margin-top: 24px; border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: filter .2s; }
.gallery img:hover { filter: brightness(.88); }
.gallery img:first-child { grid-row: span 2; }
.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 80px; padding: 48px 0; }
.section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 0; }
.section h2 { font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.section p { line-height: 1.6; margin: 0; }
.muted { color: var(--muted); }
.host-row { display: flex; gap: 16px; align-items: center; }
.host-avatar { width: 48px; height: 48px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex-shrink: 0; }
.highlights { display: grid; gap: 24px; }
.highlight { display: flex; gap: 20px; align-items: flex-start; }
.highlight .ic { font-size: 22px; width: 28px; }
.highlight b { display: block; margin-bottom: 2px; }
.amenities { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.amenity { display: flex; gap: 14px; align-items: center; }
.booking { position: sticky; top: 112px; align-self: start; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.booking-price { font-size: 22px; font-weight: 600; }
.booking-price span { font-size: 16px; font-weight: 400; }
.booking-fields { border: 1px solid #b0b0b0; border-radius: 8px; margin: 24px 0 16px; overflow: hidden; }
.booking-fields .row { display: grid; grid-template-columns: 1fr 1fr; }
.booking-fields .bf { padding: 10px 12px; }
.booking-fields .row .bf:first-child { border-right: 1px solid #b0b0b0; }
.booking-fields .row + .bf { border-top: 1px solid #b0b0b0; }
.booking-fields label { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.booking-fields input, .booking-fields select { border: 0; outline: 0; font: inherit; font-size: 14px; width: 100%; padding: 2px 0 0; background: transparent; }
.primary-btn { width: 100%; padding: 14px; border-radius: 8px; color: #fff; font-size: 16px; font-weight: 600; background: linear-gradient(to right, #e61e4d, #e31c5f 50%, #d70466); }
.primary-btn:hover { filter: brightness(.95); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; }
.booking-note { text-align: center; font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.breakdown { margin-top: 20px; display: grid; gap: 14px; }
.breakdown .line { display: flex; justify-content: space-between; }
.breakdown .line span:first-child { text-decoration: underline; }
.breakdown .total { border-top: 1px solid var(--line); padding-top: 20px; font-weight: 700; }
.breakdown .total span:first-child { text-decoration: none; }
.review-summary { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 600; margin-bottom: 24px; }
.reviews { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 64px; }
.review .who { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.review .who .host-avatar { width: 40px; height: 40px; font-size: 16px; }
.review small { color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-top: 16px; }
.back-link:hover { text-decoration: underline; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal.open { display: flex; }
.modal-card { background: #fff; border-radius: 16px; max-width: 480px; width: 100%; padding: 32px; text-align: center; animation: pop .25s ease; }
.modal-card h3 { font-size: 22px; margin: 8px 0; }
.modal-card .big { font-size: 48px; }
@keyframes pop { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.lightbox { position: fixed; inset: 0; background: #000; z-index: 110; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; max-width: 92vw; border-radius: 8px; }
.lightbox button { position: absolute; color: #fff; font-size: 28px; padding: 16px; }
.lightbox .lb-close { top: 12px; left: 12px; font-size: 16px; font-weight: 600; }
.lightbox .lb-prev { left: 12px; top: 50%; }
.lightbox .lb-next { right: 12px; top: 50%; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: transform .3s; z-index: 120; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 950px) {
  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .booking { position: static; }
  .host-link { display: none; }
}
@media (max-width: 744px) {
  .header-row { height: 64px; }
  .categories-bar { top: 64px; }
  .search { flex-direction: column; border-radius: 20px; align-items: stretch; }
  .search-divider { display: none; }
  .search-field { border-radius: 12px; padding: 10px 18px; }
  .search-btn { justify-content: center; }
  .toggle { display: none; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 280px; }
  .gallery img:not(:first-child) { display: none; }
  .gallery img:first-child { grid-row: auto; }
  .amenities, .reviews { grid-template-columns: 1fr; }
  .logo .wordmark { display: none; }
}
