﻿* { box-sizing: border-box; }

body {
  font-family: 'Pragmatica', 'Arial Narrow', Arial, sans-serif;
  background: #eef0f4;
  color: #1a1a2e;
  margin: 0; padding: 0; font-size: 13px;
}

/* ── HEADER ── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; background: #fff;
  border-bottom: 3px solid #cc0000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  position: sticky; top: 0; z-index: 50;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 34px; }
.logo-price { font-size: 18px; font-weight: 700; color: #cc0000; letter-spacing: 3px; text-transform: uppercase; }

/* ── BRAND NAV ── */
.brand-nav {
  display: flex; align-items: center;
  padding: 0 24px; background: #fff;
  border-bottom: 1px solid #e4e4e4;
}
.brand-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 20px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #888;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  user-select: none; white-space: nowrap;
}
.brand-tab:hover { color: #333; }
.brand-tab.active { color: var(--brand-color, #cc0000); border-bottom-color: var(--brand-color, #cc0000); }
.brand-tab.active-gant  { color: #cc0000; border-bottom-color: #cc0000; }
.brand-tab.active-roger { color: #e87722; border-bottom-color: #e87722; }
.brand-tab.active-nice  { color: #0055a5; border-bottom-color: #0055a5; }
.brand-tab.active-bft   { color: #cc0000; border-bottom-color: #cc0000; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-gant  { background: #cc0000; }
.dot-roger { background: #e87722; }
.dot-nice  { background: #0055a5; }
.dot-bft   { background: #cc0000; }

/* ── PDF MENU ── */
.pdf-menu {
  margin-left: auto; display: inline-flex; align-items: center; position: relative;
  flex: 0 0 auto;
}
.pdf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #cc0000; color: #fff; border: none;
  min-height: 32px; padding: 0 16px; font-size: 12px; font-weight: 700;
  cursor: pointer; border-radius: 6px; white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.pdf-btn:hover { background: #aa0000; box-shadow: 0 2px 5px rgba(0,0,0,0.12); }
.pdf-arrow-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #cc0000; color: #fff; border: none;
  cursor: pointer; border-radius: 0 5px 5px 0;
  border-left: 1px solid rgba(255,255,255,0.28);
  transition: background 0.15s; font-size: 11px; line-height: 1;
}
.pdf-arrow-btn:hover { background: #aa0000; }
.pdf-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e0e0e0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100; min-width: 210px; border-radius: 8px; overflow: hidden;
}
.pdf-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; text-decoration: none; color: #333; font-size: 12px;
  transition: background 0.1s;
}
.pdf-dropdown a:hover { background: #f5f5f5; }
.pdf-dropdown a.dd-all { font-weight: 700; border-bottom: 1px solid #f0f0f0; }
.dd-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── FILTERS ── */
.filters {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px; background: #fff;
  border-bottom: 1px solid #e4e4e4;
}
.filters label { font-size: 11px; color: #999; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.filters select, .filters input {
  font-size: 12px; padding: 5px 10px;
  border: 1px solid #ddd; border-radius: 5px;
  font-family: inherit; background: #fff; color: #333;
}
.filters select:focus, .filters input:focus { outline: none; border-color: #aaa; }
.filter-count { font-size: 11px; color: #bbb; margin-left: auto; }

/* ── CATALOG ── */
.catalog { padding: 16px 24px; }

/* ── BRAND SECTION ── */
.brand-section { display: none; }
.brand-section.active { display: block; }

/* ── CATEGORY BLOCK ── */
.cat-block {
  margin-bottom: 12px; background: #fff;
  border: 1px solid #e0e0e0; border-radius: 8px;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.cat-block.collapsed .cat-body { display: none; }
.cat-block.collapsed .ptable { display: none; }

.cat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; background: #f8f8f8;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid #e8e8e8;
  border-left: 4px solid #cc0000;
  border-left-color: var(--brand-color, #cc0000);
  transition: background 0.12s;
}
.cat-header:hover { background: #f2f2f2; }
.cat-header.roger-accent { border-left-color: #e87722; }
.cat-header.nice-accent  { border-left-color: #0055a5; }

.brand-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
  color: #fff; white-space: nowrap; letter-spacing: 0.5px; text-transform: uppercase;
}
.bb-gant  { background: #cc0000; }
.bb-roger { background: #e87722; }
.bb-nice  { background: #0055a5; }
.bb-bft   { background: #cc0000; }

.cat-title { font-size: 13px; font-weight: 700; color: #222; flex: 1; }
.cat-count { font-size: 10px; color: #999; background: #ebebeb; padding: 1px 8px; border-radius: 10px; }
.cat-arrow { font-size: 10px; color: #ccc; transition: transform 0.2s; }
.cat-block.collapsed .cat-arrow { transform: rotate(-90deg); }

/* ── PRICE TABLE ── */
.ptable { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.col-photo { width: 130px; }
.col-price { width: 100px; }

.ptable thead tr { background: #f5f5f5; }
.ptable thead th {
  padding: 6px 12px; font-size: 9px; font-weight: 700;
  color: #bbb; text-align: left;
  text-transform: uppercase; letter-spacing: 0.7px;
  border-bottom: 1px solid #e8e8e8;
}
.th-price { text-align: center; }
.ptable td { border-bottom: 1px solid #e0e0e0; }
.ptable tbody tr:last-child td { border-bottom: none; }
.ptable tbody tr:last-child td { border-bottom: none; }

.prod-row { vertical-align: top; transition: background 0.1s; }
.prod-row:hover { background: #fafbff; }

/* ── TD PHOTO ── */
.td-photo {
  padding: 10px; vertical-align: middle; text-align: center;
  background: #fafafa; border-right: 1px solid #f0f0f0;
}
.photo-wrap {
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.prod-img {
  width: 100px; height: 100px; max-width: 100px; max-height: 100px;
  object-fit: contain; display: block; transition: transform 0.2s;
}
.prod-img:hover { transform: scale(1.08); }
.photo-placeholder,
.photo-wrap.missing-photo::after {
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  color: #bbb; background: #f5f5f5; border: 1px solid #eee;
  border-radius: 6px; font-size: 12px; text-transform: uppercase;
}
.photo-wrap.missing-photo::after { content: 'фото'; }

/* ── TD MAIN ── */
.td-main { padding: 10px 14px; vertical-align: top; }

.prod-sku { display: none; }

.prod-name-row { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.prod-name-link {
  font-size: 13px; font-weight: 700; color: #1a1a2e;
  text-decoration: none; line-height: 1.3;
}
.prod-name-link:hover { color: #cc0000; }
.kit-badge {
  font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  background: #e8f0ff; color: #0055a5; border: 1px solid #c0d4ff;
  letter-spacing: 0.4px; text-transform: uppercase; flex-shrink: 0;
}

.prod-specs {
  display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px;
}
.prod-specs span {
  font-size: 10px; background: #f2f3f5; border-radius: 3px;
  padding: 2px 6px; color: #666; white-space: nowrap;
}

/* Kit */
.kit-contents {
  margin-top: 8px;
  background: #fff8f8; border: 1px solid #f5dada;
  border-radius: 5px; padding: 7px 10px;
}
.kit-label {
  font-size: 9px; font-weight: 700; color: #cc0000;
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px;
}
.kit-item { font-size: 11px; color: #555; line-height: 1.6; padding-left: 12px; position: relative; }
.kit-item::before { content: '—'; position: absolute; left: 0; color: #e0b0b0; }
.kit-qty { color: #bbb; font-size: 10px; margin-left: 3px; }

/* Addons */
.addons-block {
  margin-top: 8px;
  background: #f6f9ff; border: 1px solid #d5e3ff;
  border-radius: 5px; padding: 7px 10px;
}
.addons-label {
  font-size: 9px; font-weight: 700; color: #cc0000;
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px;
}
.addons-table { width: 100%; border-collapse: collapse; }
.addons-table tr:not(:last-child) td { border-bottom: 1px solid #f0f0f0; }
.addon-name-cell { padding: 4px 8px; }
.addon-price-cell { width: 58px; padding: 4px 8px; text-align: right; font-weight: 700; font-size: 11px; color: #cc0000; white-space: nowrap; border-left: 1px solid #f0f0f0; }
.addon-name { font-size: 11px; color: #555; text-decoration: none; line-height: 1.4; }
.addon-name:hover { color: #cc0000; }

/* ── TD PRICE ── */
.td-price {
  text-align: center; vertical-align: middle;
  padding: 10px 8px; border-left: 1px solid #f0f0f0;
  background: #fafafa;
}
.price-stack { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.price-old {
  font-size: 11px; color: #999; text-decoration: line-through;
  white-space: nowrap;
}
.price-eur { font-size: 17px; font-weight: 700; color: #1a1a2e; white-space: nowrap; }
.addon-price-cell { vertical-align: middle; }
.addon-old-price {
  display: block; font-size: 9px; color: #999;
  text-decoration: line-through; line-height: 1.2;
}
.addon-price { display: block; }
.empty-price {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 24px; text-align: center; color: #777;
}

/* ── FOOTER ── */
.footer {
  text-align: center; padding: 16px;
  font-size: 11px; color: #ccc;
  border-top: 1px solid #e8e8e8; margin-top: 8px; background: #fff;
}
.footer a { color: #cc0000; text-decoration: none; }

/* ── UTILITY ── */
.hidden { display: none !important; }

/* ── PRINT ── */
@media print {
  @page { size: A4 portrait; margin: 8mm 6mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  body { background: #fff !important; font-size: 10px; font-family: 'Arial Narrow', Arial, sans-serif; color: #111; margin: 0 !important; padding: 0 !important; width: 100% !important; }
  .header, .brand-nav, .filters, .footer, .pdf-menu { display: none !important; }
  .catalog { padding: 0 !important; margin: 0 !important; width: 100% !important; }
  .brand-section, .cat-block, .ptable { width: 100% !important; }

  .brand-section { display: block !important; }
  .brand-section.print-hidden { display: none !important; }

  /* Category */
  .cat-block {
    display: block !important; margin-bottom: 10px;
    border: 1px solid #ccc !important; box-shadow: none !important;
    border-radius: 0 !important; page-break-inside: avoid; break-inside: avoid; overflow: hidden;
  }
  .cat-header {
    display: flex !important; align-items: center !important; gap: 8px !important;
    padding: 5px 10px !important; background: #f5f5f5 !important;
    border-left: 4px solid #cc0000 !important; border-bottom: 1px solid #ccc !important;
  }
  .cat-header.roger-accent { border-left-color: #e87722 !important; }
  .cat-header.nice-accent  { border-left-color: #0055a5 !important; }
  .brand-badge { font-size: 8px !important; padding: 1px 6px !important; }
  .cat-title { font-size: 11px !important; font-weight: 700 !important; }
  .cat-count { font-size: 8px !important; }
  .cat-arrow { display: none !important; }

  /* Table — reset any mobile display:block overrides */
  .ptable { display: table !important; border-collapse: collapse !important; table-layout: fixed !important; }
  .ptable thead { display: table-header-group !important; }
  .ptable tbody { display: table-row-group !important; }
  .ptable tbody tr.prod-row { display: table-row !important; }
  .ptable td { display: table-cell !important; border-bottom: 1px solid #ddd !important; }
  .ptable tbody tr:last-child td { border-bottom: none !important; }
  .ptable thead th { display: table-cell !important; font-size: 8px !important; padding: 3px 8px !important; border-bottom: 1px solid #ccc !important; background: #f5f5f5 !important; }

  /* Column widths */
  .col-photo { width: 80px !important; }
  .col-price { width: 70px !important; }

  /* Photo */
  .td-photo { width: 80px !important; padding: 6px !important; background: #fafafa !important; vertical-align: middle !important; border-right: 1px solid #ddd !important; }
  .photo-wrap { width: 64px !important; height: 64px !important; display: flex !important; align-items: center !important; justify-content: center !important; margin: 0 auto !important; }
  .prod-img { width: 64px !important; height: 64px !important; max-width: 64px !important; max-height: 64px !important; object-fit: contain !important; display: block !important; }

  /* Hide mobile-injected cells */
  .td-name-mob { display: none !important; }
  .td-info-mob { display: none !important; }

  /* Restore collapsed categories */
  .cat-block.collapsed .ptable { display: table !important; }

  /* Main */
  .td-main { display: table-cell !important; padding: 6px 10px !important; vertical-align: top !important; }
  .prod-sku { display: none !important; }
  .prod-name-row { display: flex !important; align-items: center !important; gap: 5px !important; margin-bottom: 4px !important; }
  .prod-name-link { font-size: 11px !important; font-weight: 700 !important; color: #000 !important; text-decoration: none !important; }
  .kit-badge { font-size: 7px !important; padding: 1px 4px !important; }
  .prod-specs { gap: 2px !important; margin-bottom: 5px !important; }
  .prod-specs span { font-size: 8px !important; padding: 1px 4px !important; background: #f0f0f0 !important; }
  .kit-contents { margin-top: 4px !important; padding-top: 4px !important; }
  .kit-label { font-size: 7px !important; }
  .kit-item { font-size: 9px !important; }
  .addons-block { margin-top: 5px !important; padding-top: 4px !important; }
  .addons-label { font-size: 7px !important; margin-bottom: 2px !important; }
  .addons-table { border: 1px solid #ccc !important; }
  .addons-table tr:not(:last-child) td { border-bottom: 1px solid #ddd !important; }
  .addon-name-cell { padding: 3px 6px !important; }
  .addon-price-cell { width: 46px !important; padding: 3px 6px !important; font-size: 9px !important; border-left: 1px solid #ddd !important; color: #cc0000 !important; }
  .addon-name { font-size: 9px !important; color: #333 !important; }

  /* Price */
  .td-price { width: 70px !important; padding: 6px 4px !important; background: #fafafa !important; border-left: 1px solid #ddd !important; }
  .price-eur { font-size: 13px !important; font-weight: 700 !important; color: #000 !important; }

  .prod-row { page-break-inside: avoid; break-inside: avoid; }
  a { text-decoration: none !important; }
}
