/* ============================================================
   МИР ПОЖАРНОЙ БЕЗОПАСНОСТИ — Main Stylesheet
   ============================================================ */

:root {
  --red:    #dc2626;
  --red-d:  #b91c1c;
  --red-l:  #fee2e2;
  --navy:   #1a2744;
  --navy-l: #243356;
  --orange: #f77f00;
  --grey:   #6b7280;
  --light:  #f8f9fa;
  --white:  #ffffff;
  --shadow: 0 4px 20px rgba(26,39,68,.10);
  --radius: 12px;
  --trans:  .2s ease;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: #1f2937;
  background: var(--white);
  margin: 0;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-d); }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  padding: 6px 0;
}
.topbar a {
  color: rgba(255,255,255,.75);
  transition: color var(--trans);
}
.topbar a:hover { color: #fff; }

/* ── Navbar ───────────────────────────────────────────────── */
.main-nav {
  background: var(--navy) !important;
  padding: 10px 0;
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
  z-index: 1040;
}
.brand-icon {
  width: 42px; height: 42px;
  background: var(--red);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.brand-title { font-size: .95rem; font-weight: 800; line-height: 1.1; }
.brand-sub   { font-size: .65rem; letter-spacing: .08em; opacity: .75; }

.main-nav .nav-link {
  font-weight: 500;
  font-size: .9rem;
  padding: 6px 14px !important;
  border-radius: 8px;
  transition: background var(--trans), color var(--trans);
}
.main-nav .nav-link:hover { background: rgba(255,255,255,.12); }
.main-nav .dropdown-menu  { border: none; box-shadow: var(--shadow); border-radius: var(--radius); }
.main-nav .dropdown-item  { padding: 8px 18px; font-size: .88rem; }
.main-nav .dropdown-item:hover { background: var(--red-l); color: var(--red); }

.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--red); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--navy);
}

