/* ============================================================
   Custom Mats · style.css  — standalone, no CSS variables
   ============================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

/* ── NAV ─────────────────────────────────────────────── */
#mainNav {
  background: #0f172a;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: #e11d48;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff;
  flex-shrink: 0;
}
.nav-logo-text { font-size: 15px; font-weight: 600; color: #f1f5f9; }

.nav-right { display: flex; align-items: center; gap: 4px; }

.nav-link {
  color: rgba(255,255,255,.55);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #f1f5f9; }
.nav-link.active { color: #f1f5f9; }

.nav-divider { width: 1px; height: 18px; background: rgba(255,255,255,.12); margin: 0 4px; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: none; border-radius: 6px;
  padding: 5px 10px; cursor: pointer;
  transition: background .15s;
}
.user-btn:hover { background: rgba(255,255,255,.14); }
.user-avatar {
  width: 26px; height: 26px;
  background: #e11d48; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; color: rgba(255,255,255,.85); }
.user-chevron { color: rgba(255,255,255,.4); font-size: 11px; margin-left: 2px; }

.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  display: none; overflow: hidden; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; }
.user-dropdown-header .uname { font-size: 13px; font-weight: 600; color: #0f172a; }
.user-dropdown-header .uemail { font-size: 11px; color: #64748b; margin-top: 2px; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 13px; color: #334155;
  text-decoration: none; transition: background .15s;
}
.dropdown-item:hover { background: #f8fafc; }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item svg { color: #94a3b8; flex-shrink: 0; }
.dropdown-item.danger svg { color: #dc2626; }

/* ── HERO ─────────────────────────────────────────────── */
.hero { background: #0f172a; padding: 36px 24px 0; }
.hero-inner { max-width: 900px; margin: 0 auto; }
.hero-text { text-align: center; padding-bottom: 24px; }
.hero-text h1 { font-size: 24px; font-weight: 700; color: #f8fafc; letter-spacing: -.02em; margin-bottom: 6px; }
.hero-text p  { font-size: 13px; color: #64748b; }

/* ── SELECTOR CARD ────────────────────────────────────── */
.selector-card {
  background: #ffffff;
  border-radius: 12px 12px 0 0;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  padding: 22px;
}

.sel-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 12px; }

.sel-item label {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: #64748b; margin-bottom: 5px;
}

.sel-item select {
  width: 100%; padding: 9px 30px 9px 10px;
  border: 1px solid #cbd5e1; border-radius: 7px;
  font-size: 13px; color: #1e293b;
  background: #f8fafc;
  outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .15s, box-shadow .15s;
}
.sel-item select:focus { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.12); }
.sel-item select:disabled { opacity: .45; cursor: not-allowed; background: #f1f5f9; }

.search-wrap { position: relative; }
.search-wrap .search-ico {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); color: #94a3b8;
  pointer-events: none; width: 15px; height: 15px;
}
.search-input {
  width: 100%; padding: 9px 36px;
  border: 1px solid #cbd5e1; border-radius: 7px;
  font-size: 13px; color: #1e293b; background: #f8fafc; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.12); }
.search-input::placeholder { color: #94a3b8; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #94a3b8; cursor: pointer;
  padding: 4px; border-radius: 4px; display: none; align-items: center;
}
.search-clear:hover { color: #475569; }

/* ── RESULTS TOOLBAR ─────────────────────────────────── */
.results-toolbar-wrap { background: #0f172a; }
.results-toolbar {
  max-width: 900px; margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2e8f0; border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 10px 22px;
  display: none; align-items: center; justify-content: space-between;
}
.results-toolbar.visible { display: flex; }
.results-info { font-size: 13px; color: #64748b; }
.results-info strong { color: #0f172a; font-weight: 700; }
.btn-reset {
  background: none; border: 1px solid #e2e8f0;
  border-radius: 6px; padding: 5px 10px;
  font-size: 12px; color: #64748b; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: background .15s, color .15s;
}
.btn-reset:hover { background: #f8fafc; color: #334155; }

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content {
  max-width: 900px; margin: 0 auto;
  padding: 24px 24px 56px;
}

/* ── STATES ──────────────────────────────────────────── */
.state-box { text-align: center; padding: 60px 24px; }
.state-icon {
  width: 60px; height: 60px; background: #e2e8f0;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 24px; color: #94a3b8;
}
.state-box h5 { font-size: 15px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.state-box p  { font-size: 13px; color: #94a3b8; }

.loading-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.loading-dots span {
  width: 8px; height: 8px; background: #e11d48; border-radius: 50%;
  animation: bounce 1s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%,80%,100% { transform: scale(.6); opacity: .4; }
  40%          { transform: scale(1);  opacity: 1; }
}

/* ── PRODUCT CARDS ───────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

.product-card {
  background: #ffffff; border: 1px solid #e2e8f0;
  border-radius: 12px; overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  border-color: #fca5a5;
}

.product-img {
  height: 130px; background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-img img { width:100%; height:100%; object-fit:cover; transition: transform .3s; }
.product-card:hover .product-img img { transform: scale(1.04); }
.product-img-placeholder { font-size: 32px; color: #cbd5e1; }
.img-count {
  position: absolute; bottom: 7px; right: 7px;
  background: rgba(15,23,42,.6); color: #f8fafc;
  font-size: 10px; border-radius: 20px; padding: 2px 7px;
  display: flex; align-items: center; gap: 3px;
}

.product-body { padding: 13px 14px 14px; }

.brand-tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-radius: 4px; padding: 2px 7px; margin-bottom: 6px;
}
.brand-tag.vw       { background: #dbeafe; color: #1e40af; }
.brand-tag.audi     { background: #dcfce7; color: #15803d; }
.brand-tag.bmw      { background: #fef9c3; color: #a16207; }
.brand-tag.mercedes { background: #e0f2fe; color: #0369a1; }
.brand-tag.alfa     { background: #ffe4e6; color: #be123c; }
.brand-tag.toyota   { background: #ffedd5; color: #c2410c; }
.brand-tag.ford     { background: #ede9fe; color: #6d28d9; }
.brand-tag.skoda    { background: #dcfce7; color: #15803d; }
.brand-tag.default  { background: #f1f5f9; color: #475569; }

.product-name { font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 2px; line-height: 1.3; }
.product-year { font-size: 11px; color: #94a3b8; margin-bottom: 9px; }

.product-pn { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.pn-row { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.pn-label { color: #94a3b8; min-width: 48px; }
.pn-value { color: #1e293b; font-weight: 600; font-family: 'Courier New', monospace; font-size: 11px; }

.product-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #f1f5f9;
}
.clip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #475569; background: #f8fafc;
  padding: 3px 8px; border-radius: 20px; border: 1px solid #e2e8f0;
}
.note-badge { font-size: 11px; color: #dc2626; display: flex; align-items: center; gap: 3px; }

/* ── MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 500;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #ffffff; border-radius: 14px;
  border: 1px solid #e2e8f0;
  width: 100%; max-width: 660px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: fadeUp .2s ease;
}
@keyframes fadeUp {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid #f1f5f9;
  position: sticky; top: 0; background: #ffffff; z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.modal-close {
  width: 28px; height: 28px; background: #f1f5f9;
  border: none; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: background .15s;
}
.modal-close:hover { background: #e2e8f0; color: #334155; }

.modal-body { padding: 20px; }

.gallery-main {
  width: 100%; aspect-ratio: 16/9; background: #f8fafc;
  border-radius: 10px; overflow: hidden; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
}
.gallery-main img { width:100%; height:100%; object-fit:contain; }
.gallery-main-empty { font-size: 40px; color: #cbd5e1; }

.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb {
  width: 60px; height: 44px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color .15s;
}
.gallery-thumb.active { border-color: #e11d48; }
.gallery-thumb img { width:100%; height:100%; object-fit:cover; }

.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 16px; }
.detail-badge {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.detail-badge-icon {
  width: 32px; height: 32px; background: #ffffff;
  border: 1px solid #e2e8f0; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #64748b; flex-shrink: 0;
}
.detail-badge-content .dlabel { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.detail-badge-content .dvalue { font-size: 14px; font-weight: 700; color: #0f172a; font-family: 'Courier New', monospace; }

.modal-note {
  margin-top: 12px; background: #fff7ed;
  border: 1px solid #fed7aa; border-radius: 8px;
  padding: 10px 14px; font-size: 12px; color: #9a3412;
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
}

/* ── ADMIN NAV ─────────────────────────────────────── */
.admin-nav {
  background: #0f172a; height: 52px;
  display: flex; align-items: center; padding: 0 24px;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.admin-nav-left { display: flex; align-items: center; gap: 16px; }
.admin-back {
  color: rgba(255,255,255,.5); font-size: 12px;
  text-decoration: none; display: flex; align-items: center; gap: 5px;
  transition: color .15s;
}
.admin-back:hover { color: #f1f5f9; }
.admin-title { font-size: 14px; font-weight: 600; color: #f1f5f9; }

.admin-body { max-width: 1100px; margin: 0 auto; padding: 24px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-title { font-size: 18px; font-weight: 700; color: #0f172a; }

.btn-add {
  display: flex; align-items: center; gap: 6px;
  background: #0f172a; color: #f1f5f9;
  border: none; border-radius: 7px;
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s; text-decoration: none;
}
.btn-add:hover { background: #1e293b; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input,
.filter-bar select {
  padding: 8px 12px; border: 1px solid #cbd5e1;
  border-radius: 7px; font-size: 13px;
  background: #ffffff; color: #1e293b; outline: none;
}
.filter-bar input { flex: 1; min-width: 180px; }
.filter-bar input:focus,
.filter-bar select:focus { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.1); }
.filter-bar input::placeholder { color: #94a3b8; }

.btn-filter {
  padding: 8px 16px; background: #0f172a; color: #f1f5f9;
  border: none; border-radius: 7px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-filter:hover { background: #1e293b; }
.btn-filter-reset {
  padding: 8px 12px; background: #ffffff; border: 1px solid #e2e8f0;
  border-radius: 7px; font-size: 13px; color: #64748b;
  cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn-filter-reset:hover { background: #f8fafc; }

.data-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #334155; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }

.thumb-img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; display: block; }
.thumb-ph {
  width: 48px; height: 36px; background: #f1f5f9; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 16px;
}

.status-on  { display: inline-block; background: #dcfce7; color: #15803d; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.status-off { display: inline-block; background: #ffe4e6; color: #be123c; font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }

.action-btn {
  width: 28px; height: 28px; border: 1px solid #e2e8f0;
  border-radius: 6px; background: #ffffff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: #64748b; transition: background .15s, color .15s; text-decoration: none;
}
.action-btn:hover { background: #f1f5f9; color: #334155; }
.action-btn.del:hover { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }

.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
  min-width: 32px; height: 32px; border: 1px solid #e2e8f0;
  border-radius: 6px; background: #ffffff; color: #64748b;
  font-size: 13px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; text-decoration: none; padding: 0 10px;
  transition: background .15s, color .15s;
}
.page-btn:hover { background: #f8fafc; color: #334155; }
.page-btn.active { background: #0f172a; color: #f8fafc; border-color: #0f172a; }

/* ── ADMIN MODAL ────────────────────────────────────── */
.amodal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; display: none; align-items: flex-start;
  justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.amodal-overlay.open { display: flex; }
.amodal-box {
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px;
  width: 100%; max-width: 620px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: fadeUp .2s ease;
}
.amodal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
}
.amodal-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.amodal-body  { padding: 20px; }
.amodal-footer { padding: 14px 20px; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 8px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group-a { margin-bottom: 14px; }
.form-group-a label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 5px; }
.form-group-a input,
.form-group-a select,
.form-group-a textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #cbd5e1; border-radius: 7px;
  font-size: 13px; color: #1e293b; background: #f8fafc; outline: none;
}
.form-group-a input:focus,
.form-group-a select:focus,
.form-group-a textarea:focus { border-color: #e11d48; box-shadow: 0 0 0 2px rgba(225,29,72,.1); }
.form-group-a input::placeholder { color: #94a3b8; }
.form-group-a textarea { resize: vertical; min-height: 70px; }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; }
.check-row input[type=checkbox] { width: 15px; height: 15px; accent-color: #e11d48; cursor: pointer; }

.existing-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.existing-img-wrap { position: relative; }
.existing-img-wrap img { width: 60px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.remove-img {
  position: absolute; top: -5px; right: -5px;
  width: 18px; height: 18px; background: #e11d48;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px;
}

.btn-save {
  padding: 9px 20px; background: #0f172a; color: #f1f5f9;
  border: none; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-save:hover { background: #1e293b; }
.btn-cancel {
  padding: 9px 16px; background: #ffffff; border: 1px solid #e2e8f0;
  border-radius: 7px; font-size: 13px; color: #64748b; cursor: pointer;
  transition: background .15s;
}
.btn-cancel:hover { background: #f8fafc; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 700px) {
  .sel-grid { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: repeat(2,1fr); }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .hero-text h1 { font-size: 20px; }
  #mainNav, .hero { padding-left: 16px; padding-right: 16px; }
  .selector-card { padding: 16px; }
  .main-content { padding: 16px 16px 40px; }
  .admin-body { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .nav-logo-text { display: none; }
}
@media (max-width: 460px) {
  .sel-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
}

/* FA icon spacing u nav */
.nav-link i, .nav-link .fa-solid, .nav-link .fa-regular { font-size: 13px; margin-right: 5px; }
.dropdown-item i, .dropdown-item .fa-solid { width: 16px; color: #94a3b8; }
.dropdown-item.danger i, .dropdown-item.danger .fa-solid { color: #dc2626; }
