:root {
  --gold:     #C9A84C;
  --gold-lt:  #E8C97A;
  --gold-dk:  #8B6914;
  --crimson:  #8B1A1A;
  --dark:     #1C1008;
  --mid:      #3A2410;
  --cream:    #FAF6EE;
  --ivory:    #F5EDD8;
  --white:    #FFFFFF;
  --shadow:   0 4px 24px rgba(28,16,8,.13);
  --radius:   10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--cream);
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
header {
  background: var(--dark);
  position: sticky; top: 0; z-index: 1000;
  border-bottom: 1px solid rgba(201,168,76,.25);
  box-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.header-top {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;
}
.header-nav { background: rgba(0,0,0,.25); border-top: 1px solid rgba(201,168,76,.12); }
.header-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 2px;
  padding: 0 20px; height: 38px;
}
.logo {
  font-family: 'Cinzel', serif;
  font-weight: 600; font-size: 1.15rem;
  color: var(--gold); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: .5px; white-space: nowrap;
}
.logo span { color: rgba(255,255,255,.75); font-weight: 400; }
.nav-main { display: flex; gap: 2px; align-items: center; }
.nav-main a, .nav-link {
  color: rgba(255,255,255,.55); text-decoration: none; font-size: .8rem;
  padding: 5px 14px; border-radius: 20px;
  letter-spacing: .3px; transition: all .2s; white-space: nowrap;
}
.nav-main a:hover, .nav-main a.active, .nav-link:hover { color: var(--gold-lt); }
.nav-main a.active { background: rgba(201,168,76,.1); }
.btn-add {
  margin-left: auto;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  color: var(--dark) !important; font-weight: 600; font-size: .75rem !important;
  border: 1px solid var(--gold-lt); border-radius: 20px; padding: 4px 14px !important;
  text-decoration: none;
}
.btn-add:hover { filter: brightness(1.1); }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,.7); border-radius: 2px; transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--dark); border-top: 1px solid rgba(201,168,76,.15);
  padding: 8px 20px 16px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: rgba(255,255,255,.65); text-decoration: none;
  padding: 10px 0; font-size: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--gold); }

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, #0E0804 0%, #1C1008 45%, #2A1A08 100%);
  padding: 56px 20px 64px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,  rgba(201,168,76,.06) 0, rgba(201,168,76,.06) 1px, transparent 0, transparent 50%),
    repeating-linear-gradient(-45deg, rgba(201,168,76,.06) 0, rgba(201,168,76,.06) 1px, transparent 0, transparent 50%);
  background-size: 28px 28px; pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero-ornament { display: block; margin: 0 auto 8px; opacity: .55; }
.hero h1 {
  font-family: 'Cinzel', serif; font-size: clamp(1.6rem, 4.5vw, 3rem);
  font-weight: 600; color: var(--white); line-height: 1.15; margin-bottom: 10px;
  position: relative; text-shadow: 0 2px 20px rgba(0,0,0,.6);
}
.hero h1 em {
  font-family: 'Cormorant Garamond', serif; color: var(--gold-lt); font-style: italic;
  display: block; font-size: .52em; letter-spacing: 4px; text-transform: uppercase;
  font-weight: 400; margin-bottom: 4px;
}
.hero p {
  color: rgba(255,255,255,.5); font-size: .95rem; margin-bottom: 32px;
  position: relative; letter-spacing: .3px;
}
.hero-divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 28px; }
.hero-divider::before, .hero-divider::after {
  content: ''; flex: 1; max-width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.5));
}
.hero-divider::after { background: linear-gradient(90deg, rgba(201,168,76,.5), transparent); }
.hero-divider span { display: none; }
.search-bar {
  display: flex; max-width: 580px; margin: 0 auto;
  background: rgba(255,255,255,.96); border-radius: 4px; overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(201,168,76,.3);
}
.search-bar input {
  flex: 1; border: none; outline: none; padding: 14px 20px;
  font-family: 'Cormorant Garamond', serif; font-size: 1.05rem;
  background: transparent; color: var(--dark);
}
.search-bar input::placeholder { color: #aaa; font-style: italic; }
.search-bar button {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  color: var(--dark); border: none; padding: 0 24px; cursor: pointer;
  font-size: 1rem; font-weight: 700; transition: filter .2s;
  display: flex; align-items: center; justify-content: center;
}
.search-bar button:hover { filter: brightness(1.1); }

/* ── STATS ── */
.stats-bar {
  background: linear-gradient(90deg, var(--dark) 0%, var(--mid) 50%, var(--dark) 100%);
  border-top: 1px solid rgba(201,168,76,.2); border-bottom: 1px solid rgba(201,168,76,.2);
  display: flex; justify-content: center; gap: 48px; padding: 14px 16px; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat strong { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--gold); display: block; line-height: 1; }
.stat span { font-size: .72rem; color: rgba(255,255,255,.45); letter-spacing: 1px; text-transform: uppercase; }

/* ── LAYOUT ── */
.main-container {
  max-width: 1200px; margin: 0 auto; padding: 28px 16px;
  display: grid; grid-template-columns: 240px 1fr; gap: 24px;
}
@media (max-width: 768px) { .main-container { grid-template-columns: 1fr; } }

/* ── SIDEBAR ── */
.sidebar { position: relative; }
.sidebar-sticky { position: sticky; top: 100px; }
.sidebar-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(201,168,76,.15); margin-bottom: 16px;
}
.sidebar-title {
  background: var(--dark); color: var(--gold);
  font-family: 'Cinzel', serif; font-weight: 600; font-size: .72rem;
  letter-spacing: 2px; text-transform: uppercase; padding: 11px 16px;
  border-bottom: 1px solid rgba(201,168,76,.2);
}
.province-list { max-height: 400px; overflow-y: auto; }
.province-item {
  display: flex; align-items: center;
  padding: 9px 16px; border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background .15s; font-size: .88rem; color: var(--mid);
  text-decoration: none; cursor: pointer;
}
.province-item:hover { background: var(--ivory); color: var(--dark); }
.province-item.active { background: var(--ivory); color: var(--crimson); font-weight: 600; border-left: 3px solid var(--gold); }

