* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --red: #cc0000;
  --red-dark: #a00000;
  --black: #1a1a1a;
  --gray-light: #f5f5f5;
  --gray-mid: #e0e0e0;
  --gray-text: #666;
  --white: #ffffff;
}
body { font-family: 'Open Sans', sans-serif; color: var(--black); background: var(--white); }

/* HEADER */
.header { background: var(--white); border-bottom: 3px solid var(--red); padding: 12px 0; }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 70px; }
.header-right { display: flex; align-items: center; gap: 15px; }
.btn-post { background: var(--red); color: white; padding: 10px 24px; border: none; border-radius: 4px; font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; text-transform: uppercase; cursor: pointer; letter-spacing: 1px; text-decoration: none; }
.btn-post:hover { background: var(--red-dark); }
.header-links a { color: var(--black); text-decoration: none; font-size: 14px; font-weight: 600; }
.header-links a:hover { color: var(--red); }

/* HERO SEARCH */
.hero { position: relative; overflow: hidden; text-align: center; }
.hero img.hero-bg { width: 100%; display: block; height: 400px; object-fit: cover; }
.hero-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.65); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.hero h1 { font-family: 'Oswald', sans-serif; color: var(--black); font-size: 36px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.hero h1 span { color: var(--red); }
.hero p { color: #444; font-size: 16px; margin-bottom: 30px; }
.search-bar { max-width: 800px; margin: 0 auto; display: flex; gap: 0; width: 100%; }
.search-bar input { flex: 1; padding: 14px 20px; font-size: 16px; border: none; border-radius: 4px 0 0 4px; font-family: 'Open Sans', sans-serif; }
.search-bar select { padding: 14px 16px; font-size: 15px; border: none; background: var(--gray-light); color: var(--black); font-family: 'Open Sans', sans-serif; border-left: 2px solid var(--gray-mid); }
.search-bar button { background: var(--red); color: white; border: none; padding: 14px 30px; font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; border-radius: 0 4px 4px 0; }
.search-bar button:hover { background: var(--red-dark); }

/* CITY BAR */
.city-bar { background: var(--gray-light); border-bottom: 1px solid var(--gray-mid); padding: 12px 20px; text-align: center; }
.city-bar a { display: inline-block; color: var(--black); text-decoration: none; font-size: 13px; font-weight: 600; padding: 4px 12px; }
.city-bar a:hover { color: var(--red); }
.city-bar a.active { color: var(--red); border-bottom: 2px solid var(--red); }

/* CATEGORIES */
.categories { max-width: 1280px; margin: 40px auto; padding: 0 20px; }
.categories h2 { font-family: 'Oswald', sans-serif; font-size: 24px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 24px; padding-bottom: 10px; border-bottom: 3px solid var(--red); display: inline-block; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-card { background: var(--gray-light); border-radius: 6px; padding: 20px 16px; text-align: center; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; text-decoration: none; color: var(--black); }
.cat-card:hover { border-color: var(--red); transform: translateY(-2px); }
.cat-icon { font-size: 32px; margin-bottom: 8px; }
.cat-name { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.cat-count { font-size: 12px; color: var(--gray-text); margin-top: 4px; }

/* LISTINGS */
.listings { max-width: 1280px; margin: 40px auto; padding: 0 20px; }
.listings h2 { font-family: 'Oswald', sans-serif; font-size: 24px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 24px; padding-bottom: 10px; border-bottom: 3px solid var(--red); display: inline-block; }
.listings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.listing-card { border: 1px solid var(--gray-mid); border-radius: 6px; overflow: hidden; transition: all 0.2s; cursor: pointer; }
.listing-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.listing-img { width: 100%; height: 200px; background: var(--gray-light); display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 48px; }
.listing-info { padding: 14px; }
.listing-price { font-family: 'Oswald', sans-serif; font-size: 22px; color: var(--red); font-weight: 700; }
.listing-title { font-size: 15px; font-weight: 600; margin-top: 4px; color: var(--black); }
.listing-meta { font-size: 12px; color: var(--gray-text); margin-top: 8px; display: flex; justify-content: space-between; }
.listing-badge { background: var(--red); color: white; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; position: relative; top: -2px; }
.view-all { text-align: center; margin-top: 30px; }
.view-all a { display: inline-block; background: var(--black); color: white; padding: 12px 40px; font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; text-decoration: none; border-radius: 4px; }
.view-all a:hover { background: var(--red); }

/* VALUE PROPS */
.value-props { background: var(--black); padding: 50px 20px; margin-top: 50px; }
.value-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.value-item .v-icon { font-size: 36px; margin-bottom: 12px; }
.value-item h3 { font-family: 'Oswald', sans-serif; color: var(--white); font-size: 18px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.value-item p { color: #999; font-size: 13px; line-height: 1.5; }

/* FOOTER */
.footer { background: var(--black); border-top: 3px solid var(--red); padding: 30px 20px; text-align: center; }
.footer p { color: #666; font-size: 13px; }
.footer a { color: var(--red); text-decoration: none; }


/* ===== SITE ADDITIONS (same red / black / white system) ===== */
.logo a { text-decoration: none; display: block; }
.logo-text { font-family: 'Oswald', sans-serif; font-size: 28px; font-weight: 700; color: var(--black); }
.logo-text span { color: var(--red); }
.logo-text small { font-size: 18px; }
.hero { background: var(--gray-light); }
.search-bar button { border: none; }

a.listing-card { display: block; color: inherit; text-decoration: none; }
.listing-img { overflow: hidden; }
.listing-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-sold { background: var(--black); }

.page { max-width: 1280px; margin: 30px auto 50px; padding: 0 20px; }
.page-narrow { max-width: 900px; }
.sec-title { font-family: 'Oswald', sans-serif; font-size: 24px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 3px solid var(--red); display: inline-block; }
.lead { color: var(--gray-text); font-size: 15px; margin: -6px 0 24px; }
.lead a, .page a { color: var(--red); }
.center { text-align: center; font-size: 14px; color: var(--gray-text); margin-top: 16px; }
.breadcrumb { font-size: 13px; color: var(--gray-text); margin-bottom: 16px; }
.breadcrumb a { color: var(--gray-text); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; background: var(--gray-light); border-radius: 6px; color: var(--gray-text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.alert-success { background: #e8f5e9; border-left: 4px solid #2e7d32; }
.alert-error { background: #fdecea; border-left: 4px solid var(--red); }
.alert-info { background: var(--gray-light); border-left: 4px solid var(--black); }
.alert ul { margin: 6px 0 0 18px; }

/* FORMS */
.form-section { background: var(--gray-light); border-radius: 6px; padding: 24px; margin-bottom: 20px; }
.form-section h3, .filters h3, .sidebar-box h3 { font-family: 'Oswald', sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--gray-mid); border-radius: 4px; font-family: 'Open Sans', sans-serif; font-size: 15px; background: var(--white); color: var(--black); }
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field input:disabled { background: #eee; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; }
.extra { display: none; }
.extra.show { display: block; }
.btn-large { padding: 14px 40px; font-size: 18px; }
.btn-full { display: block; width: 100%; text-align: center; }
button.btn-post { border: none; }
a.btn-post, a.btn-post:link, a.btn-post:visited, a.btn-post:hover, a.btn-post:active, a.btn-post:focus { color: var(--white); }

/* PHOTO UPLOAD */
.dropzone { position: relative; border: 2px dashed #bbb; border-radius: 6px; background: var(--white); padding: 30px 20px; text-align: center; transition: all 0.2s; }
.dropzone.drag, .dropzone:hover { border-color: var(--red); background: #fff5f5; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dz-text { font-size: 30px; pointer-events: none; }
.dz-text strong { display: block; font-size: 16px; margin-top: 6px; }
.dz-text span { display: block; font-size: 13px; color: var(--gray-text); margin-top: 4px; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 14px; }
.previews:empty { display: none; }
.previews.existing { margin: 0 0 14px; }
.preview { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #ddd; }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.75); color: var(--white); border: none; border-radius: 50%; width: 26px; height: 26px; font-size: 16px; line-height: 1; cursor: pointer; }
.preview .cover { position: absolute; left: 0; right: 0; bottom: 0; background: var(--red); color: var(--white); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; padding: 2px; }
.preview .rm { position: absolute; top: 4px; left: 4px; background: rgba(255,255,255,0.9); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.btn-ai { margin-top: 14px; background: var(--black); color: var(--white); border: none; padding: 12px 24px; border-radius: 4px; font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; }
.btn-ai:hover { background: var(--red); }
.btn-ai:disabled { opacity: 0.6; cursor: wait; }
.ai-status { font-size: 13px; color: var(--gray-text); margin-top: 8px; }

/* LISTING PAGE */
.listing-detail { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.gallery-main { background: var(--gray-light); border-radius: 6px; overflow: hidden; height: 480px; display: flex; align-items: center; justify-content: center; font-size: 64px; color: #ccc; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active, .gallery-thumbs img:hover { border-color: var(--red); }
.ld-title { font-family: 'Oswald', sans-serif; font-size: 30px; font-weight: 700; margin: 20px 0 4px; line-height: 1.2; }
.ld-price { font-family: 'Oswald', sans-serif; font-size: 32px; color: var(--red); font-weight: 700; }
.ld-meta { font-size: 13px; color: var(--gray-text); margin: 4px 0 20px; }
.ld-desc { font-size: 15px; line-height: 1.7; }
.details-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.details-table th { text-align: left; width: 40%; padding: 9px 12px; background: var(--gray-light); border-bottom: 1px solid var(--white); }
.details-table td { padding: 9px 12px; border-bottom: 1px solid var(--gray-mid); }
.sidebar-box { border: 1px solid var(--gray-mid); border-radius: 6px; padding: 20px; margin-bottom: 20px; }
.seller { font-weight: 700; font-size: 17px; }
.seller-line { font-size: 14px; margin-top: 8px; word-break: break-all; }
.seller-line a { color: var(--black); }
.safety p { font-size: 13px; color: var(--gray-text); line-height: 1.6; }
.sold-banner { background: var(--black); color: var(--white); font-family: 'Oswald', sans-serif; font-size: 20px; text-transform: uppercase; letter-spacing: 3px; text-align: center; padding: 10px; border-radius: 4px; margin-bottom: 16px; }
.report-box summary { cursor: pointer; font-size: 13px; color: var(--gray-text); margin-bottom: 10px; }

/* BUTTONS */
.btn-sm { display: inline-block; background: var(--white); border: 1px solid var(--gray-mid); padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; font-family: 'Open Sans', sans-serif; cursor: pointer; text-decoration: none; color: var(--black); }
.btn-sm:hover { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.edit-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.edit-actions form { display: flex; gap: 8px; }

/* SEARCH & CATEGORY */
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 30px; }
.filters { background: var(--gray-light); border-radius: 6px; padding: 20px; align-self: start; }
.filters .form-row { gap: 10px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; color: var(--gray-text); }
.search-results .listings-grid { grid-template-columns: repeat(3, 1fr); }
.subcat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.subcat-pills a { padding: 6px 14px; border-radius: 20px; background: var(--gray-light); color: var(--black); text-decoration: none; font-size: 13px; font-weight: 600; border: 2px solid transparent; }
.subcat-pills a.active, .subcat-pills a:hover { border-color: var(--red); color: var(--red); }
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--gray-mid); border-radius: 4px; text-decoration: none; color: var(--black); font-size: 14px; font-weight: 600; }
.pagination a:hover { border-color: var(--red); color: var(--red); }
.pagination span.current { background: var(--red); border-color: var(--red); color: var(--white); }

/* ACCOUNT */
.auth-box { max-width: 460px; margin: 50px auto; padding: 0 20px; }
.auth-box a { color: var(--red); }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }
.stat { background: var(--black); border-radius: 6px; padding: 20px; text-align: center; }
.stat b { display: block; font-family: 'Oswald', sans-serif; font-size: 34px; color: var(--red); }
.stat span { font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 1px; }
.table-wrap { overflow-x: auto; margin-bottom: 30px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; background: var(--black); color: var(--white); padding: 10px; font-family: 'Oswald', sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.table td { padding: 10px; border-bottom: 1px solid var(--gray-mid); vertical-align: middle; }
.table form { display: inline; }
.ad-cell { display: flex; align-items: center; gap: 10px; }
.ad-cell img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.ad-cell a { color: var(--black); font-weight: 600; text-decoration: none; }
.nowrap { white-space: nowrap; }
.status { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; background: var(--gray-mid); }
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-sold { background: var(--black); color: var(--white); }
.status-flagged { background: #fdecea; color: var(--red); }
.msg { border: 1px solid var(--gray-mid); border-radius: 6px; padding: 16px; margin-bottom: 12px; }
.msg.unread { border-left: 4px solid var(--red); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 8px; }
.msg-head span { color: var(--gray-text); font-size: 12px; }
.msg p { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
.msg-reply { display: flex; gap: 8px; flex-wrap: wrap; }

/* INFO PAGES */
.prose p { font-size: 15px; line-height: 1.7; margin-bottom: 14px; }
.prose h2 { font-family: 'Oswald', sans-serif; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; margin: 24px 0 8px; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .listings-grid { grid-template-columns: repeat(3, 1fr); }
  .search-results .listings-grid { grid-template-columns: repeat(2, 1fr); }
  .listing-detail { grid-template-columns: 1fr; }
  .gallery-main { height: 380px; }
}
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 10px; }
  .search-bar { flex-direction: column; }
  .search-bar input, .search-bar select, .search-bar button { border-radius: 0; }
  .search-bar input { border-radius: 4px 4px 0 0; }
  .search-bar button { border-radius: 0 0 4px 4px; }
  .value-inner { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 26px; }
  /* Mobile hero: image fills behind, box grows to fit the text + full search bar */
  .hero img.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
  .hero-overlay { position: relative; padding: 32px 16px; }
  .hero p { margin-bottom: 20px; }
  /* Mobile only: see-through search so the hero image shows behind it */
  .search-bar input, .search-bar select { background: rgba(255,255,255,0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: var(--black); }
  .search-bar input::placeholder { color: #444; }
  .search-bar select { border-left: none; border-top: 1px solid rgba(0,0,0,0.12); }
  .search-bar button { background: rgba(204,0,0,0.85); }
  .search-layout { grid-template-columns: 1fr; }
  .search-results .listings-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row.three { grid-template-columns: 1fr; gap: 0; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .gallery-main { height: 280px; }
  .ld-title { font-size: 24px; }
}
@media (max-width: 480px) {
  .listings-grid, .search-results .listings-grid { grid-template-columns: 1fr; }
  .value-inner { grid-template-columns: 1fr; }
}
