/* ===== PrimeMarket — "Land Registry" design system ===== */
:root {
  --green-dark: #1B2A41;   /* ink navy — headers, sidebar, structure */
  --green: #2E4C74;        /* indigo stamp — links, prices, hover */
  --green-light: #4A6FA5;  /* lighter indigo */
  --gold: #C1440E;         /* laterite red — primary actions */
  --gold-light: #C99A2E;   /* gold seal — accents, stamps */
  --cream: #EFE7D8;        /* parchment paper — page background */
  --text-dark: #201C16;    /* warm near-black — body text */
  --text-muted: #6E6152;   /* warm muted brown-gray */
  --border: #DCD2BB;       /* parchment-tinted border */
  --radius: 4px;
  --shadow: 0 2px 10px rgba(27,42,65,0.08);
  --shadow-hover: 0 14px 32px rgba(27,42,65,0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text-dark);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Zilla Slab', serif; margin: 0 0 .5em; font-weight: 700; }

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

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

img { max-width: 100%; display: block; }

.mono { font-family: 'IBM Plex Mono', monospace; }

.kicker {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

/* ===== Header ===== */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.logo {
  font-family: 'Zilla Slab', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: -.01em;
}
.logo span { color: var(--gold); }

.main-nav { display: flex; gap: 34px; }
.main-nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 2px;
  position: relative;
  transition: color .2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--gold); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--green-dark); border-radius: 1px; }

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 140px 0 120px;
  text-align: center;
  isolation: isolate;
}
.hero-slideshow { position: absolute; inset: 0; z-index: -2; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.8s ease-in-out;
}
.hero-slide.active { opacity: 1; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(27,42,65,0.90), rgba(46,76,116,0.72));
  z-index: -1;
}
/* Site-plan boundary frame — the signature motif */
.hero-frame {
  position: absolute;
  inset: 22px;
  border: 1.5px dashed rgba(239,231,216,0.45);
  z-index: 0;
  pointer-events: none;
  animation: frameSettle 1.1s ease-out;
}
.corner-mark {
  position: absolute;
  width: 22px; height: 22px;
  color: var(--gold-light);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.3rem;
  line-height: 1;
  z-index: 0;
  pointer-events: none;
}
.corner-mark.tl { top: 12px; left: 12px; }
.corner-mark.tr { top: 12px; right: 12px; }
.corner-mark.bl { bottom: 12px; left: 12px; }
.corner-mark.br { bottom: 12px; right: 12px; }
@keyframes frameSettle {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-frame { animation: none; }
}
.hero-content { position: relative; z-index: 1; }
.hero .kicker { color: var(--gold-light); }
.hero h1 { font-size: 3rem; margin-bottom: 16px; text-shadow: 0 2px 14px rgba(0,0,0,0.3); }
.hero p { font-size: 1.12rem; max-width: 600px; margin: 0 auto 34px; opacity: .95; }

.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: var(--radius);
  font-family: 'IBM Plex Mono', monospace;
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn-primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(193,68,14,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: transparent; border: 1.5px dashed rgba(255,255,255,0.7); color: #fff; margin-left: 12px; }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-style: solid; }
.btn-dark { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
.btn-dark:hover { background: var(--green); }
.btn-danger { background: #fff; color: #A5320B; border-color: #A5320B; }
.btn-danger:hover { background: #A5320B; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: .74rem; }

/* ===== Compact page header (About / Services / Contact) ===== */
.page-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 64px 0 58px;
  text-align: center;
  isolation: isolate;
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--green-dark), var(--green));
  z-index: -1;
}
.page-header .hero-frame { inset: 14px; }
.page-header .corner-mark { width: 18px; height: 18px; font-size: 1.1rem; }
.page-header .kicker { color: var(--gold-light); }
.page-header h1 { font-size: 2.3rem; margin-bottom: 8px; position: relative; z-index: 1; }
.page-header p { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; opacity: .92; font-size: 1rem; }

/* ===== Section generic ===== */
.section { padding: 76px 0; }
.section-title { text-align: center; margin-bottom: 12px; font-size: 2.05rem; color: var(--green-dark); }
.section-sub { text-align: center; color: var(--text-muted); max-width: 560px; margin: 0 auto 46px; }
.section > .container > .kicker,
.section .about-grid .kicker { display: block; text-align: center; }

/* ===== Cards / Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--green-light); }
.card-img { height: 200px; width: 100%; object-fit: cover; background: #eee; }
.card-body { padding: 20px; }
.card-body h3 { font-size: 1.12rem; margin-bottom: 6px; }
.card-location { font-family: 'IBM Plex Mono', monospace; color: var(--text-muted); font-size: .82rem; margin-bottom: 10px; }
.card-price { font-family: 'IBM Plex Mono', monospace; color: var(--green); font-weight: 600; font-size: 1.1rem; margin-bottom: 14px; }
.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid currentColor;
  background: transparent;
}
.badge-available { color: var(--green); }
.badge-sold { color: var(--gold); }
.badge-category { color: var(--text-muted); margin-left: 6px; }

/* ===== Shop filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
  justify-content: center;
}
.filters select, .filters input {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: .92rem;
  background: #fff;
}

/* ===== Item detail ===== */
.item-page { padding: 50px 0 80px; }
.item-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 44px; align-items: start; }
.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.gallery-main img { width: 100%; height: 440px; object-fit: cover; cursor: zoom-in; }
.gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.gallery-thumbs img {
  width: 90px; height: 70px; object-fit: cover; border-radius: 3px;
  cursor: pointer; border: 2px solid transparent; flex-shrink: 0;
}
.gallery-thumbs img.active { border-color: var(--gold); }

