/* ================== ROOT ================== */
:root {
  --nav-h: 52px;
  --max-width: 1200px;
  --accent: #00cc77;
  --accent-dark: #009f5f;
  --bg-light: #f4f4f8;
  --bg-card: #ffffff;
  --bg-item: #ffffff;
  --text-main: #333;
  --text-light: #e0ffe3;
  --muted: #666;
}

/* ================== БАЗА ================== */
html { font-size: 16px; }

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-light);
  color: var(--text-main);
  overflow-x: hidden;
  font-size: clamp(0.9rem, 1vw + 0.5rem, 1rem);
  line-height: 1.5;
}

p { margin: 5px 0; }
a { color: inherit; text-decoration: none; }

/* footer */
footer {
    background-color: rgb(36, 36, 36); /* Например, светло-серый фон для футера */
    color: rgb(255, 255, 255);
    padding: 20px;
    display: flex;
    justify-content: space-between; /* Разделяет столбики равномерно */
    z-index: 999;
    position: relative;
}

.footer-container {
    width: 100%;
    display: flex;
    justify-content: space-between; /* Разделяет столбики равномерно */
}

.footer-left, .footer-middle, .footer-right {
    width: 30%; /* Ширина каждого из столбиков */
}

.footer-left img {
    width: 375px;
    height: auto;

}

.footer-middle {
    display: flex;
    flex-direction: column; /* Выстраивает контактную информацию в столбик */
}

.footer-right {
    display: flex;
    flex-direction: column; /* Позволяет расположить текст и поля ввода вертикально */
}

p {
    margin: 5px 0; /* Желаемый отступ между строками текста */
}

.input-name, .input-phone {
    margin-top: 10px;
    padding: 10px;
    width: 95%; /* Поля ввода занимают всю ширину столбика */
    border: 1px solid #ccc; /* Обводка вокруг поля */
    border-radius: 4px; /* Скругление углов */
}

.submit-button {
    margin-top: 10px;
    padding: 10px;
    background-color: #4CAF50; /* Зелёная кнопка */
    color: white; /* Белый текст на кнопке */
    border: none; /* Без обводки */
    border-radius: 4px; /* Скругление углов кнопки */
    cursor: pointer; /* Курсор "рука" при наведении */
}

.social-icons a {
    margin-right: 10px; /* Отступ между иконками */
    text-decoration: none; /* Убираем подчеркивание */
}

.social-icons img {
    width: 30px; /* задайте нужный размер иконок */
    height: auto; /* сохраним пропорции */
    cursor: pointer; /* добавим указатель, чтобы было понятно, что это ссылка */
}

/* Попап */
.success-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--accent);
  color: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s ease;
  text-align: center;
}
.success-popup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.success-popup.hidden { display: none; }

/* ================== NAVBAR ================== */
.main-navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: #1f1f1f;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.main-navbar.animate { opacity: 1; transform: translateY(0); }

