/* ═══════════════════════════════════════════════════════════════
   METAOUT — KNIFE SHOP · TELEGRAM MINI APP
   Dark industrial theme
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg:       #0d0d0d;
  --bg-card:  #1a1a1a;
  --accent:   #d4a853;
  --accent2:  #e8c97a;
  --text:     #e0ddd8;
  --text-dim: #8a8780;
  --danger:   #c0392b;
  --green:    #27ae60;
  --radius:   10px;
  --nav-h:    64px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.global-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 50% 0%, #1a1408 0%, var(--bg) 70%);
}

/* ── PAGES ── */
.page {
  display: none; position: relative; z-index: 1;
  min-height: calc(100dvh - var(--nav-h)); padding-bottom: calc(var(--nav-h) + 20px);
}
.page.active { display: block; }
.page-content { padding: 20px 16px; max-width: 600px; margin: 0 auto; }

/* ── HOME ── */
.home-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100dvh - var(--nav-h)); text-align: center; padding: 40px 20px;
}
.home-logo {
  font-size: 48px; font-weight: 900; letter-spacing: 6px;
  color: var(--accent); text-shadow: 0 2px 20px rgba(212,168,83,0.3);
  margin-bottom: 12px;
}
.home-subtitle {
  font-size: 14px; letter-spacing: 4px; color: var(--text-dim); margin-bottom: 16px;
}
.home-tagline {
  font-size: 16px; color: var(--text); max-width: 280px; margin-bottom: 40px; opacity: 0.8;
}

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0d0d0d; border: none; padding: 14px 36px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: all 0.2s;
  text-transform: uppercase;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }

.btn-sm {
  background: var(--bg-card); color: var(--accent); border: 1px solid var(--accent);
  padding: 8px 18px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.btn-sm:active { opacity: 0.7; }

.btn-qty {
  background: var(--bg); color: var(--text); border: 1px solid #333;
  width: 34px; height: 34px; border-radius: 8px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── PAGE TITLE ── */
.page-title {
  font-size: 22px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 20px; position: relative; padding-bottom: 12px;
}
.page-title::after {
  content: ""; position: absolute; bottom: 0; left: 0;
  width: 40px; height: 3px; background: var(--accent); border-radius: 2px;
}

/* ── ABOUT ── */
.about-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.about-label {
  font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--accent);
  margin-bottom: 10px;
}
.about-card p { font-size: 14px; line-height: 1.6; color: var(--text-dim); }
.value-item {
  padding: 8px 0; font-size: 14px; color: var(--text);
  border-bottom: 1px solid #222;
}
.value-item:last-child { border-bottom: none; }

/* ── CATALOG ── */
.cat-filters {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.cat-filters::-webkit-scrollbar { display: none; }
.cat-chip {
  background: var(--bg-card); color: var(--text-dim); border: 1px solid #333;
  padding: 8px 16px; border-radius: 20px; font-size: 13px; white-space: nowrap;
  cursor: pointer; transition: all 0.2s;
}
.cat-chip.active { background: var(--accent); color: #0d0d0d; border-color: var(--accent); font-weight: 700; }

.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.product-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform 0.15s;
}
.product-card:active { transform: scale(0.97); }
.product-img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #111;
}
.product-info { padding: 10px 12px; }
.product-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.product-price { font-size: 16px; font-weight: 800; color: var(--accent); }
.product-old-price { font-size: 12px; color: var(--text-dim); text-decoration: line-through; margin-right: 6px; }

/* ── PRODUCT DETAIL ── */
.detail-gallery { margin-bottom: 16px; }
.detail-gallery img {
  width: 100%; border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; background: #111;
}
.detail-name { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.detail-category { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.detail-price-block { margin-bottom: 16px; }
.detail-price { font-size: 28px; font-weight: 800; color: var(--accent); }
.detail-old { font-size: 16px; color: var(--text-dim); text-decoration: line-through; margin-left: 8px; }
.detail-desc { font-size: 14px; line-height: 1.7; color: var(--text-dim); margin-bottom: 20px; }
.detail-add-btn { width: 100%; }

/* ── CART ── */
.cart-item {
  display: flex; gap: 12px; background: var(--bg-card); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; align-items: center;
}
.cart-item-img {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #111;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { font-size: 14px; color: var(--accent); font-weight: 700; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-subtotal { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.cart-total {
  text-align: right; font-size: 20px; font-weight: 800; padding: 16px 0;
  color: var(--accent);
}
.cart-empty { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 14px; }

/* ── CHECKOUT ── */
.field-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--text-dim); margin-bottom: 4px; margin-top: 12px; text-transform: uppercase;
}
.field-input {
  width: 100%; padding: 12px; background: var(--bg-card); border: 1px solid #333;
  border-radius: 8px; color: var(--text); font-size: 15px;
  font-family: inherit; outline: none;
}
.field-input:focus { border-color: var(--accent); }
select.field-input { appearance: none; }

/* ── ORDERS ── */
.order-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.order-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.order-id { font-weight: 700; color: var(--accent); }
.order-status {
  font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.order-status.new { background: #2c3e50; color: #3498db; }
.order-status.confirmed { background: #1a3a2a; color: var(--green); }
.order-status.shipped { background: #3a2a1a; color: #e67e22; }
.order-status.delivered { background: #1a2a3a; color: #2980b9; }
.order-status.cancelled { background: #3a1a1a; color: var(--danger); }
.order-info { font-size: 13px; color: var(--text-dim); }
.order-total { font-size: 16px; font-weight: 700; color: var(--accent); margin-top: 4px; }

/* ── PROMOS ── */
.promo-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  border-left: 3px solid var(--accent);
}
.promo-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.promo-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  background: rgba(13,13,13,0.95); backdrop-filter: blur(12px);
  border-top: 1px solid #222; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 10px; cursor: pointer;
  transition: all 0.2s; color: var(--text-dim); font-size: 10px;
  font-weight: 600; letter-spacing: 0.5px;
}
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 20px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #0d0d0d; padding: 12px 24px;
  border-radius: 24px; font-weight: 700; font-size: 14px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* ── BACK BUTTON ── */
.back-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; cursor: pointer; }
.back-arrow { font-size: 20px; color: var(--accent); }
.back-label { font-size: 13px; color: var(--text-dim); }
