/* ============================================================
   MG SHOP — "Tactical Surveillance Console"
   Paletă: negru rece (night-vision) + amber de alarmă + verde IR.
   Tipografie: JetBrains Mono (tehnic/titluri) + IBM Plex Sans (text).
   ============================================================ */

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

:root {
  --bg:        #080c0a;
  --bg2:       #0b1210;
  --surface:   #111815;
  --surface2:  #18221e;
  --border:    #20302a;
  --border2:   #2e453b;

  --amber:     #ffb020;
  --amber-d:   #e09000;
  --amber-dim: #6b4d12;

  --green:     #5ef0b0;
  --green-dim: #1d4d3a;

  --red:       #ff5757;
  --red-dim:   #4d1f1f;

  --text:      #eef6f1;
  --text2:     #93a89c;
  --text3:     #56685e;

  --radius:    3px;
  --radius-lg: 6px;
  --shadow:    0 8px 32px rgba(0,0,0,0.55);
  --mono:      'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --sans:      'IBM Plex Sans', -apple-system, sans-serif;
  --t:         0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

/* ===== ATMOSFERĂ: grain + scanline fix, sub tot conținutul ===== */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(95,240,176,0.05), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(255,176,32,0.04), transparent 40%);
}
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    to bottom, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px,
    transparent 1px, transparent 3px
  );
  animation: scan 9s linear infinite;
}
@keyframes scan {
  0%   { background-position: 0 0; }
  100% { background-position: 0 240px; }
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ===== LABEL TEHNIC (uppercase, tracked, monospace) ===== */
.tech-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,12,10,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--amber) 0%, transparent 35%, transparent 65%, var(--green) 100%);
  opacity: 0.7;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1240px; margin: 0 auto;
}
.logo {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.logo::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(94,240,176,0.15);
  animation: pulse-dot 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
.logo span { color: var(--amber); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  transition: color var(--t);
  position: relative;
}
.nav-links a:hover { color: var(--amber); }
.cart-link {
  position: relative; display: flex; align-items: center; gap: 8px;
  color: var(--text); font-family: var(--mono); font-weight: 600;
  font-size: 13px; letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  transition: border-color var(--t), background var(--t);
}
.cart-link:hover { border-color: var(--amber); background: var(--surface); }
.cart-badge {
  background: var(--amber); color: #1a1306; font-family: var(--mono);
  font-size: 11px; font-weight: 800;
  border-radius: 99px; min-width: 19px; height: 19px; display: flex; align-items: center;
  justify-content: center; padding: 0 5px;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(94,240,176,0.15); }
  50%      { box-shadow: 0 0 0 6px rgba(94,240,176,0.06); }
}

/* ===== BUTOANE ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius); font-family: var(--mono);
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; border: 1px solid transparent; transition: all var(--t); white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn-primary { background: var(--amber); color: #1a1306; }
.btn-primary:hover { background: #ffc34d; box-shadow: 0 0 0 1px var(--amber), 0 8px 24px rgba(255,176,32,0.25); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: transparent; border-color: var(--border2); color: var(--text); }
.btn-outline:hover { border-color: var(--amber); color: var(--amber); }
.btn-block { width: 100%; }

/* ===== SECȚIUNI ===== */
.section { padding: 48px 0 64px; }
.section-title {
  font-family: var(--mono); font-size: 26px; font-weight: 800;
  letter-spacing: -0.01em; margin-bottom: 28px;
  display: flex; align-items: baseline; gap: 14px;
}
.section-title::before {
  content: '//';
  color: var(--amber);
  font-weight: 700;
}

