/* === Design System === */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #0e1726;
  --ink-soft: #4a5568;
  --muted: #8a93a6;
  --line: #e6e3dd;
  --gold: #b8893d;
  --gold-soft: #d4a960;
  --primary: #0e1726;
  --primary-foreground: #f7f5f1;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(14,23,38,.06);
  --shadow-md: 0 12px 32px rgba(14,23,38,.10);
  --shadow-lg: 0 24px 60px rgba(14,23,38,.18);
  --transition: .25s ease;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: 'Playfair Display', serif; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* === Header === */
.site-header {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--gold); font-size: 1.3rem; }
.menu { display: flex; gap: 28px; align-items: center; }
.menu a { font-weight: 500; font-size: .95rem; color: var(--ink-soft); }
.menu a:hover { color: var(--ink); }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent; transition: var(--transition); }
.btn-primary { background: var(--ink); color: var(--primary-foreground); }
.btn-primary:hover { background: #1a2740; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 10px 18px; }
.btn-ghost:hover { background: var(--ink); color: white; }
.btn-danger { background: #b94545; color: white; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* === Hero === */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(14,23,38,.65), rgba(14,23,38,.35)),
    url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?w=1920&q=80') center/cover;
  color: white;
  padding: 120px 0 160px;
}
.hero h1 { color: white; max-width: 760px; }
.hero p { font-size: 1.15rem; max-width: 600px; opacity: .92; margin-bottom: 36px; }
.hero .tag { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); font-size: .85rem; margin-bottom: 24px; backdrop-filter: blur(8px); }

/* === Search bar === */
.search-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  margin-top: -60px;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.search-bar .field { display: flex; flex-direction: column; gap: 6px; }
.search-bar label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.search-bar select, .search-bar input {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: var(--transition);
}
.search-bar select:focus, .search-bar input:focus { border-color: var(--gold); background: white; }
@media (max-width: 768px) { .search-bar { grid-template-columns: 1fr 1fr; margin-top: -30px; } }

/* === Section === */
.section { padding: 80px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.section-head .eyebrow { color: var(--gold); font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 600; }

/* === Cards === */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 4/3; overflow: hidden; position: relative; background: #e9e6e0; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-img img { transform: scale(1.06); }
.card-badge { position: absolute; top: 14px; left: 14px; background: var(--gold); color: white; padding: 5px 12px; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.card-finalidade { position: absolute; top: 14px; right: 14px; background: rgba(14,23,38,.85); color: white; padding: 5px 12px; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-loc { font-size: .82rem; color: var(--muted); }
.card-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 600; }
.card-price { font-size: 1.4rem; font-weight: 700; color: var(--ink); margin-top: auto; }
.card-meta { display: flex; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .85rem; }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* === Detail === */
.detail-hero { background: var(--surface); padding: 40px 0; border-bottom: 1px solid var(--line); }
.detail-gallery { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #e9e6e0; margin-bottom: 30px; }
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 30px 0; }
.spec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-align: center; }
.spec strong { display: block; font-size: 1.4rem; color: var(--gold); }
.spec span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sidebar-card { position: sticky; top: 100px; background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); }

/* === Forms === */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.form input, .form select, .form textarea {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: var(--transition);
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--gold); background: white; }
.form textarea { resize: vertical; min-height: 110px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* === Alert === */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .9rem; }
.alert-success { background: #e6f4ea; color: #1f6b3a; border: 1px solid #b8dec5; }
.alert-error { background: #fdecec; color: #9b2b2b; border: 1px solid #f3c4c4; }

/* === Footer === */
.site-footer { background: var(--ink); color: #c9cfdb; padding: 60px 0 30px; margin-top: 80px; }
.site-footer h4 { color: white; font-family: 'Inter', sans-serif; font-size: 1rem; margin-bottom: 16px; }
.site-footer a { display: block; color: #c9cfdb; padding: 4px 0; font-size: .9rem; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.copy { padding-top: 24px; text-align: center; font-size: .82rem; color: var(--muted); }

/* === Admin === */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ink), #1a2740); padding: 20px; }
.auth-card { background: white; padding: 44px; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card p { color: var(--muted); margin: 0 0 26px; font-size: .9rem; }

.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--ink); color: #c9cfdb; padding: 30px 0; }
.admin-sidebar .logo { padding: 0 26px 30px; font-family: 'Playfair Display', serif; font-size: 1.3rem; color: white; }
.admin-sidebar a { display: block; padding: 12px 26px; color: #c9cfdb; font-size: .92rem; border-left: 3px solid transparent; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.05); border-left-color: var(--gold); color: white; }
.admin-main { padding: 36px 40px; background: var(--bg); }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; margin-bottom: 36px; }
.stat { background: white; padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .value { font-size: 2rem; font-weight: 700; font-family: 'Playfair Display', serif; color: var(--ink); margin-top: 4px; }

.table { width: 100%; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border-collapse: collapse; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table th { background: #fafaf7; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 8px; }
.thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 6px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--line); color: var(--ink-soft); }
.badge-gold { background: var(--gold); color: white; }

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; overflow-x: auto; padding: 14px; }
  .admin-sidebar a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .menu { display: none; }
}
