

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

:root {
  --bg: #000; --bg2: #0a0a0a; --bg3: #111; --card: #1a1a1a;
  --border: rgba(255,255,255,0.08); --text: #f5f5f7;
  --muted: #555558; --secondary: #a1a1a6;
  --accent: #0071e3; --accent2: #00d4ff; --gold: #f5a623;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'DM Sans', -apple-system, sans-serif; font-weight: 300; overflow-x: hidden; min-height: 100vh; }

/* ── Light theme overrides (match main site) ── */
:root {
  --bg: #f5f5f7; --bg2: #ffffff; --bg3: #f2f2f7; --card: #ffffff;
  --border: rgba(0,0,0,0.06); --text: #1d1d1f;
  --muted: #555558; --secondary: #3a3a3c;
  --accent: #0071e3; --accent2: #0a84ff; --gold: #bf8c30;
}

body { background: radial-gradient(circle at top, #e8f0ff 0, #f5f5f7 40%, #f2f2f7 100%); color: var(--text); font-family: 'SF Pro Display', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-weight: 400; }

/* ── NAV (как на главной) ── */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 0 48px; height: 60px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.82); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0,0,0,0.04); box-shadow: 0 0 0 0.5px rgba(0,0,0,0.03), 0 12px 30px rgba(0,0,0,0.08); transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.nav-logo { font-family: inherit; font-size: 24px; font-weight: 700; color: #111; text-decoration: none; letter-spacing: -0.04em; display: inline-flex; align-items: center; gap: 12px; }
.nav-logo img { height: 56px; width: auto; display: block; }
.nav-logo span { color: var(--accent2); }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a { font-size: 14px; color: var(--secondary); text-decoration: none; transition: color 0.2s; font-weight: 500; }
.nav-links a:hover { color: #111; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.nav-cta { font-size: 14px; padding: 8px 20px; background: var(--accent); color: white; border-radius: 22px; text-decoration: none; font-weight: 600; transition: all 0.2s; }
.nav-cta:hover { background: #0077ed; }
.nav-login { font-size: 14px; padding: 8px 18px; border: 1px solid rgba(0,0,0,0.12); color: rgba(0,0,0,0.7); border-radius: 22px; text-decoration: none; transition: all 0.2s; background: rgba(255,255,255,0.7); font-weight: 500; }
.nav-login:hover { color: #111; border-color: rgba(0,0,0,0.28); background: rgba(255,255,255,0.95); }
.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: none; background: transparent; color: #111; font-size: 24px; cursor: pointer; border-radius: 10px; flex-shrink: 0; }
.nav-toggle:hover { background: rgba(0,0,0,0.06); }
.nav-menu { display: flex; align-items: center; gap: 36px; }

/* ── PAGE WRAPPER ── */
.page-wrap { padding-top: 52px; min-height: 100vh; display: flex; flex-direction: column; }

/* ── LOADING / ERROR ── */
.page-state { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 80px 48px; text-align: center; }
.page-state-icon { font-size: 48px; }
.page-state-title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-family: inherit; }
.page-state-sub { color: var(--secondary); font-size: 16px; }
.page-state-link { color: var(--accent2); text-decoration: none; font-size: 15px; font-weight: 500; transition: opacity 0.2s; }
.page-state-link:hover { opacity: 0.75; }
.spinner { width: 40px; height: 40px; border: 2px solid var(--border); border-top-color: var(--accent2); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BREADCRUMB ── */
.breadcrumb { padding: 20px 48px 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--secondary); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--secondary); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── PRODUCT PAGE ── */
.product-page { flex: 1; padding: 24px 48px 80px; max-width: 1200px; width: 100%; margin: 0 auto; }

.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }

/* ── GALLERY ── */
.product-gallery { position: sticky; top: 72px; }
.gallery-main { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #f1f1f5; border: 1px solid var(--border); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 12px; transition: opacity 0.15s; }
.gallery-icon { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 120px; background: #f1f1f5; }
.gallery-badge { position: absolute; top: 16px; left: 16px; background: var(--accent); color: white; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px; border-radius: 12px; z-index: 2; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); border: 1px solid rgba(0,0,0,0.12); color: #111; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; z-index: 2; }
.gallery-main:hover .gallery-nav { opacity: 1; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; cursor: pointer; opacity: 0.45; transition: opacity 0.2s; border: 2px solid transparent; flex-shrink: 0; }
.gallery-thumb.active { opacity: 1; border-color: var(--accent); }
.gallery-thumb-icon { width: 72px; height: 72px; background: var(--card); border-radius: 10px; cursor: pointer; opacity: 0.45; display: flex; align-items: center; justify-content: center; font-size: 28px; border: 2px solid transparent; flex-shrink: 0; transition: opacity 0.2s; }
.gallery-thumb-icon.active { opacity: 1; border-color: var(--accent); }

/* ── PRODUCT INFO ── */
.product-info { padding-top: 8px; }
.prod-eyebrow { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.prod-badge { display: inline-block; background: rgba(0,113,227,0.15); border: 1px solid rgba(0,113,227,0.3); color: var(--accent2); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 12px; border-radius: 10px; }
.prod-brand-badge { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 4px 12px; border-radius: 10px; border: 1px solid var(--border); }
.prod-title { font-size: 32px; font-weight: 700; line-height: 1.15; margin-bottom: 10px; letter-spacing: -0.05em; font-family: inherit; }
.prod-origin { font-size: 13px; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 6px; }
.prod-price { font-size: 26px; font-weight: 600; color: var(--gold); margin-bottom: 12px; }
.prod-price.on-request { font-size: 17px; font-weight: 400; color: var(--secondary); font-style: italic; }
.prod-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 10px; margin-bottom: 24px; }
.stock-in  { background: rgba(48,209,88,0.1);  border: 1px solid rgba(48,209,88,0.3);  color: #30d158; }
.stock-order{ background: rgba(255,159,10,0.1); border: 1px solid rgba(255,159,10,0.3); color: #ff9f0a; }
.prod-delivery { font-size: 13px; color: var(--muted); margin-top: -14px; margin-bottom: 20px; }
.prod-desc { font-size: 16px; color: var(--secondary); line-height: 1.75; font-weight: 400; margin-bottom: 28px; }
.prod-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }

.cart-btn {
  margin-left: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cart-btn:hover {
  border-color: var(--accent);
}
.cart-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prod-cart-btn {
  margin-top: 8px;
  margin-bottom: 20px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.prod-cart-btn:hover {
  border-color: var(--accent);
}
.prod-tag { font-size: 12px; padding: 5px 12px; background: rgba(0,0,0,0.02); border: 1px solid var(--border); border-radius: 999px; color: var(--secondary); }

/* ── REQUEST FORM ── */
.req-form { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 28px; box-shadow: 0 18px 40px rgba(0,0,0,0.06); }
.req-form-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.req-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.req-input { width: 100%; padding: 12px 14px; background: #f5f5f7; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.req-input:focus { border-color: var(--accent); background: #ffffff; box-shadow: 0 0 0 1px rgba(0,113,227,0.25); }
.req-btn { width: 100%; padding: 14px; background: var(--accent); color: white; border: none; border-radius: 12px; font-size: 15px; font-weight: 500; font-family: inherit; cursor: pointer; margin-top: 10px; transition: all 0.2s; box-shadow: 0 14px 30px rgba(0,113,227,0.35); }
.req-btn:hover { background: #0077ed; transform: scale(1.01); }
.req-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.req-success { text-align: center; padding: 16px; background: rgba(48,209,88,0.1); border: 1px solid rgba(48,209,88,0.3); border-radius: 10px; color: #30d158; font-size: 14px; margin-top: 10px; display: none; }

/* ── BACK TO CATALOG ── */
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--secondary); text-decoration: none; font-size: 14px; margin-bottom: 28px; transition: color 0.2s; padding: 8px 0; }
.back-link:hover { color: #111; }
.back-link svg { transition: transform 0.2s; }
.back-link:hover svg { transform: translateX(-4px); }

/* ── FOOTER ── */
footer { padding: 48px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; background: var(--bg2); }
.footer-logo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-family: inherit; }
.footer-logo span { color: var(--accent2); }
.footer-links { display: flex; gap: 32px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: #111; }
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-admin { color: rgba(0,0,0,0.2); text-decoration: none; font-size: 11px; margin-left: 8px; transition: color 0.2s; }
.footer-admin:hover { color: rgba(0,0,0,0.5); }

/* ── MESSENGER BUTTONS ── */
.messenger-btns{position:fixed;bottom:28px;right:28px;z-index:9000;display:flex;flex-direction:column;gap:12px;}
.messenger-btn{width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;text-decoration:none;box-shadow:0 4px 16px rgba(0,0,0,0.2);transition:transform .2s,box-shadow .2s;}
.messenger-btn:hover{transform:scale(1.1);box-shadow:0 6px 24px rgba(0,0,0,0.26);}
.messenger-btn-wa{background:#25d366;}
.messenger-btn-tg{background:#0088cc;}

@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; gap: 36px; }
  .product-gallery { position: static; }
}
@media (max-width: 768px) {
  nav { padding: 0 24px; }
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    box-sizing: border-box;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 12px 24px 16px;
    gap: 12px;
    max-height: calc(100vh - 52px - 16px);
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-radius: 0 0 20px 20px;
    display: none;
  }
  nav.nav-open .nav-menu { display: flex; }
  .nav-menu .nav-links { display: flex; flex-direction: column; gap: 10px; }
  .nav-menu .nav-links a { font-size: 18px; padding: 16px 0; color: #111; }
  .nav-menu .nav-right { flex-direction: column; width: 100%; }
  .nav-menu .nav-right a { width: 100%; text-align: center; padding: 14px 20px; }
  .breadcrumb { padding: 16px 24px 0; }
  .product-page { padding: 16px 24px 60px; }
  .prod-title { font-size: 26px; }
  .req-row { grid-template-columns: 1fr; }
  footer { padding: 32px 24px; }
}
/* ── доработки карточки ── */
.td-prod-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 22px; }
.td-prod-actions .req-btn { width: auto; margin: 0; padding: 13px 26px; }
.td-prod-actions .prod-cart-btn { margin: 0; padding: 13px 22px; font-size: 14px; }
.td-price-note { font-size: 12px; color: #8a8a8e; margin: -6px 0 14px; max-width: 420px; }
.td-gallery-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #8a8a8e; font-size: 14px; background: linear-gradient(135deg,#f3f4f7,#e9ebf0); }
.req-error { text-align: center; padding: 12px; background: rgba(255,69,58,0.08); border: 1px solid rgba(255,69,58,0.3); border-radius: 10px; color: #d70015; font-size: 14px; margin-top: 10px; display: none; }
.gallery-thumb { object-fit: contain !important; background: #fff; border: 2px solid rgba(0,0,0,0.06) !important; }
.gallery-thumb.active { border-color: var(--accent) !important; }
.prod-title { overflow-wrap: anywhere; }
.prod-badge a:hover { text-decoration: underline !important; }
textarea.req-input { resize: vertical; min-height: 60px; }
.breadcrumb { flex-wrap: wrap; max-width: 1296px; margin: 0 auto; }
.product-page { max-width: 1296px !important; }
.page-wrap { padding-top: 60px; }
@media (max-width: 768px) {
  .product-page { padding: 12px 16px 48px !important; }
  .breadcrumb { padding: 14px 16px 0; font-size: 12px; }
  .td-prod-actions .req-btn, .td-prod-actions .prod-cart-btn { flex: 1 1 100%; }
  .prod-title { font-size: 24px; }
  .req-form { padding: 20px; }
  .messenger-btns { bottom: 16px; right: 16px; }
  .messenger-btn { width: 46px; height: 46px; }
}
/* статический предрендер (products/<slug>.html) до загрузки данных */
.td-seo-pre{max-width:1200px;margin:0 auto;padding:32px 48px 60px}
.td-seo-pre .td-crumbs{margin-bottom:18px}
.td-seo-pre h1{font-size:30px;line-height:1.2;margin-bottom:12px}
.td-seo-pre .td-pre-img{max-width:420px;width:100%;aspect-ratio:4/3;object-fit:contain;background:#fff;border-radius:16px;margin:8px 0 20px}
.td-seo-pre .td-pre-price{font-size:20px;font-weight:600;margin:6px 0 14px}
@media(max-width:768px){.td-seo-pre{padding:20px 16px 40px}.td-seo-pre h1{font-size:24px}}
