:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --whatsapp: #25d366;
  --whatsapp-hover: #1ebe5d;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Promo Banner */
.promo-bar {
  background: #fef3c7;
  color: #92400e;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #fde68a;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.site-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Filters */
.filters-wrap {
  margin: 20px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
}

.filter-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

@media (max-width: 520px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.item-card.is-sold {
  opacity: 0.62;
}

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  overflow: hidden;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(4px);
}

.badge-available { background: rgba(15, 118, 110, 0.92); }
.badge-reserved { background: rgba(217, 119, 6, 0.92); }
.badge-sold { background: rgba(75, 85, 99, 0.92); }

.owner-chip {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
}

.card-price-row {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-now {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
}

.price-old {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}

/* Detail Page */
.breadcrumb {
  padding: 16px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 18px;
  }
}

.gallery-main {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  cursor: zoom-in;
  position: relative;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb-btn {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  background: #f3f4f6;
  padding: 0;
}

.thumb-btn.active {
  border-color: var(--primary);
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.detail-price-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-price-box .price-now {
  font-size: 26px;
}

.spec-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.spec-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  background: #f9fafb;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
}

.spec-value {
  padding: 10px 12px;
}

.detail-desc {
  font-size: 14px;
  color: #374151;
  background: #f9fafb;
  padding: 12px 14px;
  border-radius: 10px;
  white-space: pre-line;
}

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--whatsapp);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.28);
  transition: background 0.15s, transform 0.1s;
}

.wa-btn:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
}

.wa-btn.disabled {
  background: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.share-row {
  display: flex;
  gap: 8px;
}

.share-row button {
  flex: 1;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 22px;
  cursor: pointer;
}

/* Section Title & Footer */
.section-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Helper Page */
.helper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.helper-textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0;
  resize: vertical;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  grid-column: 1 / -1;
}
