/* Juarez Equipment — bold charcoal + red, echoing the Juarez Chiropractic brand. */

:root {
  --charcoal: #22262a;
  --charcoal-2: #2e3338;
  --red: #c8102e;
  --red-dark: #a30d26;
  --paper: #f6f5f3;
  --ink: #1c1e21;
  --muted: #6b7178;
  --line: #e3e1dd;
  --gold: #d9a441;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { text-decoration: none; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-dark { background: var(--charcoal); color: #fff; }
.btn-dark:hover { background: var(--charcoal-2); }
.btn-ghost { background: transparent; color: var(--charcoal); border: 2px solid var(--charcoal); }

/* Header */
.site-header { background: var(--charcoal); }
.header-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
.logo { color: #fff; font-size: 1.35rem; font-weight: 800; letter-spacing: 0.5px; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: #e8e8e8; font-weight: 600; }
.main-nav a.btn-red { color: #fff; }

/* Hero */
.hero { background: var(--charcoal); color: #fff; padding: 44px 0 52px; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; max-width: 700px; text-wrap: balance; }
.hero p { color: #cfd2d6; margin-top: 10px; max-width: 640px; }
.hero .btn { margin-top: 20px; }

/* Filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; padding: 24px 0 8px; align-items: center; }
.filters select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; font-size: 0.95rem; color: var(--ink);
}
.filters .count { color: var(--muted); font-size: 0.9rem; margin-left: auto; }

/* Listing grid */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px; padding: 18px 0 48px;
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow 0.15s ease;
  position: relative;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.card a.card-link { color: inherit; display: flex; flex-direction: column; height: 100%; }
.card a.card-link:hover { text-decoration: none; }
.card-photo { aspect-ratio: 4 / 3; background: var(--charcoal-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .no-photo { color: #8a9097; font-size: 0.9rem; }
.card-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 1.02rem; font-weight: 700; line-height: 1.3; }
.card-meta { color: var(--muted); font-size: 0.85rem; }
.card-price { margin-top: auto; padding-top: 8px; font-size: 1.15rem; font-weight: 800; color: var(--charcoal); }

.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 3px; font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
}
.badge-sold { background: var(--red); }
.badge-vip { background: var(--gold); color: var(--charcoal); }

.sold .card-photo img { filter: grayscale(0.9); opacity: 0.75; }

/* Listing detail */
.detail { display: grid; grid-template-columns: 3fr 2fr; gap: 36px; padding: 36px 0 56px; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }
.gallery-main {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; margin-bottom: 12px;
}
.gallery-main img { width: 100%; display: block; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 84px; height: 64px; object-fit: cover; border-radius: 4px;
  border: 2px solid transparent; cursor: pointer;
}
.gallery-thumbs img.active { border-color: var(--red); }
.detail-info h1 { font-size: 1.6rem; line-height: 1.25; }
.detail-price { font-size: 1.7rem; font-weight: 800; color: var(--charcoal); margin: 10px 0 2px; }
.detail-meta { list-style: none; margin: 16px 0; border-top: 1px solid var(--line); }
.detail-meta li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.detail-meta li span:first-child { color: var(--muted); }
.detail-desc { margin: 18px 0; white-space: pre-line; }
.detail-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

.sold-banner {
  background: var(--red); color: #fff; font-weight: 800; text-align: center;
  padding: 12px; border-radius: 4px; margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.seller { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 36px 0; margin-top: 48px; }
.seller-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.seller h2 { font-size: 1.15rem; margin-bottom: 8px; }
.seller p { color: var(--muted); max-width: 680px; line-height: 1.55; }
.seller-links { display: flex; flex-direction: column; gap: 10px; min-width: 180px; }
.footer-links { margin-top: 6px; font-size: 0.9rem; }
@media (max-width: 720px) { .seller-row { grid-template-columns: 1fr; } .seller-links { flex-direction: row; flex-wrap: wrap; } }
.inquire { margin-top: 22px; }
.inquire h2 { font-size: 1.1rem; margin-bottom: 12px; }
.inquire .field textarea { min-height: 100px; }
.sold-note { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-top: 14px; }

/* Alert signup / forms */
.form-page { max-width: 640px; margin: 0 auto; padding: 40px 20px 64px; }
.form-page h1 { font-size: 1.7rem; margin-bottom: 6px; }
.form-page .lede { color: var(--muted); margin-bottom: 24px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 5px; }
.field input[type="text"], .field input[type="email"], .field input[type="number"],
.field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; }
.field .hint { color: var(--muted); font-size: 0.83rem; margin-top: 4px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.93rem; margin-bottom: 10px; cursor: pointer; }
.checks input { margin-top: 4px; }
.notice { border-radius: 4px; padding: 14px 16px; margin-bottom: 18px; font-size: 0.95rem; }
.notice-ok { background: #e8f4ea; border: 1px solid #b8dcc0; color: #205a2c; }
.notice-err { background: #fbeaec; border: 1px solid #efc2c9; color: #8c1023; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }

/* Footer */
.site-footer { background: var(--charcoal); color: #cfd2d6; margin-top: 20px; }
.footer-row { display: flex; justify-content: space-between; gap: 24px; padding: 36px 20px 18px; flex-wrap: wrap; }
.site-footer strong { color: #fff; font-size: 1.1rem; }
.footer-cta p { margin-bottom: 8px; }
.powered-by { border-top: 1px solid #3a4046; padding: 14px 20px 22px; font-size: 0.85rem; color: #9aa0a6; }
.powered-by a { color: #cfd2d6; }

/* Admin */
.admin-body { background: var(--paper); }
.admin-header { background: var(--charcoal); color: #fff; padding: 14px 0; }
.admin-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.admin-header .title { font-weight: 800; color: #fff; }
.admin-header nav { display: flex; gap: 16px; }
.admin-header nav a { color: #e8e8e8; font-size: 0.92rem; font-weight: 600; }
.admin-main { padding: 28px 0 60px; }
.admin-main h1 { font-size: 1.4rem; margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { margin-left: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
table.list th, table.list td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
table.list th { background: #fbfaf9; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
table.list tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pill-draft { background: #eceff1; color: #55606a; }
.pill-live { background: #e8f4ea; color: #205a2c; }
.pill-sold { background: #fbeaec; color: #8c1023; }
.pill-archived { background: #f1ede4; color: #7a6a45; }
.btn-sm { padding: 5px 12px; font-size: 0.85rem; }
.admin-photos { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.admin-photo { position: relative; width: 130px; }
.admin-photo img { width: 130px; height: 98px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.admin-photo .photo-actions { display: flex; gap: 6px; margin-top: 4px; }
.admin-photo .photo-actions button { font-size: 0.75rem; padding: 2px 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.action-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.login-box { max-width: 380px; margin: 80px auto; }
.danger { color: var(--red); }
