/* THEME */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --card: #161616;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --muted: #666666;
  --accent: #ffffff;
  --white: white;
  --red: #ef4444;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  padding: 20px;
  -webkit-tap-highlight-color: transparent;
}

body.no-scroll {
  overflow: hidden;
}

/* HEADER */
header {
  text-align: center;
  padding: 30px 0 25px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.header-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.store-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 6px;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
}

.store-tagline {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 5px;
  margin-top: 6px;
  margin-bottom: 24px;
}

/* SOCIAL BUTTON */
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: black;
  margin-top: 2px;
  margin-bottom: 14px;
  width: 100%;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.social-btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.btn-fb {
  background: var(--white);
}

/* LAYOUT WRAPPER */
.layout-wrapper {
  display: flex;
  flex-direction: row-reverse;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  margin-top: 26px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .layout-wrapper {
    flex-direction: column;
    gap: 16px;
  }

  .sidebar {
    width: 100%;
  }
}

/* CONTROLS SIDEBAR */
.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 20px;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

input[type="text"] {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 11px 12px;
  color: var(--text);
  border-radius: 8px;
  font-size: 16px;
  font-family: "DM Sans", sans-serif;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.toggle-label:hover {
  color: var(--accent);
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}

input[type="checkbox"]:hover {
  border-color: var(--accent);
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: black;
}

.refresh-btn {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.refresh-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* RESULTS COUNT */
.count {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* PRODUCT GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* PRODUCT CARD */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.card.available:hover {
  border-color: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.05);
}

.card.unavailable .img-wrap,
.card.unavailable .card-body {
  opacity: 0.4;
  filter: grayscale(1);
}

/* MERGED IMG-WRAP — single definition */
.img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: #1a1a1a;
  overflow: visible;
  position: relative;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.card.available:hover .img-wrap img {
  transform: scale(1.04);
}

.card-body {
  padding: 10px 11px 12px;
}

.card-category {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 3px;
}

.card-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}

.card-condition {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* STATUS BADGES */
.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.badge-sold {
  background: var(--red);
  color: #fff;
}

.badge-pending {
  background: var(--amber);
  color: #000;
}

/* MODAL */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  display: block;
  background: #1a1a1a;
  border-bottom: 1px solid #222;
}

.modal-body {
  padding: 18px 20px 22px;
}

.modal-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.modal-name {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.modal-price {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 42px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  letter-spacing: 1px;
}

.modal-shipping {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-status-block {
  text-align: right;
}

.modal-meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

.modal-status-val {
  font-size: 14px;
  font-weight: 600;
}

.modal-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-meta-block .modal-meta-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-tag {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* EMPTY / LOADING STATES */
.state-msg {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ZOOM */
#m-img-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: crosshair;
  width: 100%;
}

#m-zoom-window {
  display: none;
  position: fixed;
  width: 260px;
  height: 260px;
  border: 1px solid #444;
  border-radius: 8px;
  background-repeat: no-repeat;
  background-color: #1a1a1a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 999;
}

#m-zoom-lens {
  display: none;
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid #ccc;
  border-radius: 4px;
  pointer-events: none;
  z-index: 201;
}