.burger-wrapper {
  display: none;
  align-items: center;
  cursor: pointer;
  gap: 8px;
  padding: 0.75rem 1rem;
}
.burger { display: flex; flex-direction: column; gap: 5px; }
.burger span { width: 22px; height: 3px; background: #e0ffe3; border-radius: 2px; }
.burger-label { color: #e0ffe3; font-size: 1rem; }

.nav-links {
  display: flex;
  justify-content: center;
  padding: 14px 0;
  margin: 0;
  list-style: none;
  gap: 40px;
}
.nav-links a {
  text-decoration: none;
  color: #e0ffe3;
  font-size: 1.1rem;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #00ff94;
  transition: width 0.3s ease;
}
.nav-links a:hover { color: #00ff94; }
.nav-links a:hover::after { width: 100%; }

/* ================== КОРЗИНА ================== */
.cart-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Левая часть — товары */
.cart-left {
  flex: 1 1 60%;
  padding: 25px;
  border-radius: 20px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--accent-dark);
}

.cart-controls {
  display: flex;
  gap: 15px;
}

.back-btn,
.clear-btn {
  background: var(--accent-dark);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 0.95rem;
}

.back-btn:hover,
.clear-btn:hover {
  background: var(--accent);
}

/* Элементы корзины */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

/* Фото товара */
.cart-item img {
  width: 120px;
  height: 120px; 
  border-radius:8px 0 0 8px; 
  object-fit: cover;
}

/* Инфо товара */
.cart-item-info {
  flex: 1;
  font-size: 1.1rem;
  padding-left: 15px;
}

.cart-item-info h3 {
  font-size: 1.1rem;
  margin: 0 0 5px;
}

.cart-item-info p {
  color: var(--muted);
  margin-bottom: 10px;
}

/* Кнопки управления */
.cart-controls button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-controls button:hover {
  background: var(--accent-dark);
}

.cart-controls .remove {
  background: #e74c3c;
}

.cart-controls .remove:hover {
  background: #c0392b;
}

.cart-controls .quantity {
  margin: 0 10px;
  font-weight: 600;
}

/* Пустая корзина */
.empty-cart {
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 40px 0;
}

/* Правая колонка — форма КП */
.cart-right {
  flex: 1 1 30%;
  background: var(--bg-card);
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-right h3 {
  text-align: center;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.cart-right form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-right input,
.cart-right textarea {
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  resize: none;
  outline: none;
  transition: border 0.3s ease;
}

.cart-right input:focus,
.cart-right textarea:focus {
  border-color: var(--accent);
}

.checkout-btn {
  background: var(--accent-dark);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.checkout-btn:hover {
  background: var(--accent);
}

/* Итоговая сумма */
.total-price {
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent-dark);
  margin-top: 10px;
}

/* ================== АДАПТИВ ================== */
@media (max-width: 900px) {
  .cart-layout {
    flex-direction: column;
    align-items: center;
  }

  .cart-left,
  .cart-right {
    width: 100%;
  }

  .cart-item img {
    width: 90px;
    height: 90px;
  }

  .cart-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ================== АДАПТИВ ================== */
@media (max-width: 1024px) {
  .cart-layout { flex-direction: column; }
  .cart-right { position: static; width: 100%; }
}

@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 15px;
  }

  .item-info img {
    width: 70px;
    height: 70px;
  }

  .item-actions input { width: 45px; }

  .checkout-btn {
    font-size: 0.95rem;
    padding: 10px;
  }
}

/* Адаптация под мобильные */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
    }

    form#call-back-form {
        order: 1;
    }
    .footer-middle {
        order: 2;
    }
    .footer-left {
        order: 3;
        text-align: left; /* выравнивание контента влево */
    }

    .footer-left,
    .footer-middle,
    form#call-back-form {
        width: 100%;
        margin-bottom: 20px;
    }

    .footer-left img {
        max-width: 200px;
        display: block;
        margin: 0; /* убираем автоцентрирование */
    }
}
/* ================== АДАПТИВ ================== */
@media (max-width: 1024px) {
  .cart-layout { flex-direction: column; }
  .cart-right { position: static; width: 100%; }
}

@media (max-width: 768px) {
  /* бургер-меню */
  .burger-wrapper { display: flex; }
  .nav-links { display: none; width: 90%; }
  .nav-links.active {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: #1f1f1f;
    padding: 1rem;
  }

  .item-info img { width: 60px; height: 60px; }
  .cart-header { flex-direction: column; align-items: flex-start; }

  .cart-right {
    padding: 15px;
    width: 100%;
    min-width: auto;
  }

  #cp-form input {
    font-size: 0.9rem;
    padding: 8px;
  }

  .checkout-btn {
    padding: 10px;
    font-size: 0.95rem;
  }
}
/* ==== Полная адаптация формы КП под мобильные ==== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
  }

  .cart-layout {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 20px;
    padding: 20px 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .cart-left,
  .cart-right {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    box-sizing: border-box;
    padding: 15px;
    margin: 0 auto;
  }

  .cart-right {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
  }

  .cart-right form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .cart-right input,
  .cart-right textarea,
  .checkout-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .checkout-btn {
    font-size: 1rem;
    padding: 12px;
  }
}