/* ── Flash ────────────────────────────────────────────────── */
.flash-container { padding: 12px 0 0; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-l) 100%);
  color: #fff;
  padding: 28px 0;
}
.page-header .breadcrumb-item a { color: rgba(255,255,255,.7); }
.page-header .breadcrumb-item.active { color: rgba(255,255,255,.9); }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }
.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}
.admin-header { background: linear-gradient(135deg, #111827 0%, #1f2937 100%); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, #0f172a 100%);
  color: #fff;
  padding: 100px 0 70px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(220,38,38,.15) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(247,127,0,.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center;
  background: rgba(220,38,38,.2); border: 1px solid rgba(220,38,38,.4);
  color: #fca5a5; border-radius: 50px;
  padding: 5px 14px; font-size: .8rem; font-weight: 600;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  max-width: 540px;
  margin-bottom: 32px;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stat span { display: block; font-size: 1.8rem; font-weight: 800; color: var(--red); line-height: 1; }
.hero-stat small { font-size: .75rem; color: rgba(255,255,255,.6); }

.hero-icon-block {
  position: relative;
  width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.hero-big-icon {
  font-size: 7rem;
  color: var(--red);
  position: relative; z-index: 2;
  filter: drop-shadow(0 0 30px rgba(220,38,38,.5));
  animation: pulse 3s ease-in-out infinite;
}
.hero-icon-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(220,38,38,.2);
  animation: ripple 3s ease-out infinite;
}
.ring-1 { width: 180px; height: 180px; animation-delay: 0s; }
.ring-2 { width: 260px; height: 260px; animation-delay: 1s; }
.ring-3 { width: 320px; height: 320px; animation-delay: 2s; }

@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
@keyframes ripple {
  0%   { opacity: .6; transform: scale(.8); }
  100% { opacity: 0;  transform: scale(1.1); }
}

.hero-wave { position: relative; margin-top: -1px; line-height: 0; }
.hero-wave svg { width: 100%; height: 60px; display: block; }

/* ── Features strip ──────────────────────────────────────── */
.features-strip { background: var(--light); padding: 24px 0; border-bottom: 1px solid #e5e7eb; }
.feature-chip {
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; font-weight: 500; color: var(--navy);
}
.feature-chip i { color: var(--red); font-size: 1.1rem; flex-shrink: 0; }

/* ── Section headers ─────────────────────────────────────── */
.section-tag {
  display: inline-block;
  background: var(--red-l); color: var(--red);
  border-radius: 50px; padding: 4px 14px;
  font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title  { font-size: clamp(1.5rem,3vw,2.2rem); font-weight: 800; line-height: 1.2; }
.section-subtitle { color: var(--grey); max-width: 540px; margin: 0 auto; }

/* ── Category cards ──────────────────────────────────────── */
.category-card {
  display: block;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--trans);
  color: var(--navy);
  position: relative;
  overflow: hidden;
}
.category-card:hover {
  border-color: var(--red);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(220,38,38,.15);
  color: var(--navy);
}
.category-card-icon {
  width: 56px; height: 56px;
  background: var(--red-l);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--red);
  margin: 0 auto 12px;
  transition: background var(--trans);
}
.category-card:hover .category-card-icon { background: var(--red); color: #fff; }
.category-card-name { font-weight: 700; font-size: .9rem; margin-bottom: 4px; line-height: 1.3; }
.category-card-count { font-size: .75rem; color: var(--grey); }
.category-card-arrow {
  position: absolute; top: 12px; right: 12px;
  color: var(--red); opacity: 0;
  transition: opacity var(--trans);
  font-size: .8rem;
}
.category-card:hover .category-card-arrow { opacity: 1; }

/* ── Product cards ───────────────────────────────────────── */
.product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--trans);
  display: flex; flex-direction: column;
}
.product-card:hover {
  border-color: var(--red);
  box-shadow: 0 8px 30px rgba(220,38,38,.12);
  transform: translateY(-3px);
}
.product-card-img-link {
  display: block; position: relative;
  padding-top: 70%;
  background: #f9fafb;
  overflow: hidden;
}
.product-card-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; padding: 12px;
  transition: transform var(--trans);
}
.product-card:hover .product-card-img { transform: scale(1.05); }
.product-card-img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #d1d5db;
}
.product-badge {
  position: absolute; top: 8px; left: 8px;
  border-radius: 6px; padding: 3px 8px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase;
}
.badge-featured { background: var(--red); color: #fff; }
.badge-oos      { background: #6b7280; color: #fff; }

.product-card-body {
  padding: 14px;
  flex: 1; display: flex; flex-direction: column;
}
.product-card-cat  { font-size: .72rem; color: var(--red); font-weight: 600; margin-bottom: 4px; }
.product-card-name {
  font-weight: 700; font-size: .9rem; color: #1f2937;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 12px; flex: 1;
}
.product-card-name:hover { color: var(--red); }
.product-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.product-card-price  { font-weight: 800; font-size: 1rem; color: var(--red); }

.btn-cart {
  width: 36px; height: 36px;
  background: var(--red); color: #fff;
  border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--trans);
  flex-shrink: 0;
}
.btn-cart:hover { background: var(--red-d); }

/* ── Why section ──────────────────────────────────────────── */
.why-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.why-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--red-l); color: var(--red);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.why-item h6  { font-weight: 700; margin-bottom: 4px; }
.why-item p   { color: var(--grey); font-size: .88rem; margin: 0; }

