/* ===========================
   Общие переменные и сброс
   =========================== */
:root {
  --primary: #e6432c;
  --primary-dark: #c7331e;
  --dark: #1c1c1c;
  --light: #f8f9fa;
  --gray: #6c757d;
  --border: #e5e5e5;
}

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

body {
  font-family: 'Manrope', 'Segoe UI', Tahoma, Verdana, sans-serif;
  color: var(--dark);
  background: #ffffff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; }

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ===============
   Контейнер
   =============== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ===============
   Топ-бар с телефоном (виден всегда, даже на мобильных)
   =============== */
.top-bar {
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1001;
}
.top-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.top-bar a { color: #fff; text-decoration: none; }
.top-bar a:hover { color: var(--primary); }

/* ===============
   Стили для шапки
   =============== */
header {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: fixed;
  top: 30px;
  width: 100%;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: bold;
  color: var(--dark);
  text-decoration: none;
}

.logo img {
  height: 42px;
  width: auto;
}

.logo span {
  color: var(--primary);
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
}

nav.main-nav ul li {
  margin-left: 22px;
}

nav.main-nav ul li a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  transition: color 0.3s ease;
  font-size: 15px;
}

nav.main-nav ul li a:hover,
nav.main-nav ul li a.active {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--dark);
}

/* отступ, чтобы шапка не закрывала контент */
main {
  margin-top: 108px;
  min-height: 60vh;
}

/* ===============
   Стили для Hero
   =============== */
.hero {
  background: linear-gradient(rgba(10,10,10,0.75), rgba(10,10,10,0.75)),
              url('../images/project3.jpg');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  text-align: center;
  padding: 150px 0 90px;
}

.hero h1 {
  font-size: 42px;
  margin-bottom: 18px;
}

.hero p {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 30px;
  line-height: 1.5;
}

.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }

.hero-form {
  background: rgba(255,255,255,0.95);
  padding: 22px;
  border-radius: 10px;
  max-width: 460px;
  margin: 0 auto;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  text-align: left;
}

.hero-form h3 {
  color: var(--dark);
  margin-bottom: 15px;
  font-size: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 14px;
}

.form-control,
select.form-control,
textarea.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
}