/* ── MAPA ── */
#map {
  height: 220px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid rgba(201,168,76,.2);
}

/* ── FILTROS ── */
.filters-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  border: 1px solid rgba(201,168,76,.3); background: var(--white); border-radius: 3px;
  padding: 6px 16px; font-family: 'Sarabun', sans-serif; font-size: .82rem;
  cursor: pointer; transition: all .2s; color: var(--mid);
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold-dk); }
.filter-btn.active { background: var(--dark); color: var(--gold); border-color: var(--dark); }
.sort-select {
  margin-left: auto; border: 1px solid rgba(201,168,76,.3); border-radius: 3px;
  padding: 6px 14px; font-family: 'Sarabun', sans-serif; font-size: .82rem;
  background: var(--white); color: var(--mid); cursor: pointer;
}

/* ── TARJETAS ── */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; }
.listing-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(201,168,76,.12);
  transition: transform .25s, box-shadow .25s; cursor: pointer; display: block;
  text-decoration: none; color: inherit;
}
.listing-card:hover { transform: translateY(-5px); box-shadow: 0 16px 48px rgba(28,16,8,.2); border-color: rgba(201,168,76,.35); }
.card-img { height: 168px; background: var(--ivory); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.listing-card:hover .card-img img { transform: scale(1.06); }
.card-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(28,16,8,.45) 0%, transparent 55%); }
.card-img .badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: var(--crimson); color: white; font-family: 'Cinzel', serif;
  font-size: .62rem; font-weight: 600; padding: 3px 10px; border-radius: 2px;
  text-transform: uppercase; letter-spacing: 1px;
}
.card-img .badge-thai { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%); color: var(--dark); }
.card-img .badge-select {
  background: linear-gradient(135deg, #FFD700 0%, #C9A84C 50%, #8B6914 100%);
  color: #3A1F00;
  border: 1px solid rgba(255,220,80,.6);
  box-shadow: 0 0 10px rgba(255,210,0,.4), inset 0 1px 0 rgba(255,255,255,.3);
  text-shadow: 0 1px 0 rgba(255,255,180,.4);
  font-size: .65rem; letter-spacing: 1.5px;
}
.card-body { padding: 14px 16px; }
.card-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.15rem; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dark); }
.card-city { font-size: .78rem; color: #999; margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.card-city::before {
  content: '';
  display: inline-block; width: 11px; height: 13px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center/contain;
}
.card-rating { display: flex; align-items: center; gap: 8px; }
.rating-badge { background: var(--dark); color: var(--gold); font-family: 'Cinzel', serif; font-weight: 700; font-size: .9rem; padding: 4px 10px; border-radius: 3px; min-width: 42px; text-align: center; border: 1px solid rgba(201,168,76,.3); }
.rating-details { font-size: .73rem; color: #aaa; }
.card-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.card-link { font-size: .71rem; color: var(--mid); background: var(--ivory); border-radius: 3px; padding: 2px 8px; text-decoration: none; border: 1px solid rgba(201,168,76,.2); transition: all .15s; }
.card-link:hover { background: var(--gold); color: var(--dark); border-color: var(--gold); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  transform: translateY(40px); transition: transform .3s; border-top: 3px solid var(--gold);
}
.modal-overlay.open .modal { transform: translateY(0); }
@media (min-width: 769px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius); max-height: 88vh; border: 1px solid rgba(201,168,76,.3); }
}
.modal-header { position: relative; height: 220px; background: var(--dark); }
.modal-header img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,.6); color: white; border: none;
  border-radius: 50%; width: 36px; height: 36px;
  font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.modal-body { padding: 22px; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; font-weight: 600; margin-bottom: 4px; color: var(--dark); }
