/* Great Project — Catalog styles */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #6a6a6a;
  --border: #e3e0da;
  --accent: #c8423b;
  --accent-soft: #fbeae9;
  --topbar-blue: #f69d03;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --radius: 8px;
  --max: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- Topbar (blue menu band) ---------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 3px solid var(--border);
}
.topbar__menu {
  background: #f69d03;
  color: #000;
  padding: 0.85rem 1.5rem;
}
.topbar__menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.topbar__menu a {
  color: #000;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  text-transform: uppercase;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.topbar__menu a:hover {
  color: #000;
  border-bottom-color: #000;
}
.topbar__brand {
  align-self: center;
  padding: 0 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  color: var(--accent);
}
.topbar__brand:hover { color: #a8342e; }

/* ---------- Banner (below topbar) ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.banner__image {
  display: block;
  height: 62px;
  width: auto;
  max-width: 350px;
}
.banner__contact {
  text-align: right;
  color: #f69d03;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.banner__contact a {
  color: #f69d03;
  display: block;
  text-decoration: none;
}
.banner__contact a:hover {
  color: #c97d02;
  text-decoration: underline;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
}

.brand a {
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
}
.main-nav a {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Main ---------- */
main {
  width: 92vw;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.leftnav {
  position: sticky;
  top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.leftnav__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}
.leftnav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.leftnav__menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--text);
  transition: background 0.12s ease, color 0.12s ease;
}
.leftnav__menu li a:hover {
  background: var(--bg);
  color: var(--accent);
}
.leftnav__menu li a .count {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.leftnav__empty {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
}
.content {
  min-width: 0;
}

.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 0.5rem;
}
.hero p {
  color: var(--muted);
  margin: 0 0 2rem;
}

.page-head {
  margin-bottom: 1.5rem;
}
.page-head h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.8rem;
}
.back {
  font-size: 0.85rem;
  color: var(--muted);
}
.back:hover { color: var(--accent); }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cat-card h3 { margin: 0; font-size: 1.1rem; }
.cat-card .count { font-size: 0.82rem; color: var(--muted); }
.cat-card p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.product-card .thumb {
  position: relative;
  background: #f0eee9;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card__body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.product-card__body h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.price {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
}
.price--quote {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}

/* ---------- Admin upload button ---------- */
.upload-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-btn:hover { background: #a8342e; }
.upload-btn--lg {
  width: auto;
  height: auto;
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  position: static;
}

/* ---------- Product detail ---------- */
.product-detail {
  width: 80vw;
  max-width: 100%;
}
.product-detail .back {
  display: inline-block;
  margin-bottom: 1rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.detail__image {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail__body h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}
.desc {
  margin-top: 1rem;
  color: var(--text);
}
.desc p:first-child { margin-top: 0; }

.specs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.specs h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}
.specs__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.specs__body table th,
.specs__body table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.specs__body table th {
  background: var(--bg);
  font-weight: 600;
}

.pagecontent__body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal[hidden] { display: none; }
.modal__panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.modal__panel h3 { margin: 0 0 0.25rem; }
.modal__panel p { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }
.modal__panel input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.modal__actions button {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}
.modal__actions button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
#upload-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 1.5rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent); }

.site-footer__cols {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 2.5rem;
  align-items: start;
}
.site-footer__col--brand address {
  font-style: normal;
  line-height: 1.55;
  font-size: 0.92rem;
}
.site-footer__logo img {
  display: block;
  height: 62px;
  width: auto;
  max-width: 350px;
  margin-bottom: 1rem;
}
.site-footer__col--links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 2rem;
  justify-content: start;
}
.site-footer__col--links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-footer__col--links a {
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .site-footer__cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer__col--links { grid-template-columns: 1fr; gap: 1rem; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
  }
  .topbar__menu ul { gap: 1rem; font-size: 0.85rem; }
  .topbar__brand { padding: 0.5rem 1.5rem 1rem; text-align: right; }
  .banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .banner__contact { text-align: left; }
  .detail-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  main { grid-template-columns: 1fr; }
  .leftnav { position: static; }
}