.field-error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 4px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(230,67,44,0.4);
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid #fff;
}
.btn-outline:hover { background: #fff; color: var(--dark); }

.btn-small { padding: 6px 14px; font-size: 14px; border-radius: 4px; }
.btn-secondary { background: var(--dark); }
.btn-secondary:hover { background: #000; box-shadow: none; transform: none; }
.btn-danger { background: #c0392b; }

/* ===============
   Флеш-сообщения
   =============== */
.flash-messages { max-width: 1200px; margin: 100px auto 0; padding: 0 15px; }
.flash {
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 500;
}
.flash-success { background: #e6f5ea; color: #276738; border-left: 5px solid #4caf50; }
.flash-error { background: #fdecea; color: #92221a; border-left: 5px solid #c0392b; }

/* ===============
   Секции с одинаковыми отступами
   =============== */
section { padding: 70px 0; }
.section-small { padding: 40px 0; }

.section-title {
  text-align: center;
  font-size: 30px;
  margin-bottom: 45px;
  position: relative;
}

.section-title:after {
  content: '';
  display: block;
  width: 70px;
  height: 4px;
  background: var(--primary);
  margin: 12px auto 0;
}

.section-lead {
  text-align: center;
  max-width: 700px;
  margin: -25px auto 40px;
  color: var(--gray);
}

.breadcrumbs {
  font-size: 14px;
  color: var(--gray);
  padding: 18px 0 0;
}
.breadcrumbs a { color: var(--gray); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }

/* ===============
   Сервисные карточки
   =============== */
.services { background: var(--light); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 26px;
}

.service-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.service-card:hover { transform: translateY(-5px); }

.service-icon {
  background: var(--primary);
  color: #fff;
  font-size: 30px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-content { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.service-content h3 { margin-bottom: 10px; font-size: 19px; }
.service-content p { color: var(--gray); font-size: 14.5px; flex: 1; }
.service-content .btn { margin-top: 14px; align-self: flex-start; }

.services-more { text-align: center; margin-top: 40px; }

/* ===============
   Страница услуги
   =============== */
.service-detail-body { max-width: 800px; margin: 0 auto; white-space: pre-line; }
.service-related { margin-top: 60px; }
.service-related h3 { margin-bottom: 20px; }
.service-related ul { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; }
.service-related a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
}
.service-related a:hover { border-color: var(--primary); color: var(--primary); }

/* ===============
   Секция "О нас"
   =============== */
.about { background: #fff; }
.about-content { max-width: 800px; margin: 0 auto; }
.about-content p { margin-bottom: 15px; }
.about-content ul { list-style: none; margin-top: 15px; }
.about-content ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.about-content ul li:before { content: '✓'; color: var(--primary); position: absolute; left: 0; top: 0; }

/* ===============
   Секция "Портфолио"
   =============== */
.portfolio { background: var(--light); }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}
.portfolio-item {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  background: #fff;
  transition: transform 0.3s ease;
}
.portfolio-item:hover { transform: translateY(-5px); }
.portfolio-item img { width: 100%; height: 220px; object-fit: cover; }
.portfolio-info { padding: 16px; }
.portfolio-info h3 { margin-bottom: 6px; font-size: 18px; }
.portfolio-info p { color: var(--gray); font-size: 14px; }
.placeholder-badge {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
}
.empty-state {
  text-align: center;
  color: var(--gray);
  padding: 40px 20px;
  background: var(--light);
  border-radius: 10px;
}

/* ===============
   Секция "Отзывы"
   =============== */
.testimonials { background: #fff; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.testimonial { background: var(--light); padding: 20px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.testimonial-content { margin-bottom: 15px; font-style: italic; }
.testimonial-author { font-weight: 700; text-align: right; }

/* ===============
   Как мы работаем
   =============== */
.process { background: var(--light); }
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  text-align: center;
}
.process-step .step-number {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin: 0 auto 12px;
}
.process-step h4 { font-size: 15px; }

/* ===============
   Секция "Контакты"
   =============== */
.contact { background: var(--light); }
.contact-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.contact-info, .contact-form {
  background: #fff; padding: 24px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.contact-info h3, .contact-form h3 { margin-bottom: 15px; font-size: 20px; }
.contact-detail { display: flex; align-items: center; margin-bottom: 14px; }
.contact-detail .dot {
  background: var(--primary); color: #fff; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 14px; flex-shrink: 0;
}
.contact-detail a { text-decoration: none; }
.contact-detail a:hover { color: var(--primary); }

/* ===============
   Калькулятор
   =============== */
.calculator-box { max-width: 720px; margin: 0 auto; background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.calculator-box .form-group { margin-bottom: 18px; }
.calc-result {
  background: var(--light);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border-left: 5px solid var(--primary);
  display: none;
}
.calc-result.visible { display: block; }
.calc-disclaimer {
  font-size: 13px;
  color: var(--gray);
  margin-top: 16px;
  padding: 12px;
  background: #fff8e6;
  border-radius: 6px;
}

/* ===============
   Логин / формы аутентификации
   =============== */
.auth-section { background: var(--light); min-height: 70vh; display: flex; align-items: center; }
.auth-section .container { max-width: 400px; }
.auth-box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.auth-box h2 { margin-bottom: 20px; text-align: center; }
.auth-links { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-links a { color: var(--primary); text-decoration: none; }

/* ===============
   Админ-панель
   =============== */
.admin-layout { display: flex; margin-top: 108px; min-height: calc(100vh - 108px); }
.admin-sidebar {
  width: 220px;
  background: var(--dark);
  color: #fff;
  flex-shrink: 0;
  padding: 24px 0;
}
.admin-sidebar a {
  display: block;
  padding: 12px 24px;
  color: #ddd;
  text-decoration: none;
  font-size: 15px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; }
.admin-content { flex: 1; padding: 30px; background: var(--light); }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.admin-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.admin-card .number { font-size: 32px; font-weight: 700; color: var(--primary); }
.admin-card .label { color: var(--gray); font-size: 14px; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.requests-table { width: 100%; border-collapse: collapse; margin-top: 10px; background: #fff; }
.requests-table th, .requests-table td { border: 1px solid var(--border); padding: 10px; text-align: left; font-size: 14px; }
.requests-table th { background: var(--dark); color: #fff; }
.requests-table tr:nth-child(even) { background: #fafafa; }
.requests-table tr:hover { background: #f1f1f1; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-new { background: #fdecea; color: #92221a; }
.badge-in_progress { background: #fff3cd; color: #856404; }
.badge-done { background: #e6f5ea; color: #276738; }

.export-button { text-align: right; margin-bottom: 10px; }

.admin-form { max-width: 640px; background: #fff; padding: 24px; border-radius: 10px; }
.admin-form .form-group { margin-bottom: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ===============
   ПОДВАЛ
   =============== */
footer { background: var(--dark); color: #fff; padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-bottom: 24px; }
.footer-grid h4 { margin-bottom: 12px; font-size: 16px; }
.footer-grid a { color: #ccc; text-decoration: none; display: block; margin-bottom: 6px; font-size: 14px; }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom { text-align: center; font-size: 13px; color: #999; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; }

/* ===============
   Плавающие кнопки связи (моб. и десктоп)
   =============== */
.float-contacts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}
.float-contacts a {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.float-contacts .call { background: var(--primary); }
.float-contacts .whatsapp { background: #25D366; }
.float-contacts .telegram { background: #229ED9; }

/* ===============
   АДАПТИВ (до 768px)
   =============== */
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 10px 0; display: flex; overflow-x: auto; }
  .admin-sidebar a { padding: 10px 16px; white-space: nowrap; }
}

/* ===============
   Иконки услуг (SVG)
   =============== */
.svc-icon {
  width: 32px;
  height: 32px;
}
.service-icon .svc-icon {
  width: 30px;
  height: 30px;
}
.svc-icon-preview {
  width: 26px;
  height: 26px;
}
.row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
}
.row-icon .svc-icon { width: 17px; height: 17px; }

/* ===============
   Преимущества (главная)
   =============== */
.advantages { background: #fff; padding-top: 50px; padding-bottom: 50px; }
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
}
.advantage-item {
  text-align: center;
  padding: 26px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.advantage-item:hover { border-color: var(--primary); transform: translateY(-3px); }
.advantage-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.advantage-icon .svc-icon { width: 26px; height: 26px; }
.advantage-item h4 { margin-bottom: 8px; font-size: 16px; }
.advantage-item p { color: var(--gray); font-size: 14px; }

/* ===============
   Герой страницы услуги
   =============== */
.service-hero {
  background: linear-gradient(135deg, var(--dark), #2a2a2a);
  color: #fff;
  padding: 130px 0 50px;
}
.breadcrumbs-light { color: rgba(255,255,255,0.65); padding-top: 0; }
.breadcrumbs-light a { color: rgba(255,255,255,0.85); }
.breadcrumbs-light a:hover { color: #fff; }
.service-hero-inner { padding-top: 24px; }
.service-hero-icon {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.service-hero-icon .svc-icon { width: 30px; height: 30px; }
.service-hero h1 { font-size: 32px; margin-bottom: 10px; }
.service-hero p { color: rgba(255,255,255,0.8); max-width: 700px; }

.service-detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 35px;
  display: block;
  max-width: 800px;
}

.service-related ul { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; }
.service-related li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.2s ease;
}
.service-related li:hover { border-color: var(--primary); }
.service-related li a { text-decoration: none; font-size: 14px; }
.service-related li a:hover { color: var(--primary); }
.related-icon { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }

/* ===============
   Плейсхолдер фото объекта
   =============== */
.portfolio-noimg {
  width: 100%;
  height: 220px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
}
.portfolio-noimg .svc-icon { width: 40px; height: 40px; }

/* ===============
   Список новостей
   =============== */
.news-list { max-width: 800px; margin: 0 auto; }
.news-list-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.news-list-image {
  width: 160px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.news-list-body h3 { margin-bottom: 6px; font-size: 18px; }
.news-list-body h3 a { text-decoration: none; }
.news-list-body h3 a:hover { color: var(--primary); }
.news-date { color: var(--gray); font-size: 13px; }
.news-detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 24px;
}

/* ===============
   Админ: сетка миниатюр (объекты, сертификаты)
   =============== */
.admin-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.admin-thumb-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.admin-thumb-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}
.admin-thumb-empty {
  width: 100%;
  height: 150px;
  background: var(--light);
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.admin-thumb-body { padding: 14px; }
.admin-thumb-body h3 { font-size: 15px; margin-bottom: 8px; }
.admin-thumb-body .badge { margin-right: 6px; margin-bottom: 8px; }
.admin-thumb-actions { display: flex; gap: 8px; margin-top: 10px; }

@media (max-width: 768px) {
  .top-bar .container { justify-content: center; }

  nav.main-nav {
    position: fixed;
    top: 0; right: -280px;
    width: 260px; height: 100vh;
    background: #fff;
    box-shadow: -4px 0 15px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    padding-top: 90px;
  }
  nav.main-nav.open { right: 0; }
  nav.main-nav ul { flex-direction: column; align-items: flex-start; padding: 0 24px; }
  nav.main-nav ul li { margin: 0 0 18px; }
  .nav-toggle { display: block; }

  .hero { padding: 110px 0 60px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }

  .services-grid, .portfolio-grid, .testimonials-grid, .contact-wrapper, .process-grid, .advantages-grid {
    grid-template-columns: 1fr;
  }

  .requests-table { display: block; overflow-x: auto; white-space: nowrap; }

  .news-list-item { flex-direction: column; }
  .news-list-image { width: 100%; height: 180px; }

  .service-hero { padding: 110px 0 40px; }
  .service-hero h1 { font-size: 26px; }
}