.modal-subtitle { color: #999; font-size: .85rem; margin-bottom: 18px; }
.rating-section { background: var(--ivory); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; border: 1px solid rgba(201,168,76,.2); }
.rating-section h3 { font-family: 'Cinzel', serif; font-size: .72rem; margin-bottom: 12px; color: var(--gold-dk); text-transform: uppercase; letter-spacing: 2px; }
.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rating-label { min-width: 80px; font-size: .83rem; color: var(--mid); }
.rating-bar-wrap { flex: 1; height: 6px; background: rgba(0,0,0,.08); border-radius: 3px; overflow: hidden; }
.rating-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold-lt), var(--crimson)); transition: width .6s ease; }
.rating-num { font-family: 'Cinzel', serif; font-weight: 700; font-size: .85rem; min-width: 28px; text-align: right; color: var(--gold-dk); }
.vote-form { margin-top: 16px; }
.vote-form h4 { font-family: 'Cinzel', serif; font-size: .7rem; text-transform: uppercase; letter-spacing: 2px; color: var(--gold-dk); margin-bottom: 12px; }
.score-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.score-label { min-width: 80px; font-size: .83rem; }
.score-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.score-btn { width: 30px; height: 30px; border-radius: 3px; border: 1px solid rgba(201,168,76,.3); background: var(--white); font-size: .78rem; font-weight: 700; cursor: pointer; transition: all .15s; color: var(--mid); }
.score-btn:hover { border-color: var(--gold); background: var(--ivory); color: var(--gold-dk); }
.score-btn.selected { background: var(--dark); border-color: var(--dark); color: var(--gold); }
.btn-submit { background: linear-gradient(135deg, var(--crimson) 0%, #5C1010 100%); color: white; border: none; border-radius: 3px; padding: 11px 24px; width: 100%; font-family: 'Cinzel', serif; font-size: .82rem; font-weight: 600; cursor: pointer; margin-top: 10px; letter-spacing: 1px; transition: filter .2s; }
.btn-submit:hover { filter: brightness(1.15); }
.btn-submit:disabled { background: #ccc; cursor: default; filter: none; }
.photos-strip { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.photos-strip img { height: 80px; width: 120px; object-fit: cover; border-radius: 4px; flex-shrink: 0; cursor: pointer; border: 1px solid rgba(201,168,76,.2); }
.modal-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.modal-link { display: inline-flex; align-items: center; gap: 6px; background: var(--ivory); border-radius: 3px; padding: 6px 14px; font-size: .82rem; text-decoration: none; color: var(--mid); border: 1px solid rgba(201,168,76,.2); transition: all .2s; }
.modal-link:hover { background: var(--dark); color: var(--gold); border-color: var(--dark); }
.comments-section h3 { font-family: 'Cinzel', serif; font-size: .78rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-dk); margin-bottom: 14px; }
.comment { border-bottom: 1px solid var(--ivory); padding: 12px 0; }
.comment-author { font-weight: 600; font-size: .85rem; }
.comment-date { font-size: .73rem; color: #bbb; margin-left: 8px; }
.comment-text { font-size: .88rem; margin-top: 5px; line-height: 1.6; color: #555; }
.comment-form { margin-top: 16px; }
.comment-form textarea, .comment-form input { width: 100%; border: 1px solid rgba(201,168,76,.25); border-radius: 3px; padding: 10px 12px; font-family: 'Sarabun', sans-serif; font-size: .9rem; outline: none; background: var(--cream); color: var(--dark); transition: border .2s; }
.comment-form textarea { resize: vertical; min-height: 80px; }
.comment-form input { margin-bottom: 8px; }
.comment-form textarea:focus, .comment-form input:focus { border-color: var(--gold); }
#detail-map { height: 160px; border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; border: 1px solid rgba(201,168,76,.2); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--dark); color: var(--gold); padding: 12px 24px; border-radius: 3px; font-family: 'Cinzel', serif; font-size: .8rem; letter-spacing: 1px; box-shadow: 0 8px 30px rgba(0,0,0,.4); border: 1px solid rgba(201,168,76,.3); z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 640px) {
  .hero { padding: 40px 16px 48px; }
  .listings-grid { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .hamburger { display: flex; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,.3); border-radius: 3px; }
.skeleton { background: linear-gradient(90deg, var(--ivory) 25%, #ede5ce 50%, var(--ivory) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
