/* ==========================================
   GOOGLE FONT
========================================== */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

/* ==========================================
   ROOT VARIABLES
========================================== */
:root {
  --primary-color: #0056b3;
  --secondary-color: #f8f9fa;
  --text-color: #222;
  --accent-color: #007bff;
  --footer-bg: #1d1d1d;
  --hover-color: #e3f2fd;
}

/* ==========================================
   GLOBAL STYLES
========================================== */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Open Sans', 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--secondary-color);
  line-height: 1.8;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.section {
  padding: 60px 0;
  background-color: #fff;
}

.section.alt {
  background-color: #f1f1f1;
}

.section h2 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 10px;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--accent-color);
}

.section h3 {
  font-size: 1.5rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.section p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.section ul {
  list-style-type: disc;
  padding-left: 20px;
}

.section li {
  margin-bottom: 10px;
  transition: background 0.3s ease;
}

.section li:hover {
  background-color: var(--hover-color);
  padding-left: 5px;
  border-radius: 4px;
}

/* ==========================================
   HERO
========================================== */
.hero {
  background-image: url('server-room-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  min-height: 600px;
  padding: 120px 20px;
  color: #fff;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero p {
  font-size: 1.4rem;
  margin-bottom: 30px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* ==========================================
   BUTTONS
========================================== */
.btn-primary {
  display: inline-block;
  padding: 14px 28px;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.btn-primary:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* ==========================================
   IMAGES
========================================== */
.image-container {
  text-align: center;
  margin: 30px 0 40px;
}

.section-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto;
}

/* ==========================================
   FEEDBACK FORM
========================================== */
.feedback-form {
  max-width: 600px;
  margin: 0 auto;
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

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

.form-group label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

.form-group textarea {
  resize: vertical;
}

.feedback-form .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 1.1rem;
}

/* ==========================================
   FOOTER
========================================== */
.site-footer {
  background-color: var(--footer-bg);
  color: #ccc;
  text-align: center;
  padding: 30px 0;
  border-top: 3px solid var(--accent-color);
}

.site-footer nav a {
  color: #ccc;
  margin: 0 15px;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.site-footer nav a:hover {
  color: var(--accent-color);
}

/* ==========================================
   NAVIGATION
========================================== */
.site-nav {
  background-color: var(--primary-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .container {
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
}

.nav-links li {
  margin: 0 10px;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 12px;
  display: block;
  transition: color 0.3s ease, background 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-color);
  background-color: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* ==========================================
   COMPARISON TABLE
========================================== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 40px 0;
  font-size: 1rem;
  text-align: left;
  min-width: 0;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #ddd;
  padding: 12px 15px;
  vertical-align: top;
}

.comparison-table th {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
}

.comparison-table tbody tr:nth-child(even) {
  background-color: var(--secondary-color);
}

.comparison-table tbody tr:hover {
  background-color: var(--hover-color);
}

.comparison-table td {
  color: var(--text-color);
}

/* === HARD MOBILE IMAGE RESET === */
@media (max-width: 900px) {
  img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .image-container {
    padding: 0 !important;
    margin: 20px 0 !important;
  }
}

@media (max-width: 768px) {
  .table-scroll {
    overflow-x: hidden !important;
  }

  .comparison-table,
  .comparison-table thead,
  .comparison-table tbody,
  .comparison-table th,
  .comparison-table td,
  .comparison-table tr {
    display: block !important;
    width: 100% !important;
  }

  .comparison-table thead {
    display: none !important; /* шапка скрыта */
  }

  .comparison-table tbody tr {
    margin-bottom: 16px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 12px !important;
    background-color: #fff !important;
  }

  .comparison-table td {
    display: flex !important;
    justify-content: space-between !important;
    flex-direction: column !important; /* текст под label */
    padding: 8px 0 !important;
    border: none !important;
    border-bottom: 1px solid #eee !important;
    position: relative !important;
  }

  .comparison-table td:last-child {
    border-bottom: 0 !important;
  }

  .comparison-table td::before {
    content: attr(data-label) !important;
    font-weight: 600 !important;
    display: block !important; /* **обязательно блок** */
    margin-bottom: 4px !important;
  }

  .container, .section {
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow-x: hidden !important;
  }
}


/* ------------------------------
   MOBILE CARDS (up to 768px)
------------------------------ */
@media (max-width: 768px) {
  .comparison-table thead { display: none; }

  .comparison-table tbody tr {
    display: block;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    background-color: #fff;
  }

  .comparison-table td {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #eee;
  }

  .comparison-table td:last-child { border-bottom: 0; }

  .comparison-table td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
  }

  .container,
  .section { padding-left: 10px; padding-right: 10px; overflow-x: hidden; }

  .table-scroll { overflow-x: hidden; }
}

/* ------------------------------
   TABLET (769px – 1024px)
------------------------------ */
@media (min-width: 769px) and (max-width: 1024px) {
  .table-scroll { overflow-x: auto; }

  .comparison-table {
    display: table;
    min-width: 720px;
    width: max-content;
  }

  .comparison-table thead,
  .comparison-table tbody { display: table-header-group; width: auto; }

  .comparison-table td,
  .comparison-table th { white-space: nowrap; }
}

/* ------------------------------
   DESKTOP (>1024px)
------------------------------ */
@media (min-width: 1025px) {
  .comparison-table { display: table; min-width: 720px; width: max-content; }
  .comparison-table td,
  .comparison-table th { white-space: nowrap; }
  .table-scroll { overflow-x: auto; }
}

/* ==========================================
   RESPONSIVE NAVIGATION & HERO
========================================== */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }

  .nav-links.active { display: flex; }

  .nav-links li { margin: 10px 0; text-align: center; }

  .nav-links a { padding: 15px; font-size: 1.1rem; }

  .hero { min-height: 400px; padding: 80px 20px; }

  .hero h1 { font-size: 2.5rem; }
  .hero h2 { font-size: 1.8rem; }
  .hero p { font-size: 1.2rem; }

  .btn-primary { padding: 12px 24px; font-size: 1rem; }

  .section { padding: 40px 0; }

  .section h2 { font-size: 1.8rem; }
  .section h3 { font-size: 1.3rem; }
  .section p { font-size: 1rem; }

  .section-image { max-width: 90%; }

  .feedback-form { padding: 20px; }

  .site-footer nav a { display: block; margin: 10px 0; }
}

