:root {
  --cream: #f3efe8;
  --paper: #fffdf9;
  --ink: #161616;
  --muted: #6b655e;
  --line: #e4ddd3;
  --orange: #e67a22;
  --orange-dark: #c45f12;
  --black: #0b0b0b;
  --silver: #cfc9c0;
  --ok: #2f7d4a;
  --radius: 22px;
  --shadow: 0 18px 40px rgba(20, 16, 10, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--black); color: #fff;
  display: flex; align-items: center; gap: 24px;
  padding: 8px 28px 8px 210px;
  min-height: 58px;
  transition: min-height .25s ease, padding .25s ease;
}
.site-header.is-tight { min-height: 52px; }
.brand {
  position: absolute;
  left: 16px;
  top: 4px;
  z-index: 45;
  line-height: 0;
}
.brand img {
  height: 132px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}
.site-header.is-tight .brand img { height: 108px; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: #f3f3f3; font-size: 14px; letter-spacing: .04em; }
.nav a:hover { color: var(--orange); }
.phone { color: var(--orange); font-weight: 700; white-space: nowrap; }

.hero {
  position: relative; min-height: 460px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.18) 48%, rgba(0,0,0,.05) 100%),
    url("../img/hero-fallback.jpg") right center / cover no-repeat,
    #1a1a1a;
  color: #fff;
  display: flex; align-items: flex-end;
  padding: 72px 8vw 56px 28px;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 0 0 18px;
  max-width: 11ch;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
  animation: rise .7s ease both;
}
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.section { padding: 48px 0 72px; }
.section h2 { margin: 0 0 8px; font-size: 28px; }
.lede { color: var(--muted); margin: 0 0 28px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateY(18px); opacity: 0;
  animation: rise .55s ease forwards;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .08s; }
.card:nth-child(5) { animation-delay: .16s; }
.card:nth-child(6) { animation-delay: .24s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 22px 46px rgba(20,16,10,.14); }
.card .photo { height: 190px; overflow: hidden; background: #ddd; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .photo img { transform: scale(1.03); }
.card .body { padding: 16px 18px 20px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.price {
  display: inline-block; background: var(--orange); color: #fff;
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px;
}
.price.ghost { background: transparent; color: var(--orange); border: 1.5px solid var(--orange); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip {
  border: 1.5px solid var(--orange); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.chip.on { background: var(--orange); color: #fff; }

.btn {
  display: inline-block; background: var(--orange); color: #fff; border: 0;
  border-radius: 14px; padding: 12px 18px; font-weight: 700; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: var(--orange-dark); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #b42318; }

.detail { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: start; }
.gallery img.main { width: 100%; height: 360px; object-fit: cover; border-radius: 18px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs img { width: 86px; height: 64px; object-fit: cover; border-radius: 10px; cursor: pointer; opacity: .8; }
.thumbs img.on { outline: 2px solid var(--orange); opacity: 1; }
.specs { width: 100%; border-collapse: collapse; margin: 16px 0; }
.specs td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs td:first-child { color: var(--muted); width: 42%; }
.status { display: inline-block; background: #e7f4ea; color: var(--ok); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

.site-footer {
  background: var(--black); color: var(--silver);
  padding: 22px; text-align: center; font-size: 14px;
}

.form { display: grid; gap: 12px; }
.form label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.form input, .form select, .form textarea {
  width: 100%; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: 11px 12px;
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.price-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer;
}
.choice.on { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(230,122,34,.15); }

.modal-bg {
  position: fixed; inset: 0; background: rgba(10,8,6,.45);
  display: none; align-items: center; justify-content: center; z-index: 60;
  padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  width: min(440px, 100%); background: #fff; border-radius: 28px; padding: 28px;
  animation: pop .2s ease;
}
.drop {
  border: 1.5px dashed var(--orange); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted);
}
.preview-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.preview-row img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }

.desk { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--black); color: #fff; padding: 22px 16px; }
.side nav a { display: block; color: #ddd; padding: 10px 12px; border-radius: 12px; margin-bottom: 6px; }
.side nav a.on, .side nav a:hover { background: var(--orange); color: #fff; }
.side img { height: 70px; margin-bottom: 18px; }
.main { padding: 28px; }
.table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 18px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table tr:hover td { background: #faf6f0; }
.flash { background: #e7f4ea; color: var(--ok); padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }
.err { background: #fde8e6; color: #b42318; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }
.login-box { width: min(420px, calc(100% - 32px)); margin: 80px auto; background: var(--paper); padding: 32px; border-radius: 24px; box-shadow: var(--shadow); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 900px) {
  .grid, .detail, .two, .price-mode, .desk { grid-template-columns: 1fr; }
  .nav { display: none; }
  .site-header { padding-left: 120px; min-height: 52px; }
  .brand img { height: 84px; }
  .hero { min-height: 340px; padding-top: 48px; }
  .gallery img.main { height: 240px; }
}