.why-card {
  border-radius: var(--radius); padding: 28px 20px; color: #fff; text-align: center;
}
.why-card i { font-size: 2.2rem; margin-bottom: 12px; display: block; opacity: .9; }
.why-card h5 { font-size: .95rem; font-weight: 700; margin: 0; }
.why-card-red  { background: linear-gradient(135deg, var(--red) 0%, #991b1b 100%); }
.why-card-navy { background: linear-gradient(135deg, var(--navy) 0%, #0f172a 100%); }

/* ── CTA ─────────────────────────────────────────────────── */
.section-cta {
  background: linear-gradient(135deg, var(--red) 0%, #991b1b 100%);
  color: #fff; padding: 64px 0;
}
.cta-title { font-size: clamp(1.6rem,3vw,2.5rem); font-weight: 800; margin-bottom: 12px; }
.cta-sub   { opacity: .85; margin-bottom: 28px; }

/* ── Catalog sidebar ─────────────────────────────────────── */
.catalog-sidebar { position: sticky; top: 80px; }
.sidebar-widget  { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.sidebar-title   { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); margin-bottom: 12px; }
.sidebar-cat-list { list-style: none; padding: 0; margin: 0; }
.sidebar-cat-list li { border-bottom: 1px solid #f3f4f6; }
.sidebar-cat-list li:last-child { border: none; }
.sidebar-cat-list a {
  display: flex; align-items: center;
  padding: 9px 6px; font-size: .88rem; font-weight: 500;
  color: #374151; border-radius: 6px;
  transition: all var(--trans);
}
.sidebar-cat-list a:hover, .sidebar-cat-list a.active {
  color: var(--red); background: var(--red-l); padding-left: 12px;
}
.cat-count {
  margin-left: auto; background: #f3f4f6;
  color: var(--grey); border-radius: 50px;
  font-size: .72rem; padding: 1px 7px;
}

/* ── Product detail ──────────────────────────────────────── */
.product-detail-img-wrap {
  background: #f9fafb; border-radius: var(--radius);
  border: 1px solid #e5e7eb; overflow: hidden;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.product-detail-img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 20px; }
.product-detail-img-placeholder { font-size: 8rem; color: #d1d5db; }
.product-cat-badge {
  display: inline-block; background: var(--red-l); color: var(--red);
  border-radius: 6px; padding: 3px 10px; font-size: .8rem; font-weight: 600;
}
.product-detail-name  { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin: 8px 0 16px; }
.product-detail-price { font-size: 2rem; font-weight: 800; color: var(--red); }

.in-stock-badge { color: #16a34a; font-weight: 600; font-size: .9rem; }
.out-of-stock-badge { color: #6b7280; font-weight: 600; font-size: .9rem; }

.qty-control { display: flex; align-items: center; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.qty-btn {
  width: 36px; height: 42px; background: #f3f4f6; border: none;
  font-size: 1.2rem; cursor: pointer; transition: background var(--trans);
}
.qty-btn:hover { background: #e5e7eb; }
.qty-input { width: 56px; height: 42px; border: none; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { display: none; }

.product-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.product-detail-desc h5 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.meta-row { padding: 6px 0; border-bottom: 1px solid #f3f4f6; font-size: .88rem; color: var(--grey); }
.meta-row span { font-weight: 600; color: #374151; }
.meta-row:last-child { border: none; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 200px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  background: linear-gradient(135deg, #f9fafb 0%, #fee2e2 100%);
}
.auth-card {
  background: #fff; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.1);
  width: 100%; max-width: 420px;
  overflow: hidden;
}
.auth-card-wide { max-width: 560px; }
.auth-header {
  background: linear-gradient(135deg, var(--navy) 0%, #0f172a 100%);
  color: #fff; padding: 32px 32px 24px;
  text-align: center;
}
.auth-logo {
  width: 60px; height: 60px;
  background: var(--red); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 16px;
}
.auth-header h2 { font-weight: 800; margin-bottom: 4px; }
.auth-header p  { opacity: .7; font-size: .88rem; margin: 0; }
.auth-body   { padding: 28px 32px; }
.auth-footer { padding: 16px 32px; background: #f9fafb; text-align: center; font-size: .88rem; color: var(--grey); }

/* ── Cabinet ─────────────────────────────────────────────── */
.cabinet-nav {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: var(--radius); overflow: hidden;
  position: sticky; top: 80px;
}
.cabinet-user { padding: 20px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #e5e7eb; }
.cabinet-avatar {
  width: 48px; height: 48px; background: var(--red-l);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--red); flex-shrink: 0;
}
.cabinet-menu { list-style: none; padding: 8px 0; margin: 0; }
.cabinet-menu li a {
  display: flex; align-items: center; padding: 10px 20px;
  font-size: .9rem; font-weight: 500; color: #374151;
  transition: all var(--trans);
}
.cabinet-menu li a:hover, .cabinet-menu li a.active { background: var(--red-l); color: var(--red); }

/* ── Order timeline ──────────────────────────────────────── */
.order-timeline { display: flex; gap: 0; position: relative; }
.order-timeline::before {
  content: ''; position: absolute; top: 12px; left: 12px; right: 12px;
  height: 2px; background: #e5e7eb; z-index: 0;
}
.timeline-step { flex: 1; text-align: center; position: relative; z-index: 1; }
.timeline-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #e5e7eb; border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e5e7eb;
  margin: 0 auto 6px; transition: all var(--trans);
}
.timeline-step.done .timeline-dot  { background: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.timeline-step.current .timeline-dot { background: var(--red); box-shadow: 0 0 0 2px var(--red); animation: pulse 2s infinite; }
.timeline-label { font-size: .7rem; color: var(--grey); font-weight: 500; }
.timeline-step.done .timeline-label    { color: var(--navy); font-weight: 600; }
.timeline-step.current .timeline-label { color: var(--red); font-weight: 700; }

/* ── Cart ────────────────────────────────────────────────── */
.table-cart th  { font-weight: 700; font-size: .85rem; background: #f9fafb; padding: 12px 16px; }
.table-cart td  { padding: 12px 16px; vertical-align: middle; }
.cart-product   { display: flex; align-items: center; gap: 12px; }
.cart-product img { width: 54px; height: 54px; object-fit: contain; border-radius: 8px; border: 1px solid #e5e7eb; }
.cart-product-icon {
  width: 54px; height: 54px; background: #f9fafb; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db; font-size: 1.4rem; flex-shrink: 0;
}
.qty-field:focus { box-shadow: none; border-color: var(--red); }
.cart-summary .card-header { background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: #fff; padding: 6px; border-radius: var(--radius);
  border: 1px solid #e5e7eb;
}
.admin-tab {
  padding: 7px 16px; border-radius: 8px; font-size: .88rem; font-weight: 600;
  color: var(--grey); transition: all var(--trans);
}
.admin-tab:hover { background: #f3f4f6; color: var(--navy); }
.admin-tab.active { background: var(--navy); color: #fff; }

.stat-card {
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 8px; color: #fff;
}
.stat-card.stat-red    { background: linear-gradient(135deg, var(--red) 0%, #991b1b 100%); }
.stat-card.stat-navy   { background: linear-gradient(135deg, var(--navy) 0%, #0f172a 100%); }
.stat-card.stat-green  { background: linear-gradient(135deg, #16a34a 0%, #14532d 100%); }
.stat-card.stat-orange { background: linear-gradient(135deg, var(--orange) 0%, #c2410c 100%); }
.stat-icon { font-size: 1.6rem; opacity: .8; }
.stat-val  { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .85rem; opacity: .8; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { background: var(--navy); color: rgba(255,255,255,.8); }
.footer-main { padding: 56px 0 40px; }
.footer-brand { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-desc  { font-size: .88rem; line-height: 1.65; margin-bottom: 12px; }
.footer-license { font-size: .75rem; background: rgba(255,255,255,.1); border-radius: 6px; padding: 4px 10px; display: inline-block; }
.footer-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.5); margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.7); font-size: .88rem; transition: color var(--trans); }
.footer-links a:hover { color: #fff; }
.footer-contact-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.footer-contact-item i { color: var(--red); margin-top: 2px; flex-shrink: 0; }
.footer-contact-item a, .footer-contact-item span { color: rgba(255,255,255,.8); font-size: .88rem; }
.footer-contact-item a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 0; font-size: .8rem; color: rgba(255,255,255,.5);
}

/* ── About ───────────────────────────────────────────────── */
.about-stat { text-align: center; padding: 20px; background: var(--light); border-radius: var(--radius); }
.about-stat-val { font-size: 2rem; font-weight: 800; color: var(--red); }
.about-features  { display: flex; flex-direction: column; gap: 20px; }
.about-feature { display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius); }
.about-feature i { font-size: 1.5rem; color: var(--red); flex-shrink: 0; width: 32px; margin-top: 2px; }
.about-feature h6 { font-weight: 700; margin-bottom: 4px; }
.about-feature p  { color: var(--grey); font-size: .88rem; margin: 0; }

/* ── Contact ─────────────────────────────────────────────── */
.contact-card { display: flex; gap: 16px; align-items: flex-start; }
.contact-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--red-l); color: var(--red); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.contact-card h5 { font-weight: 700; margin-bottom: 4px; }
.contact-card a  { color: var(--navy); font-size: .92rem; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { color: var(--grey); }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 576px) {
  .hero { padding: 70px 0 50px; }
  .auth-header, .auth-body, .auth-footer { padding-left: 20px; padding-right: 20px; }
  .hero-stats { gap: 20px; }
  .product-detail-name { font-size: 1.3rem; }
  .product-detail-price { font-size: 1.5rem; }
  .cabinet-nav { position: static; }
  .catalog-sidebar { position: static; }
  .order-timeline { flex-wrap: wrap; gap: 8px; }
  .order-timeline::before { display: none; }
}