/* ===== FILTRE ===== */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; align-items: center; }
.filter-chip {
  padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border2);
  color: var(--text2); font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; cursor: pointer; transition: all var(--t); background: var(--surface);
}
.filter-chip::before { content: '['; margin-right: 4px; color: var(--text3); }
.filter-chip::after  { content: ']'; margin-left: 4px; color: var(--text3); }
.filter-chip:hover { border-color: var(--amber-dim); color: var(--text); }
.filter-chip.active { background: var(--amber); border-color: var(--amber); color: #1a1306; }
.filter-chip.active::before, .filter-chip.active::after { color: #1a1306; opacity: 0.5; }
.search-box {
  flex: 1; min-width: 240px; padding: 11px 16px; border-radius: var(--radius);
  border: 1px solid var(--border2); background: var(--surface); color: var(--text);
  font-family: var(--sans); font-size: 14px; transition: border-color var(--t);
}
.search-box:focus { outline: none; border-color: var(--amber); }
.search-box::placeholder { color: var(--text3); }

/* ===== GRID PRODUSE ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform var(--t), border-color var(--t), box-shadow var(--t);
  display: flex; flex-direction: column; position: relative;
}
.product-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.product-card-img {
  aspect-ratio: 1; background: var(--bg2); display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.product-card-img img { object-fit: contain; max-height: 86%; max-width: 86%; transition: transform var(--t); }
.product-card:hover .product-card-img img { transform: scale(1.05); }

/* colțuri de "reticul" — apar pe hover, ca un focus de cameră */
.product-card-img::before, .product-card-img::after,
.product-detail-img::before, .product-detail-img::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  border-color: var(--amber); opacity: 0; transition: opacity var(--t);
  pointer-events: none;
}
.product-card-img::before { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.product-card-img::after  { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }
.product-card:hover .product-card-img::before,
.product-card:hover .product-card-img::after { opacity: 0.85; }

.product-card-body { padding: 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.product-card-cat {
  font-family: var(--mono); font-size: 10.5px; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.product-card-name { font-size: 14.5px; font-weight: 600; flex: 1; line-height: 1.4; }
.product-card-price {
  font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.product-card-stock {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--green); display: flex; align-items: center; gap: 6px;
}
.product-card-stock::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2px rgba(94,240,176,0.18);
}
.product-card-stock.out { color: var(--text3); }
.product-card-stock.out::before { background: var(--red); box-shadow: 0 0 0 2px rgba(255,87,87,0.15); }

/* ===== DETALIU PRODUS ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 52px; }
.product-detail-img {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px; position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 320px;
}
.product-detail-img::before { top: 14px; left: 14px; border-top: 2px solid; border-left: 2px solid; opacity: 0.55; }
.product-detail-img::after  { bottom: 14px; right: 14px; border-bottom: 2px solid; border-right: 2px solid; opacity: 0.55; }
.product-detail-name { font-size: 26px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.product-detail-brand {
  font-family: var(--mono); font-size: 12px; color: var(--text2); margin-bottom: 18px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.product-detail-price {
  font-family: var(--mono); font-size: 34px; font-weight: 800; color: var(--amber);
  margin: 18px 0; font-variant-numeric: tabular-nums;
}
.product-detail-desc { color: var(--text2); margin: 20px 0; line-height: 1.7; }
.product-detail-desc b { color: var(--text); font-weight: 600; }
.qty-input {
  width: 84px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border2);
  background: var(--surface); color: var(--text); text-align: center; font-family: var(--mono);
}
.qty-input:focus { outline: none; border-color: var(--amber); }

/* ===== COȘ ===== */
.cart-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 36px; align-items: start; }
.cart-item {
  display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items: center;
}
.cart-item-img {
  width: 72px; height: 72px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cart-item-img img { object-fit: contain; max-width: 80%; max-height: 80%; }
.cart-item-name { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.cart-item-remove {
  color: var(--red); font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; transition: opacity var(--t);
}
.cart-item-remove:hover { opacity: 0.7; }
.cart-summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; position: sticky; top: 96px;
}
.cart-summary-row {
  display: flex; justify-content: space-between; margin-bottom: 14px; color: var(--text2);
  font-family: var(--mono); font-size: 13px;
}
.cart-summary-row.total {
  color: var(--amber); font-weight: 800; font-size: 19px; border-top: 1px solid var(--border);
  padding-top: 16px; margin-top: 4px;
}

/* ===== FORMULARE ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-family: var(--mono); font-size: 11px; color: var(--text3); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
input, textarea, select {
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border2);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: var(--sans);
  transition: border-color var(--t);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); }

.empty-state {
  text-align: center; padding: 72px 24px; color: var(--text3);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
}
.badge {
  display: inline-block; padding: 5px 12px; border-radius: var(--radius); font-size: 11px;
  font-weight: 700; font-family: var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
}
.badge-success { background: var(--green-dim); color: var(--green); }
.badge-error   { background: var(--red-dim); color: var(--red); }
.badge-pending { background: var(--amber-dim); color: var(--amber); }

footer {
  border-top: 1px solid var(--border); padding: 32px 0; color: var(--text3);
  text-align: center; font-size: 12px; font-family: var(--mono); letter-spacing: 0.04em;
  position: relative; z-index: 1;
}
footer a { color: var(--text2); }
footer a:hover { color: var(--amber); }

@media (max-width: 768px) {
  .product-detail, .cart-layout, .form-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
