/* ═══ Design Tokens ═══ */
:root {
  --primary: #b2a384;
  --primary-dark: #283851;
  --primary-hgl: #e8414f;
  --bg: #f8f8f6;
  --bg-card: #fff;
  --text: #283851;
  --text-muted: #6b7280;
  --border: #e5e5e5;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font: 'FactorB-Regular', system-ui, -apple-system, sans-serif;
  --font-bold: 'FactorB-Bold', system-ui, -apple-system, sans-serif;
  --container: 1100px;
}

/* ═══ Reset ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-bold); line-height: 1.3; }

/* ═══ Layout ═══ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* ═══ Header ═══ */
.site-header { background: var(--primary-dark); color: #fff; padding: 12px 0; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 20px; }
.logo { color: #fff; font-family: var(--font-bold); font-size: 18px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 16px; flex: 1; }
.main-nav a { color: rgba(255,255,255,0.85); font-size: 14px; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-picker { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.3); border-radius: 4px; padding: 4px 6px; font-size: 12px; }
.lang-picker option { color: #333; }
.btn-icon { color: rgba(255,255,255,0.85); font-size: 18px; }

/* ═══ Hero ═══ */
.hero { background: var(--primary-dark); color: #fff; padding: 48px 0 32px; text-align: center; }
.hero h1 { font-size: 32px; margin-bottom: 8px; }
.hero-subtitle { font-size: 18px; opacity: 0.85; margin-bottom: 4px; }
.hero-count { font-size: 14px; opacity: 0.65; margin-bottom: 24px; }
.hero-search { display: flex; max-width: 500px; margin: 0 auto 20px; gap: 8px; }
.search-input { flex: 1; padding: 12px 16px; border: none; border-radius: var(--radius); font-size: 15px; font-family: var(--font); }
.quick-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.quick-link { color: rgba(255,255,255,0.9); font-size: 14px; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.25); border-radius: 20px; }
.quick-link:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

/* ═══ Buttons ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--radius); font-family: var(--font-bold); font-size: 14px; border: none; cursor: pointer; transition: opacity 0.15s; }
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn-primary { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* ═══ Breadcrumbs ═══ */
.breadcrumbs { padding: 12px 0; font-size: 13px; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs span { margin: 0 4px; }

/* ═══ Place Detail ═══ */
.place-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 16px; }
.place-header h1 { font-size: 24px; margin: 4px 0; }
.place-location { color: var(--text-muted); font-size: 14px; }
.place-type-badge { display: inline-block; font-size: 11px; font-family: var(--font-bold); padding: 2px 8px; border-radius: 4px; }
.type-1 { background: #dbeafe; color: #1e40af; }
.type-2 { background: #dcfce7; color: #166534; }
.type-4 { background: #fef3c7; color: #92400e; }
.type-24 { background: #fce7f3; color: #9d174d; }
.place-meta { text-align: right; flex-shrink: 0; }
.rating-badge { display: flex; align-items: center; gap: 4px; font-size: 16px; }
.star { color: #f5a623; }
.rating-count { font-size: 12px; color: var(--text-muted); }
.price-badge { font-size: 20px; font-family: var(--font-bold); color: var(--primary-dark); }

/* ═══ Gallery ═══ */
.gallery { margin-bottom: 20px; }
.gallery-main img { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 450px; }
.gallery-thumbs { display: flex; gap: 6px; margin-top: 6px; overflow-x: auto; }
.gallery-thumbs img { width: 100px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; opacity: 0.8; transition: opacity 0.15s; }
.gallery-thumbs img:hover { opacity: 1; }
.gallery-more { display: flex; align-items: center; justify-content: center; min-width: 100px; background: var(--bg); border-radius: var(--radius-sm); font-size: 14px; color: var(--text-muted); }

/* ═══ Map ═══ */
.place-map { height: 250px; border-radius: var(--radius); margin-bottom: 20px; background: var(--bg); }
.home-map { height: 400px; }
#home-map { height: 100%; }

/* ═══ Facilities ═══ */
.facilities { margin-bottom: 20px; }
.facility-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.facility-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg); border-radius: 20px; font-size: 13px; }

/* ═══ Facility Grid (full) ═══ */
.facility-grid-full { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 20px; }
.facility-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.facility-row img { width: 22px; height: 22px; opacity: 0.7; }
.facility-label { flex: 1; }
.facility-status { font-size: 14px; font-weight: bold; width: 20px; text-align: center; }
.facility-status-1 { color: #16a34a; }
.facility-status-0 { color: #dc2626; }
.facility-status-2 { color: #9ca3af; }

/* ═══ Tag Pills ═══ */
.tag-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--bg); border-radius: 20px; font-size: 13px; color: var(--text); }
.tag-pill .fa-icon { font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 14px; color: var(--primary); }

/* ═══ Star Rating ═══ */
.stars { display: inline-flex; gap: 1px; }
.star-filled { color: #f08272; }
.star-empty { color: #ddd; }
.stars .fa-star { font-size: 14px; }

/* ═══ Open/Closed Badges ═══ */
.open-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: #dcfce7; color: #166534; border-radius: 12px; font-size: 12px; font-family: var(--font-bold); }
.closed-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: #fef2f2; color: #991b1b; border-radius: 12px; font-size: 12px; font-family: var(--font-bold); }

/* ═══ Free Price Badge ═══ */
.price-free { display: inline-block; padding: 2px 10px; background: #dcfce7; color: #166534; border-radius: 12px; font-size: 13px; font-family: var(--font-bold); }

/* ═══ Gallery Lightbox ═══ */
.gallery { position: relative; margin-bottom: 20px; }
.gallery-main { position: relative; cursor: pointer; }
.gallery-count-badge { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.6); color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.gallery-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.lb-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 28px; cursor: pointer; z-index: 2001; background: none; border: none; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 32px; cursor: pointer; background: rgba(0,0,0,0.3); border: none; padding: 10px 14px; border-radius: 8px; z-index: 2001; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.7); font-size: 14px; }
.lb-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; }

/* ═══ Place Info Bar ═══ */
.place-info-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.place-info-bar > * { font-size: 13px; }
.capacity-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); }

/* ═══ Season Info ═══ */
.season-info { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

/* ═══ Result Type Overlay ═══ */
.result-card { position: relative; }
.result-type-overlay { position: absolute; top: 8px; left: 8px; }

/* ═══ Place Card Type Badge ═══ */
.place-card { position: relative; }
.place-card .card-image-wrap { position: relative; }
.place-card .card-image-wrap .place-type-badge { position: absolute; top: 8px; left: 8px; z-index: 1; }

/* ═══ Description ═══ */
.description { margin-bottom: 20px; }
.description-text { font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-line; }

/* ═══ Contact ═══ */
.contact-info { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.contact-link { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--bg); border-radius: var(--radius-sm); font-size: 13px; }
.contact-link:hover { background: var(--border); text-decoration: none; }

/* ═══ Navigation ═══ */
.navigation-links { margin-bottom: 20px; }
.coords { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* ═══ Reviews ═══ */
.reviews { margin-bottom: 24px; }
.review-card { padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.review-date { color: var(--text-muted); }
.review-rating { color: #f5a623; }
.review-text { font-size: 14px; }

/* ═══ App Banner ═══ */
.app-banner { text-align: center; padding: 24px; background: var(--bg); border-radius: var(--radius); margin-bottom: 24px; }
.app-banner p { margin-bottom: 12px; font-size: 14px; color: var(--text-muted); }
.store-links { margin-top: 10px; display: flex; justify-content: center; gap: 12px; }
.store-links a { font-size: 13px; color: var(--text-muted); }

/* ═══ Place Grid / Cards ═══ */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.place-card { display: block; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.place-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); text-decoration: none; }
.place-card img { width: 100%; height: 180px; object-fit: cover; }
.place-card-body { padding: 12px; }
.place-card-body h3 { font-size: 15px; margin: 4px 0; }
.place-card-body p { font-size: 13px; color: var(--text-muted); }
.place-card-meta { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }

.nearby-places { margin-bottom: 32px; }
.nearby-places h2 { margin-bottom: 16px; }

/* ═══ Footer ═══ */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,0.7); padding: 32px 0; margin-top: 40px; }
.footer-inner { text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 12px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 13px; }
.footer-apps { margin-bottom: 12px; }
.footer-apps a { color: rgba(255,255,255,0.7); font-size: 13px; margin: 0 8px; }
.footer-copy { font-size: 12px; opacity: 0.5; }

/* ═══ Search Page ═══ */
.search-layout { display: flex; gap: 20px; padding: 16px; max-width: 1200px; margin: 0 auto; }
.search-sidebar { width: 280px; flex-shrink: 0; }
.search-results { flex: 1; min-width: 0; }
.search-map { height: 350px; border-radius: var(--radius); margin-bottom: 16px; background: var(--bg); }
#search-map { height: 100%; border-radius: var(--radius); }
.results-header { margin-bottom: 16px; }
.results-header h1 { font-size: 20px; }
.active-filters { display: flex; gap: 6px; margin-top: 8px; }
.filter-tag { font-size: 11px; padding: 2px 8px; background: var(--primary-dark); color: #fff; border-radius: 10px; }

.filter-form { position: sticky; top: 70px; }
.filter-group { margin-bottom: 14px; }
.filter-group label { display: block; font-size: 12px; font-family: var(--font-bold); color: var(--text-muted); margin-bottom: 4px; }
.filter-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; }

/* Autocomplete dropdown */
.autocomplete-dropdown { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 12px rgba(0,0,0,0.12); z-index: 100; max-height: 280px; overflow-y: auto; }
.autocomplete-dropdown:empty { display: none; }
.ac-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.ac-active { background: #f0efe8; }
.ac-icon { font-size: 16px; flex-shrink: 0; }
.ac-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-checks { display: flex; flex-direction: column; gap: 4px; }
.check-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-card { display: flex; gap: 12px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); transition: box-shadow 0.15s; }
.result-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.result-img-wrap { position: relative; flex-shrink: 0; width: 160px; height: 110px; }
.result-img-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.result-type-overlay { position: absolute; top: 6px; left: 6px; font-size: 10px; }
.result-price-overlay { position: absolute; bottom: 6px; left: 6px; font-size: 10px; }
.result-facilities { display: flex; gap: 4px; margin-top: 6px; }
.result-facilities img { width: 16px; height: 16px; opacity: 0.6; }
.result-info { flex: 1; }
.result-info h2 { font-size: 15px; margin: 2px 0; }
.result-city { font-size: 13px; color: var(--text-muted); }
.result-meta { display: flex; gap: 10px; margin-top: 6px; font-size: 13px; }
.result-rating { color: #f5a623; }
.result-price { font-family: var(--font-bold); }
.no-results { padding: 40px; text-align: center; color: var(--text-muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.page-info { font-size: 13px; color: var(--text-muted); }

/* ═══ Chip (shared) ═══ */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-card); font-size: 13px; font-family: var(--font); cursor: pointer; transition: background 0.15s; }
.chip:hover { background: var(--bg); }
.chip.active { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.chip input[type="radio"] { display: none; }

/* ═══ Trip Planner ═══ */
.tp-page { padding: 24px 0; }
.tp-page h1 { margin-bottom: 4px; }
.tp-subtitle { color: var(--text-muted); margin-bottom: 4px; }
.tp-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.tp-layout { display: flex; gap: 24px; }
.tp-form { width: 400px; flex-shrink: 0; }
.tp-results { flex: 1; min-width: 0; }
.tp-map { height: 400px; border-radius: var(--radius); background: var(--bg); margin-bottom: 16px; }
#tp-map { height: 100%; border-radius: var(--radius); }

.form-group { margin-bottom: 14px; }
.form-group > label { display: block; font-size: 12px; font-family: var(--font-bold); color: var(--text-muted); margin-bottom: 4px; }
.form-row { display: flex; align-items: center; justify-content: space-between; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; cursor: pointer; transition: 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--primary-dark); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Loading overlay */
.tp-loading { position: fixed; inset: 0; background: rgba(248,248,246,0.9); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.tp-loading-box { text-align: center; padding: 32px; background: var(--bg-card); border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary-dark); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.tp-loading-hint { color: var(--text-muted); font-size: 12px; margin-top: 8px; max-width: 220px; display: block; }

/* Itinerary cards */
.tp-summary { margin-bottom: 20px; }
.tp-summary h2 { font-size: 16px; font-style: italic; color: var(--text-muted); }
.day-card { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--bg-card); }
.day-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.day-meta { font-size: 13px; color: var(--text-muted); }
.day-highlights { font-size: 13px; margin: 6px 0; }
.day-pois { margin: 6px 0; }
.poi-link { font-size: 12px; color: var(--primary-dark); margin-right: 8px; }
.overnight-card { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 8px; align-items: center; }
.overnight-card:hover { text-decoration: none; background: var(--bg); }
.overnight-card img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.overnight-card div { font-size: 13px; }
.overnight-card strong { display: block; }
.overnight-card span { margin-right: 8px; color: var(--text-muted); }
.day-alts { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.day-alts a { color: var(--primary-dark); }
.tp-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ═══ Routes / Lists ═══ */
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.route-card { display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); transition: box-shadow 0.15s; }
.route-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.route-card h3 { font-size: 16px; margin-bottom: 6px; }
.route-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.route-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); }
.route-detail { margin-bottom: 32px; }
.route-meta-detail { display: flex; gap: 12px; margin: 12px 0 20px; font-size: 14px; color: var(--text-muted); }
.route-map { height: 400px; border-radius: var(--radius); margin-bottom: 20px; background: var(--bg); }
#route-detail-map { height: 100%; border-radius: var(--radius); }
.route-waypoints { margin-bottom: 24px; }
.route-waypoints h2 { margin-bottom: 12px; }

/* ═══ Country ═══ */
.country-header { margin-bottom: 16px; }
.country-stats { color: var(--text-muted); font-size: 14px; }
.country-map { height: 350px; border-radius: var(--radius); margin-bottom: 24px; background: var(--bg); }
#country-map { height: 100%; border-radius: var(--radius); }
.cta-section { text-align: center; padding: 32px; background: var(--bg); border-radius: var(--radius); margin: 32px 0; }
.cta-section h2 { margin-bottom: 8px; }
.cta-section p { color: var(--text-muted); margin-bottom: 16px; }

/* ═══ Auth ═══ */
.auth-page { padding: 40px 0; }
.auth-box { max-width: 400px; margin: 0 auto; padding: 32px; background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-box h1 { margin-bottom: 20px; text-align: center; }
.auth-error { background: #fef2f2; color: #991b1b; padding: 10px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; gap: 10px; overflow-x: auto; }
  .hero h1 { font-size: 24px; }
  .place-header { flex-direction: column; }
  .place-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .gallery-main img { max-height: 280px; }
  .search-layout { flex-direction: column; }
  .search-sidebar { width: 100%; }
  .result-card img { width: 100px; height: 80px; }
  .tp-layout { flex-direction: column; }
  .tp-form { width: 100%; }
  .facility-grid-full { grid-template-columns: 1fr; }
  .gallery-lightbox .lb-prev, .gallery-lightbox .lb-next { font-size: 24px; padding: 8px 10px; }
}
