:root {
  --bg: #111;
  --bg-alt: #1b1b1b;
  --panel: #202020;
  --panel-2: #171717;
  --text: #f4f4f4;
  --muted: #bdbdbd;
  --accent: #ff7a00;
  --border: #343434;
  --success: #1e7f48;
  --error: #b44444;
  --radius: 18px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--text); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(var(--container), calc(100% - 2rem)); margin: 0 auto; }

.site-header { position: sticky; top: 0; z-index: 30; background: rgba(17,17,17,.95); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.topbar, .nav-inner, .footer-grid, .hero-grid, .split-grid, .contact-grid, .product-layout, .stats-grid, .two-col, .admin-cards { display: grid; gap: 1.25rem; }
.topbar { grid-template-columns: 1.4fr 1fr; align-items: center; padding: .85rem 0; }

.logo { display: flex; align-items: center; gap: .8rem; }
.logo-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #111; font-weight: 800; }
.logo strong { display: block; }
.logo small { display: block; color: var(--muted); }

.logo img {
  height: 80px;
  width: auto;
  display: block;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.logo-text small {
  display: block;
  font-size: 12px;
  color: #666;
}

.contact-strip { display: flex; justify-content: end; gap: 1rem; align-items: center; font-size: .95rem; color: var(--muted); }

.site-nav { border-top: 1px solid var(--border); }
.nav-inner { grid-template-columns: repeat(7, auto); padding: .85rem 0; align-items: center; justify-content: start; }
.nav-inner a { transition: color .2s ease; }
.nav-inner a:hover { color: var(--accent); }

.call-btn, .btn, .btn-primary {
  background: var(--accent);
  color: #111;
  padding: .9rem 1.15rem;
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn { background: #222; color: var(--text); border: 1px solid var(--border); }
.btn:hover { border-color: var(--accent); }
.btn-primary:hover, .call-btn:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--accent); }

.hero { background: linear-gradient(135deg, #131313 0%, #231200 100%); padding: 48px 0 30px; }
.hero-grid, .split-grid, .contact-grid, .product-layout, .two-col { grid-template-columns: repeat(2, 1fr); align-items: start; }
.hero h1 { font-size: clamp(2.25rem, 4vw, 4rem); line-height: 1.05; margin: 0 0 1rem; }
.hero p { color: #e7e7e7; font-size: 1.05rem; }
.hero-actions { display: flex; gap: .85rem; flex-wrap: wrap; margin-top: 1.2rem; }

.hero-card, .card, .login-card, .stat-card, .info-card, .form-wrap, .product-card, .admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 30px rgba(0,0,0,.18);
}

.hero-card, .card, .login-card, .stat-card, .info-card, .form-wrap, .admin-card { padding: 1.25rem; }

.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.section { padding: 3.25rem 0; }
.section.dark, .section.alt { background: var(--bg-alt); }
.section-intro { margin-bottom: 1rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.hero-panel {
  display: flex;
}

.hero-panel-inner {
  width: 100%;
  background: linear-gradient(180deg, #1b1b1b 0%, #111 100%);
  border: 1px solid rgba(255, 140, 0, 0.28);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.hero-panel-title {
  margin: 0 0 18px;
  font-size: 1.4rem;
  line-height: 1.2;
  color: #ff8c00;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hero-panel-content,
.hero-panel-content p,
.hero-panel-content li {
  color: #f3f3f3;
  font-size: 1rem;
  line-height: 1.7;
}

.hero-panel-content ul {
  margin: 0;
  padding-left: 20px;
}

.hero-panel-content li {
  margin-bottom: 10px;
}

.hero-panel-content strong,
.hero-panel-content h3 {
  color: #ffffff;
}

/* ---------- INVENTORY GRID ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1500px) {
  .card-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ---------- PRODUCT CARD ---------- */

.product-card {
  overflow: hidden;
  padding: 0;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  border-color: rgba(255, 122, 0, 0.45);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  display: block;
}

.card-body, .product-card-body { padding: 1rem; }

.product-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card h3 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
}

.product-title {
  font-size: 0.95rem;
  margin: 0;
}

.product-meta-compact {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.product-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.price { color: var(--accent); font-size: 1rem; font-weight: 700; }
.price.large { font-size: 1.8rem; }

.pill { display: inline-block; margin-bottom: .75rem; background: #313131; padding: .35rem .65rem; border-radius: 999px; font-size: .85rem; }
.pill.sold { background: #4c2626; }
.pill.pending { background: #614b19; }

/* ---------- FORMS ---------- */

.filters, .site-form .form-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .85rem; }
.site-form .form-grid { grid-template-columns: repeat(2, 1fr); }
.site-form, .admin-form { display: grid; gap: .85rem; }

input, textarea, select {
  width: 100%;
  padding: .95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #121212;
  color: var(--text);
  font: inherit;
}

textarea { min-height: 160px; }

.site-form textarea[name="message"],
.site-form textarea[name="description"],
.site-form textarea[name="content_html"],
.site-form textarea[name="sidebar_content"],
.site-form textarea[name="intro_text"],
.site-form textarea[name="meta_description"] { grid-column: 1 / -1; }

.narrow { width: min(900px, calc(100% - 2rem)); margin: 0 auto; }
.service-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.map-frame, .map-wrap iframe { width: 100%; min-height: 460px; border: 0; border-radius: var(--radius); }

/* ---------- PRODUCT PAGE ---------- */

.product-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}

.product-main, .product-main-image {
  border-radius: var(--radius);
  max-height: 520px;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.product-main-image-wrap {
  background: #111;
  border: 1px solid rgba(255, 140, 0, 0.22);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.product-main-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  border: 0;
}

.product-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.product-thumb {
  width: 96px;
  height: 96px;
  padding: 0;
  border: 2px solid rgba(255, 140, 0, 0.18);
  border-radius: 10px;
  background: #111;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.product-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 140, 0, 0.42);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumb.is-active {
  border-color: #ff8c00;
  box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.18);
}

.product-details h1 {
  margin-top: 0;
}

.product-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.product-meta li {
  margin-bottom: 10px;
}

.thumb-row, .thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-top: .75rem;
}

.thumb-row img, .thumb-grid img {
  border-radius: 12px;
  height: 100px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ---------- IMAGE SYSTEM ---------- */

.fixed-ratio {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}

.fixed-ratio img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spec-table, .admin-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td, .admin-table th, .admin-table td { border-bottom: 1px solid var(--border); padding: .85rem; text-align: left; }
.specs { padding-left: 1.2rem; }
.rich-text p, .rich-text li { line-height: 1.7; }

.site-footer { background: #0c0c0c; border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-grid { grid-template-columns: repeat(3, 1fr); padding: 2rem 0; }
.footer-bottom { padding: 0 0 2rem; color: var(--muted); }

.alert, .flash { padding: .9rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.success, .flash.success { background: rgba(30,127,72,.25); border: 1px solid var(--success); color: #dff8e8; }
.error, .flash.error { background: rgba(180,68,68,.18); border: 1px solid var(--error); color: #ffdada; }

.login-body, .admin-body { background: linear-gradient(135deg, #111, #1f1308); min-height: 100vh; }
.login-card { width: min(460px, calc(100% - 2rem)); margin: 7rem auto; }

.admin-layout, .admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar { background: #0c0c0c; padding: 1.5rem; border-right: 1px solid var(--border); color: var(--text); display: block; }
.admin-sidebar h2 { margin-top: 0; }
.admin-sidebar a { display: block; margin: .5rem 0; padding: .8rem 1rem; border-radius: 12px; background: transparent; }
.admin-sidebar a:hover { background: #1e1e1e; }

.admin-content, .admin-main { padding: 2rem; }
.admin-topbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 1rem; color: var(--muted); }
.stats-grid, .admin-cards { grid-template-columns: repeat(4, 1fr); }
.stat-card strong { font-size: 2rem; display: block; color: var(--accent); }
.admin-table { background: var(--panel); border-radius: 16px; overflow: hidden; }
.admin-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 10px; }
.checkbox { display: flex; align-items: center; gap: .5rem; }
.admin-toolbar, .admin-list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.admin-form-stack label { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .95rem; }
.admin-actions-row, .actions-cell { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.actions-cell { margin-top: 0; gap: .5rem; }
.btn-small { padding: .55rem .85rem; font-size: .9rem; }
.btn-danger { background: #8d2e2e; color: #fff; }

label { color: var(--muted); }
::placeholder { color: #999; }

.page-layout {
  display: block;
}

.page-layout.has-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 32px;
  align-items: start;
}

.page-main {
  min-width: 0;
}

.page-sidebar {
  min-width: 0;
}

.page-sidebar h2 {
  margin-top: 0;
}

.rich-text img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px 0;
  border-radius: 4px;
}

.page-sidebar .rich-text img {
  margin: 10px 0;
}

.rich-text .image-left,
.rich-text .image-right {
  max-width: 320px;
  height: auto;
  margin-bottom: 15px;
}

.rich-text .image-left {
  float: left;
  margin-right: 20px;
}

.rich-text .image-right {
  float: right;
  margin-left: 20px;
}

.rich-text .image-center {
  display: block;
  margin: 20px auto;
  max-width: 100%;
  height: auto;
}

.rich-text .clear {
  clear: both;
}

.media-block {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 20px 0;
}

.media-block.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
}

.media-block-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.media-block-content > *:first-child {
  margin-top: 0;
}

.media-block-content > *:last-child {
  margin-bottom: 0;
}

/* ---------- QUICK VIEW MODAL ---------- */

.inventory-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

.inventory-modal.is-open {
  display: flex !important;
}

.inventory-modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.78) !important;
}

.inventory-modal-dialog {
  position: relative !important;
  z-index: 1 !important;
  width: min(980px, calc(100vw - 32px)) !important;
  max-width: 980px !important;
  max-height: calc(100vh - 32px) !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.inventory-modal-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr) !important;
  gap: 0 !important;
  max-height: calc(100vh - 32px) !important;
}

.inventory-modal-image-wrap {
  min-height: 280px !important;
  max-height: calc(100vh - 32px) !important;
  overflow: hidden !important;
}

.inventory-modal-image {
  width: 100% !important;
  height: 100% !important;
  min-height: 280px !important;
  max-height: calc(100vh - 32px) !important;
  object-fit: cover !important;
  background: #111 !important;
}

.inventory-modal-panel {
  overflow-y: auto !important;
  max-height: calc(100vh - 32px) !important;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.inventory-modal-title {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.inventory-modal-price {
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0 0 12px;
}

.inventory-modal-meta {
  margin: 0 0 14px;
}

.inventory-modal-meta li {
  margin-bottom: 6px;
}

.inventory-modal-note {
  margin: 0 0 14px;
  color: var(--muted);
}

.inventory-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0;
  padding-top: 2px;
}

.inventory-modal-actions .btn,
.inventory-modal-actions .btn-primary,
.inventory-modal-actions .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

/* ---------- INVENTORY TOOLBAR / FILTER REFINEMENT ---------- */

.inventory-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 16px 0 22px;
  flex-wrap: wrap;
}

.inventory-toolbar label {
  color: var(--muted);
  font-size: 0.95rem;
}

.inventory-toolbar select {
  width: auto;
  min-width: 220px;
}

.inventory-category-links {
  margin: 12px 0 20px;
  line-height: 1.7;
}

.inventory-category-links a {
  display: inline-block;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.inventory-category-links a:hover {
  color: var(--accent);
}

.inventory-section-title {
  margin: 0 0 16px;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .topbar,
  .hero-grid,
  .split-grid,
  .contact-grid,
  .product-layout,
  .footer-grid,
  .stats-grid,
  .service-list,
  .filters,
  .site-form .form-grid,
  .two-col,
  .admin-layout,
  .admin-shell,
  .admin-cards,
  .page-layout.has-sidebar {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    grid-template-columns: repeat(3, auto);
    gap: .85rem;
  }

  .contact-strip {
    flex-direction: column;
    align-items: end;
  }

  .inventory-modal {
    align-items: flex-start !important;
    padding: 8px !important;
  }

  .inventory-modal-dialog {
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
  }

  .inventory-modal-content {
    grid-template-columns: 1fr !important;
    max-height: calc(100vh - 16px) !important;
  }

  .inventory-modal-image-wrap {
    min-height: 220px !important;
    max-height: 320px !important;
  }

  .inventory-modal-image {
    min-height: 220px !important;
    max-height: 320px !important;
  }

  .inventory-modal-panel {
    max-height: calc(100vh - 336px) !important;
  }

  .inventory-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inventory-modal-actions .btn,
  .inventory-modal-actions .btn-primary,
  .inventory-modal-actions .btn-outline {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 700px) {
  .rich-text .image-left,
  .rich-text .image-right {
    float: none;
    display: block;
    max-width: 100%;
    margin: 0 0 15px 0;
  }

  .media-block,
  .media-block.reverse {
    grid-template-columns: 1fr;
  }
}

/* ---------- MOBILE INVENTORY TUNING ---------- */

@media (max-width: 559px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .product-card-body {
    padding: 0.8rem;
    gap: 5px;
  }

  .product-card h3 {
    font-size: 0.95rem;
  }

  .product-card-actions {
    gap: 8px;
  }

  .product-card-actions .btn,
  .product-card-actions .btn-primary,
  .product-card-actions .btn-outline {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
  }

  .filters input,
  .filters select {
    padding: 0.82rem 0.9rem;
    border-radius: 12px;
  }

  .filters .btn,
  .filters .btn-primary {
    width: 100%;
    justify-self: stretch;
    padding: 0.78rem 0.95rem;
  }

  .inventory-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    align-items: stretch;
    margin: 10px 0 16px;
  }

  .inventory-toolbar label {
    font-size: 0.9rem;
  }

  .inventory-toolbar select {
    width: 100%;
    min-width: 0;
  }

  .inventory-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
    line-height: 1.3;
  }

  .inventory-category-links span {
    display: none;
  }

  .inventory-category-links a {
    padding: 0.5rem 0.78rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #1a1a1a;
    font-size: 0.92rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .inventory-category-links a:hover,
  .inventory-category-links a:focus {
    border-color: rgba(255, 122, 0, 0.55);
    background: #232323;
    color: #fff;
  }

  .inventory-category-links a[style*="font-weight:bold"] {
    background: rgba(255, 122, 0, 0.14);
    border-color: rgba(255, 122, 0, 0.55);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 122, 0, 0.12);
  }

  .inventory-section-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
  }

  .inventory-modal-price {
    margin-bottom: 10px;
  }

  .inventory-modal-note {
    margin-bottom: 12px;
  }
}

@media (min-width: 560px) and (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .product-card-body {
    padding: 0.8rem;
    gap: 5px;
  }

  .product-card h3 {
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .product-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-card-actions .btn,
  .product-card-actions .btn-primary,
  .product-card-actions .btn-outline {
    width: 100%;
    text-align: center;
    padding: 0.62rem 0.8rem;
    font-size: 0.9rem;
  }

  .filters {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
    margin-bottom: 1rem;
  }

  .filters input,
  .filters select {
    padding: 0.86rem 0.95rem;
  }

  .filters .btn,
  .filters .btn-primary {
    grid-column: 1 / -1;
    width: 100%;
    padding: 0.82rem 0.95rem;
  }

  .inventory-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 0.8rem;
    align-items: end;
    margin: 12px 0 18px;
  }

  .inventory-toolbar label {
    grid-column: 1 / -1;
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .inventory-toolbar select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .inventory-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 18px;
    line-height: 1.3;
  }

  .inventory-category-links span {
    display: none;
  }

  .inventory-category-links a {
    padding: 0.48rem 0.78rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #1a1a1a;
    font-size: 0.92rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .inventory-category-links a:hover,
  .inventory-category-links a:focus {
    border-color: rgba(255, 122, 0, 0.55);
    background: #232323;
    color: #fff;
  }

  .inventory-category-links a[style*="font-weight:bold"] {
    background: rgba(255, 122, 0, 0.14);
    border-color: rgba(255, 122, 0, 0.55);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 122, 0, 0.12);
  }

  .inventory-section-title {
    margin: 0 0 14px;
  }
}