.item-info h1 { font-size: 1.85rem; }
.item-info .card-price { font-size: 1.55rem; }
.item-info .item-desc { margin: 18px 0; color: #444; font-family: 'IBM Plex Sans', sans-serif; }

.booking-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 24px;
}
.booking-box h3 { margin-bottom: 16px; color: var(--green-dark); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .86rem; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'IBM Plex Sans', sans-serif; font-size: .95rem;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: 2px solid var(--green-light); outline-offset: 1px; border-color: var(--green-light);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: .92rem; border-left: 3px solid; }
.alert-success { background: #EEF3EC; color: #1B2A41; border-color: var(--green); }
.alert-error { background: #FBEAE3; color: #7A2D0C; border-color: var(--gold); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0; background: rgba(20,16,10,.92);
  z-index: 1000; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 3px; }
.lightbox-close { position: absolute; top: 20px; right: 32px; color: #fff; font-size: 2.2rem; cursor: pointer; }

/* ===== About / Services ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-grid img { border: 1px solid var(--border); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 26px; }
.service-card { background: #fff; border: 1px solid var(--border); padding: 32px 26px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.service-card .icon { font-size: 2.2rem; margin-bottom: 14px; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-info p { margin-bottom: 14px; font-family: 'IBM Plex Mono', monospace; font-size: .92rem; }

/* ===== Footer ===== */
.site-footer {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding-top: 54px;
  isolation: isolate;
  border-top: 3px solid var(--gold-light);
}
.footer-slideshow { position: absolute; inset: 0; z-index: -2; }
.site-footer::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(27,42,65,0.93), rgba(46,76,116,0.86));
  z-index: -1;
}
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 30px; }
.footer-col h3 { color: #fff; }
.footer-col h3 span { color: var(--gold-light); }
.footer-col p { color: #D8DEE8; }
.footer-col h4 { color: #fff; margin-bottom: 14px; font-size: .82rem; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .06em; }
.footer-col a { display: block; margin-bottom: 8px; color: #C7D0DE; transition: color .15s; }
.footer-col a:hover { color: var(--gold-light); }
.footer-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; }
.footer-links h4 { width: 100%; margin-bottom: 12px; }
.footer-links a {
  position: relative;
  display: inline-block;
  margin-bottom: 0;
  padding-bottom: 4px;
}
.footer-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.footer-links a:hover::after { transform: scaleX(1); }
.footer-bottom { position: relative; text-align: center; padding: 18px 0; background: rgba(0,0,0,.22); font-size: .8rem; font-family: 'IBM Plex Mono', monospace; color: #C7D0DE; }

/* ===== Admin ===== */
.admin-body { background: #EEE9DD; }
.admin-mobile-bar { display: none; }
.admin-overlay { display: none; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--green-dark); color: #fff; padding: 26px 0; flex-shrink: 0;
}
.logo { display: flex; align-items: center; }
.logo-img { height: 42px; width: auto; display: block; }
.footer-logo { display: flex; align-items: center; margin-bottom: 14px; }
.footer-logo .logo-img { height: 38px; }
.admin-sidebar h2 { padding: 0 24px; font-size: 1.3rem; margin-bottom: 30px; display: flex; align-items: center; }
.admin-sidebar .logo-img { height: 34px; }
.admin-mobile-logo { display: flex; align-items: center; }
.admin-mobile-logo .logo-img { height: 30px; }
.admin-sidebar h2 span { color: var(--gold-light); }
.admin-sidebar a {
  display: block; padding: 13px 24px; color: #C7D0DE; font-weight: 500;
  font-family: 'IBM Plex Mono', monospace; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: #fff; border-left: 3px solid var(--gold-light); }
.admin-main { flex: 1; padding: 32px 40px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-topbar h1 { font-size: 1.55rem; color: var(--green-dark); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 20px; margin-bottom: 34px; }
.stat-card { background: #fff; border: 1px solid var(--border); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card .num { font-family: 'IBM Plex Mono', monospace; font-size: 2rem; font-weight: 700; color: var(--green); }
.stat-card .label { font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-size: .78rem; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.admin-table th { background: #F5F0E4; color: var(--text-muted); font-weight: 600; font-family: 'IBM Plex Mono', monospace; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-table img.thumb { width: 56px; height: 44px; object-fit: cover; border-radius: 3px; }
.actions-cell { display: flex; gap: 8px; }

.admin-form-box { background: #fff; border: 1px solid var(--border); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 720px; }
.image-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.image-preview-grid .img-item { position: relative; width: 100px; height: 80px; }
.image-preview-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.image-preview-grid .del-btn {
  position: absolute; top: -8px; right: -8px; background: var(--gold); color: #fff;
  border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; border: none;
}

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--green-dark);
}
.login-box { background: #fff; padding: 40px; border-radius: var(--radius); width: 360px; box-shadow: var(--shadow-hover); border-top: 3px solid var(--gold-light); }
.login-box h2 { text-align: center; color: var(--green-dark); margin-bottom: 24px; }

/* Admin preview modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(20,16,10,.6);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 28px; position: relative;
  border-top: 3px solid var(--gold-light);
}
.modal-close {
  position: absolute; top: 14px; right: 18px; font-size: 1.6rem; cursor: pointer; color: #888; border: none; background: none;
}
.modal-close:hover { color: #333; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: var(--green); font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .item-layout, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .admin-wrap { flex-direction: column; }

  .admin-mobile-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--green-dark); padding: 16px 20px; position: sticky; top: 0; z-index: 60;
  }
  .admin-mobile-logo { font-family: 'Zilla Slab', serif; font-size: 1.25rem; font-weight: 700; color: #fff; }
  .admin-mobile-logo span { color: var(--gold-light); }
  .admin-nav-toggle {
    display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px;
  }
  .admin-nav-toggle span { width: 24px; height: 2.5px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .admin-nav-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .admin-nav-toggle.active span:nth-child(2) { opacity: 0; }
  .admin-nav-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 80;
    overflow-y: auto; padding: 20px 0;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-overlay {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .admin-overlay.open { opacity: 1; pointer-events: auto; }

  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; z-index: 101; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--cream);
    flex-direction: column; gap: 4px; padding: 12px 20px 18px; display: none;
    box-shadow: 0 8px 16px rgba(0,0,0,.08); border-bottom: 1px solid var(--border);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .main-nav a:last-child { border-bottom: none; }

  .hero { padding: 70px 0 60px; }
  .hero h1 { font-size: 1.9rem; }
  .hero p { font-size: 1rem; padding: 0 6px; }
  .hero-frame { inset: 12px; }
  .corner-mark { width: 16px; height: 16px; font-size: 1rem; }
  .btn-outline { margin-left: 0; }

  .page-header { padding: 48px 0 42px; }
  .page-header h1 { font-size: 1.7rem; }

  .section { padding: 52px 0; }
  .section-title { font-size: 1.6rem; }

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

  .item-info h1 { font-size: 1.5rem; }
  .gallery-main img { height: 260px; }

  .admin-main { padding: 22px 18px; }
  .admin-topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-form-box, .booking-box, .login-box { padding: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
  .hero .btn { display: block; width: 100%; margin: 0 0 12px; }
  .hero .btn:last-child { margin-bottom: 0; }
  .hero h1 { font-size: 1.6rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select, .filters button { width: 100%; }
  .services-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .login-box { width: 92vw; }
  .modal-box { padding: 20px; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .lightbox-close { top: 10px; right: 16px; font-size: 1.8rem; }
}