/*
Theme Name: ОКБРР Shop
Theme URI: https://shop.okbrr.ru/
Author: Fleysher
Description: Custom WooCommerce theme matching okbrr.ru visual identity. Graph-paper aesthetic, ESKD markers, ОТК stamps, JetBrains Mono.
Version: 0.1
License: Proprietary
Text Domain: okbrr-shop
Tags: e-commerce, woocommerce, dark, custom-colors, custom-menu
*/

/* ============ RESET / BASE ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: #0f172a;
  background:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
    #fafaf7;
  background-size: 32px 32px, 32px 32px;
  line-height: 1.5;
}
*:focus-visible { outline: 2px solid #d97706; outline-offset: 2px; border-radius: 4px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabnums { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============ TOP BAR ============ */
.top-bar {
  background: #0a0f19;
  color: #cbd5e1;
  font-size: 12px;
  padding: 8px 0;
}
.top-bar .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.top-bar a { color: #cbd5e1; margin-right: 18px; transition: color .12s; }
.top-bar a:hover { color: #fbbf24; }
.top-bar .stats { font-family: 'JetBrains Mono', monospace; color: #94a3b8; }
.top-bar .stats span { color: #fbbf24; font-weight: 600; }

/* ============ HEADER ============ */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 80;
}
.site-header .wrap {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; color: #0f172a;
}
.logo-mark {
  width: 32px; height: 32px;
  background: #0f172a; color: #fbbf24;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 13px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.header-search {
  display: flex; align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.header-search:focus-within { border-color: #0f172a; background: #fff; }
.header-search input {
  flex: 1; border: none; background: transparent;
  padding: 12px 0; font-size: 15px; outline: none;
  font-family: 'JetBrains Mono', monospace;
}
.header-search button {
  background: #0f172a; color: #fff;
  border: none; padding: 8px 18px;
  border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.header-search button:hover { background: #fbbf24; color: #0f172a; }
.header-actions { display: flex; gap: 14px; align-items: center; }
.header-actions a { color: #475569; font-size: 14px; }
.header-actions a:hover { color: #0f172a; }
.cart-pill {
  background: #0f172a !important; color: #fff !important;
  padding: 8px 16px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.cart-pill .badge {
  background: #fbbf24; color: #0f172a;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* ============ NAV STRIP ============ */
.cats-nav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}
.cats-nav .wrap { display: flex; gap: 4px; padding: 0 24px; }
.cats-nav a {
  color: #475569;
  padding: 14px 16px; font-size: 14px; font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .12s;
}
.cats-nav a:hover { color: #0f172a; border-bottom-color: #fbbf24; }
.cats-nav a.current { color: #0f172a; border-bottom-color: #0f172a; font-weight: 600; }

/* ============ HERO ============ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, rgba(10,15,25,.95) 0%, rgba(10,15,25,.88) 50%, rgba(10,15,25,.78) 100%), #0a0f19;
  color: #fff;
  padding: 64px 0;
}
.hero .wrap { position: relative; z-index: 2; }
.pcb-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 1; mix-blend-mode: screen; }
.pcb-trace { fill: none; stroke: #f59e0b; stroke-width: 1.2; opacity: 0.55; stroke-dasharray: 6 4; }
.pcb-trace.t1 { animation: pcb-dash 6s linear infinite; }
.pcb-trace.t2 { animation: pcb-dash 9s linear infinite reverse; }
.pcb-trace.t3 { animation: pcb-dash 12s linear infinite; }
.pcb-pad { fill: #f59e0b; opacity: 0.7; animation: pcb-pulse 3s ease-in-out infinite; }
.pcb-pad.p2 { animation-delay: 1s; }
.pcb-pad.p3 { animation-delay: 2s; }
@keyframes pcb-dash { to { stroke-dashoffset: -100; } }
@keyframes pcb-pulse { 0%,100% { opacity: 0.3; r: 3; } 50% { opacity: 0.85; r: 4.5; } }
@media (prefers-reduced-motion: reduce) {
  .pcb-trace { animation: none !important; }
  .pcb-pad { animation: none !important; }
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(251,191,36,0.4);
  color: #fcd34d;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px;
  padding: 6px 14px; border-radius: 99px;
  margin-bottom: 20px;
}
.hero-tag .dot {
  width: 6px; height: 6px; background: #fbbf24; border-radius: 50%;
  animation: pcb-pulse 2.5s ease-in-out infinite;
}
.hero h1 {
  font-size: 48px; line-height: 1.05;
  font-weight: 800; letter-spacing: -1px;
  max-width: 720px; margin: 0 0 16px;
  color: #fff;
}
.hero p.lead {
  font-size: 17px; color: #cbd5e1;
  max-width: 640px; margin: 0 0 28px;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  max-width: 720px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hero-stats .stat .num {
  font-size: 26px; font-weight: 800; color: #fbbf24;
  font-family: 'JetBrains Mono', monospace;
  display: block;
}
.hero-stats .stat .lbl {
  font-size: 11px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1.2px;
  font-family: 'JetBrains Mono', monospace;
}

/* ============ SECTION ============ */
section.sec {
  padding: 56px 0;
}
section.sec .wrap { position: relative; }
.sec-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 28px;
  flex-wrap: wrap; gap: 12px;
}
.sec-head .marker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1.6px;
  margin-bottom: 6px;
}
.sec-head h2 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.5px;
  margin: 0;
}
.sec-head .more {
  color: #0f172a; font-weight: 600;
  border-bottom: 2px solid #fbbf24; padding-bottom: 2px;
}

/* ============ CATEGORY CARDS ============ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.cat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cat-card:hover {
  border-color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(15,23,42,0.18);
}
.cat-card .img-wrap {
  width: 100%; aspect-ratio: 1/1;
  background: linear-gradient(135deg, #fafaf7, #f1f5f9);
  border-radius: 8px;
  overflow: hidden;
  display: grid; place-items: center;
}
.cat-card img {
  width: 70%; height: 70%; object-fit: contain;
  mix-blend-mode: multiply;
}
.cat-card .ic-fallback {
  font-size: 36px; opacity: 0.6;
}
.cat-card .name { font-weight: 600; font-size: 14px; line-height: 1.3; color: #0f172a; }
.cat-card .qty { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #64748b; }

/* ============ PRODUCT CARD ============ */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (max-width: 1100px) { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .prod-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .prod-grid { grid-template-columns: 1fr; } }
.prod {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all .15s;
  position: relative;
}
.prod:hover {
  border-color: #0f172a;
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -16px rgba(15,23,42,0.2);
}
.prod-img::before {
  content: '✓ ОТК';
  position: absolute;
  bottom: 10px; left: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(15,23,42,0.35);
  border: 1px solid rgba(15,23,42,0.25);
  padding: 2px 6px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
  transform: rotate(-4deg);
  background: rgba(255,255,255,0.6);
}
.prod-img {
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, #fafaf7 0%, #f1f5f9 100%);
  position: relative; overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}
.prod-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 22px;
  mix-blend-mode: multiply;
  transition: transform .25s;
}
.prod:hover .prod-img img { transform: scale(1.05); }
.prod-img .no-photo {
  position: absolute; inset: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: #94a3b8;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(15,23,42,0.025) 8px 9px),
    #fafaf7;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  text-align: center;
}
.prod-img .no-photo .ic {
  font-size: 32px;
  color: #cbd5e1;
  line-height: 1;
  opacity: 0.6;
}
.prod-img .no-photo .lbl { font-size: 9px; }
.prod-tag {
  position: absolute; top: 12px; right: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 9px; border-radius: 99px;
  z-index: 2;
}
.prod-tag.new { background: #0f172a; color: #fbbf24; }
.prod-tag.last { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
.prod-tag.low { background: #fff; color: #ea580c; border: 1px solid #fed7aa; }
.prod-info {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.prod-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1px;
}
.prod-title {
  font-size: 15px; font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  margin: 0;
}
.prod-title a { color: inherit; }
.prod-bottom {
  display: flex; justify-content: space-between; align-items: end;
  gap: 12px; margin-top: 8px;
  padding-top: 12px; border-top: 1px solid #f1f5f9;
}
.prod-price {
  display: flex; flex-direction: column;
}
.prod-price .val {
  font-size: 19px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #0f172a;
  line-height: 1;
}
.prod-price .val.noprice {
  font-size: 12px; font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.prod-price .qty {
  font-size: 11px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
  color: #16a34a;
}
.prod-price .qty.low { color: #ea580c; }
.prod-price .qty.out { color: #94a3b8; }
.add-btn {
  background: #0f172a; color: #fff;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
  transition: all .12s;
  text-decoration: none;
  line-height: 1;
}
.add-btn:hover { background: #fbbf24; color: #0f172a; transform: scale(1.1); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 8px;
  font-weight: 600; font-size: 14px;
  transition: all .12s; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: #fbbf24; color: #0a0f19; border-color: #fbbf24; }
.btn-primary:hover { background: #f59e0b; }
.btn-dark { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn-dark:hover { background: #fbbf24; color: #0a0f19; border-color: #fbbf24; }
.btn-secondary { background: #fff; color: #0f172a; border-color: #cbd5e1; }
.btn-secondary:hover { border-color: #0f172a; }

/* ============ WC OVERRIDES (sidebar, results count, sorting) ============ */
.woocommerce-result-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.woocommerce-ordering select {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  background: #fff;
}
.woocommerce-pagination ul { list-style: none; padding: 0; display: flex; gap: 6px; }
.woocommerce-pagination ul li a, .woocommerce-pagination ul li span {
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff;
  font-size: 14px; font-weight: 600;
}
.woocommerce-pagination ul li span.current { background: #0f172a; color: #fff; border-color: #0f172a; }
.woocommerce-breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: #94a3b8;
  margin-bottom: 16px;
}
.woocommerce-breadcrumb a { color: #475569; }
.woocommerce-breadcrumb a:hover { color: #0f172a; }

/* ============ SINGLE PRODUCT ============ */
.single-prod {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  padding: 32px 0;
}
@media (max-width: 768px) { .single-prod { grid-template-columns: 1fr; gap: 24px; } }
.single-prod .pd-gallery {
  background: linear-gradient(135deg, #fafaf7, #f1f5f9);
  border-radius: 16px;
  aspect-ratio: 1/1;
  display: grid; place-items: center;
  padding: 60px;
  position: relative;
}
.single-prod .pd-gallery img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.single-prod .pd-info { display: flex; flex-direction: column; gap: 16px; }
.single-prod h1 {
  font-size: 36px; font-weight: 800;
  line-height: 1.1; letter-spacing: -0.5px;
  margin: 0;
}
.pd-cat { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1.5px; }
.pd-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 5px 12px; border-radius: 99px;
}
.pd-tag.stock { background: #dcfce7; color: #166534; }
.pd-tag.otk { background: #dbeafe; color: #1e3a8a; }
.pd-tag.ussr { background: #fef3c7; color: #92400e; }
.pd-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: #fafaf7;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}
.pd-meta .row { display: flex; flex-direction: column; gap: 2px; }
.pd-meta .lbl { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.pd-meta .val { font-weight: 600; font-size: 14px; }
.pd-price-row {
  display: flex; justify-content: space-between; align-items: end;
  padding: 18px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}
.pd-price { font-size: 36px; font-weight: 800; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.pd-price .cur { font-size: 18px; color: #64748b; margin-left: 4px; }
.pd-stock { font-size: 13px; color: #16a34a; font-weight: 600; margin-top: 4px; }

/* WooCommerce single-product native form */
.woocommerce div.product form.cart .quantity { margin-right: 8px; }
.woocommerce div.product form.cart .quantity input.qty {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  border: 1px solid #cbd5e1; border-radius: 6px;
  height: 48px; width: 70px;
  text-align: center;
}
.woocommerce div.product form.cart .button.single_add_to_cart_button {
  background: #0f172a !important; color: #fff !important;
  border-radius: 6px !important; font-weight: 700 !important;
  padding: 14px 28px !important;
  font-size: 15px !important;
}
.woocommerce div.product form.cart .button.single_add_to_cart_button:hover {
  background: #fbbf24 !important; color: #0a0f19 !important;
}

/* ============ FOOTER ============ */
.site-footer {
  background: #0a0f19;
  color: #94a3b8;
  padding: 48px 0 24px;
  margin-top: 64px;
}
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 {
  color: #fff; font-size: 14px; font-weight: 700;
  margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: 1px;
  font-family: 'JetBrains Mono', monospace;
}
.site-footer a { color: #94a3b8; display: block; padding: 5px 0; font-size: 14px; }
.site-footer a:hover { color: #fbbf24; }
.site-footer p { font-size: 13px; line-height: 1.6; margin: 0 0 8px; max-width: 320px; }
.footer-bottom {
  max-width: 1280px; margin: 32px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: #64748b;
}
@media (max-width: 768px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .site-header .wrap { grid-template-columns: auto 1fr auto; gap: 12px; }
  .hero h1 { font-size: 36px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 640px) {
  .site-header .wrap { grid-template-columns: 1fr auto; }
  .header-search { grid-column: 1 / -1; order: 3; margin-top: 8px; }
  .hero h1 { font-size: 28px; }
  .sec-head h2 { font-size: 24px; }
  .single-prod h1 { font-size: 26px; }
  .pd-price { font-size: 28px; }
}

/* ============ HIDE WP DEFAULTS WE DON'T WANT ============ */
.page-template-default .entry-title:first-of-type { display: none; }
.entry-content h1.entry-title { display: none; }
