:root {
  --main: #111827;
  --main-dark: #000000;
  --accent: #ffffff;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button,
input,
select,
textarea {
  font-family: inherit;
}

.page {
  min-height: 100vh;
}

/* Public header */
.hero {
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255,255,255,0.05), transparent 34%),
    linear-gradient(135deg, rgba(0,0,0,0.84), rgba(17,24,39,0.80), rgba(2,6,23,0.90)),
    url('https://images.unsplash.com/photo-1571896349842-33c89424de2d?q=80&w=1600');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 30px 18px 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.22;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -70px -10%;
  height: 130px;
  background: var(--bg);
  border-radius: 50% 50% 0 0;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
  text-align: center;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.brand-title {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.brand-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: 0.5px;
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.15;
  letter-spacing: -1.2px;
  color: #ffffff;
  text-shadow: 0 4px 22px rgba(0,0,0,0.35);
}

.hero p {
  margin: 18px auto 0;
  max-width: 640px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.80);
  line-height: 1.9;
}

.container {
  max-width: 1180px;
  margin: -35px auto 50px;
  padding: 0 18px;
  position: relative;
  z-index: 3;
}

.filters-card {
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.7);
  margin-bottom: 24px;
  backdrop-filter: blur(14px);
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 15px;
  background: #fff;
  transition: 0.2s;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.10);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 26px 0 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.5px;
}

.result-count {
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.chalet-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: 0.25s ease;
  cursor: pointer;
}

.chalet-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.image-wrap {
  position: relative;
  height: 225px;
  background: #e5e7eb;
  overflow: hidden;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.35s ease;
  display: block;
}

.chalet-card:hover .image-wrap img {
  transform: scale(1.05);
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.featured {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #ffffff;
  color: #111827;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.card-body {
  padding: 17px;
}

.card-title h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.3px;
}

.area {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.desc {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
  min-height: 48px;
  margin-bottom: 14px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.meta span {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  color: #374151;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.price {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.price small {
  color: var(--muted);
  font-size: 12px;
}

.price strong {
  font-size: 19px;
  color: #111827;
}

.btn {
  border: 0;
  padding: 11px 15px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.btn-main {
  background: #111827;
  color: #fff;
}

.btn-main:hover {
  background: #000000;
}

.btn-light {
  background: #f3f4f6;
  color: #111827;
}

.btn-light:hover {
  background: #e5e7eb;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-warning {
  background: #fef3c7;
  color: #92400e;
}

.empty,
.loading {
  text-align: center;
  padding: 45px 20px;
  color: var(--muted);
}

.empty {
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius);
  display: none;
}

/* Details modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.76);
  backdrop-filter: blur(8px);
}

.modal.show {
  display: flex;
}

.modal-box {
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.25);
  position: relative;
}

.modal-close {
  position: sticky;
  top: 14px;
  float: left;
  margin: 14px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(17,24,39,0.88);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.details-layout {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.gallery {
  padding: 18px;
  background: #f9fafb;
}

.main-photo {
  width: 100%;
  height: min(62vh, 560px);
  border-radius: 24px;
  overflow: hidden;
  background: #e5e7eb;
  position: relative;
}

.main-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.photo-counter {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.gallery-nav {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.gallery-arrow {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-behavior: smooth;
}

.thumb {
  flex: 0 0 92px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  background: #e5e7eb;
  opacity: 0.72;
  transition: 0.2s;
}

.thumb.active {
  border-color: #111827;
  opacity: 1;
  transform: translateY(-2px);
}

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

.details {
  padding: 8px 28px 28px;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.details-title h2 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.8px;
}

.location {
  color: var(--muted);
  font-size: 15px;
}

.price-summary {
  min-width: 210px;
  background: #111827;
  border: 1px solid #111827;
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  color: #fff;
}

.price-summary small {
  display: block;
  color: rgba(255,255,255,0.72);
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
}

.price-summary strong {
  color: #fff;
  font-size: 24px;
}

.full-desc {
  line-height: 1.9;
  color: #374151;
  margin-bottom: 20px;
  font-size: 15px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.info-box {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px;
}

.info-box small {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
  font-size: 12px;
}

.info-box strong {
  font-size: 16px;
}

.amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

.amenities span {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #e5e7eb;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.btn-whatsapp {
  background: #22c55e;
  color: #fff;
}

.btn-call {
  background: #111827;
  color: #fff;
}

.btn-map {
  background: #f3f4f6;
  color: #111827;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-viewer.show {
  display: flex;
}

.image-viewer img {
  max-width: 96vw;
  max-height: 88vh;
  border-radius: 18px;
  object-fit: contain;
}

.image-viewer button {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  font-size: 26px;
  cursor: pointer;
}

/* Admin */
.admin-header {
  background: linear-gradient(135deg, #000000, #111827, #020617);
  color: #fff;
  padding: 28px 18px 80px;
}

.admin-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-container {
  max-width: 1180px;
  margin: -54px auto 50px;
  padding: 0 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 21px;
}

.panel-body {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.field.full {
  grid-column: span 2;
}

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

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 700;
}

.check-item input {
  width: auto;
}

.preview-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.preview-img {
  height: 90px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f3f4f6;
}

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

.status {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  display: none;
  font-size: 14px;
  line-height: 1.7;
}

.status.success {
  display: block;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status.error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 13px;
  align-items: center;
}

.admin-item-img {
  width: 92px;
  height: 76px;
  border-radius: 14px;
  background: #f3f4f6;
  overflow: hidden;
}

.admin-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.admin-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pill {
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f3f4f6;
  color: #374151;
}

.pill.active {
  background: #dcfce7;
  color: #166534;
}

.pill.hidden {
  background: #fee2e2;
  color: #991b1b;
}

.item-badges,
.item-actions,
.submit-row,
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .gallery {
    padding: 12px;
  }

  .main-photo {
    height: 330px;
    border-radius: 20px;
  }

  .gallery-nav {
    grid-template-columns: 40px 1fr 40px;
  }

  .gallery-arrow {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .thumb {
    flex-basis: 76px;
    height: 62px;
  }

  .details {
    padding: 6px 18px 22px;
  }

  .details-header {
    flex-direction: column;
    gap: 12px;
  }

  .details-title h2 {
    font-size: 25px;
  }

  .price-summary {
    width: 100%;
    min-width: unset;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 25px 16px 56px;
  }

  .topbar {
    align-items: center;
    margin-bottom: 26px;
  }

  .brand-title {
    font-size: 23px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 15px;
    margin-top: 12px;
  }

  .container,
  .admin-container {
    margin-top: -32px;
    padding: 0 13px;
  }

  .filters,
  .grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: span 1;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-wrap {
    height: 220px;
  }

  .modal {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-box {
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
  }

  .main-photo {
    height: 300px;
  }

  .thumb {
    flex-basis: 70px;
    height: 58px;
  }

  .preview-box {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-item {
    grid-template-columns: 76px 1fr;
  }

  .admin-item-img {
    width: 76px;
    height: 70px;
  }
}
