/* ===== ОСНОВНЫЕ СТИЛИ САЙТА ===== */
/* Лабораторная работа №2 - 1.4.1. ТЕКСТ (стандартные стили для body) */
body {
  background: url(src/bl.png) left top repeat-x;
  background-color: #f4f1ea;
  font: 15px/1.5 'Segoe UI', Arial, Tahoma, Verdana, sans-serif;
  color: #2c2b28;
}

/* КОНТЕЙНЕР */
.site-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* ===== 1.4.2. ССЫЛКА (стили и состояния) ===== */
a {
  color: #c47d2e;
  transition: all 0.2s ease;
}

a:hover {
  color: #2e5a3a;
  text-decoration: underline;
}

a:visited {
  color: #8b5e2e;
}

a:active {
  color: #d68c2c;
}

/* ===== 1.4.3. ЗАГОЛОВОК ПЕРВОГО УРОВНЯ ===== */
h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #2c5e3a;
}

/* ===== 1.4.4. ЗАГОЛОВОК ВТОРОГО УРОВНЯ ===== */
h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 25px 0 15px 0;
  color: #3a6a3a;
  border-left: 4px solid #d6a142;
  padding-left: 15px;
}

/* ===== 1.4.5. ЗАГОЛОВОК ТРЕТЬЕГО УРОВНЯ ===== */
h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 15px 0 10px 0;
  color: #4a7a4a;
}

/* ===== 1.4.6. ИЗОБРАЖЕНИЕ (рамка, скругление) ===== */
img {
  max-width: 100%;
  border: 2px solid #e0d5c0;
  border-radius: 12px;
  transition: all 0.2s ease;
}

/* ===== 1.4.7. ИЗОБРАЖЕНИЕ-ССЫЛКА ===== */
a:hover img {
  border-color: #d6a142;
  transform: scale(1.02);
}

.product-img-link {
  display: block;
}

/* ===== ШАПКА ===== */
.main-header {
  background: #2e5a3a;
  padding: 20px 30px;
  border-bottom: 4px solid #d6a142;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: none;
}

.logo-text h1 {
  font-size: 24px;
  font-weight: bold;
  color: #ffefcf;
  margin-bottom: 0;
  border-left: none;
  padding-left: 0;
}

.logo-text p {
  font-size: 14px;
  color: #e2e2b6;
}

/* ===== ВЕРХНЕЕ МЕНЮ ===== */
.top-nav {
  background: #1f3f2c;
  border-radius: 40px;
  padding: 10px 25px;
}

.main-menu li {
  display: inline-block;
  margin: 0 12px;
}

.main-menu a {
  color: #fcf9ea;
  font-weight: 600;
  padding: 8px 5px;
}

.main-menu a:hover {
  color: #ffd966;
  text-decoration: none;
  border-bottom: 2px solid #ffd966;
}

.main-menu a:active {
  color: #ffb347;
}

.main-menu a:visited {
  color: #cfe3cf;
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ В ШАПКЕ ===== */
.main-menu .dropdown {
  position: relative;
  display: inline-block;
}

.main-menu .dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1f3f2c;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 12px;
  z-index: 100;
  padding: 8px 0;
}

.main-menu .dropdown-content li {
  display: block;
  margin: 0;
}

.main-menu .dropdown-content a {
  color: #fcf9ea;
  padding: 10px 18px;
  display: block;
  text-align: left;
  font-size: 14px;
}

.main-menu .dropdown-content a:hover {
  background-color: #d6a142;
  color: #1e3524;
  text-decoration: none;
  border-bottom: none;
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.main-container {
  display: flex;
  gap: 30px;
  padding: 40px 30px;
  background: #fffdf9;
}

/* ===== ЛЕВАЯ КОЛОНКА ===== */
.sidebar-left {
  flex: 1;
  min-width: 260px;
  background: #fef8ed;
  border-radius: 20px;
  padding: 20px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
  color: #2e5a3a;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d6a142;
}

/* Двухуровневое левое меню */
.left-nav > ul > li {
  margin-bottom: 8px;
}

.left-nav a {
  color: #3a5a3a;
  font-weight: 600;
  display: block;
  padding: 8px 10px 8px 28px;
}

.left-nav li.leaf a {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="%23806942"><circle cx="12" cy="12" r="8"/></svg>') left center no-repeat;
  background-size: 12px;
}

.left-nav li.tree > a {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="%23d68c2c"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>') left center no-repeat;
  background-size: 14px;
  cursor: pointer;
}

li.tree ul {
  display: none;
  margin-left: 25px;
  margin-top: 8px;
  background: #fef3e0;
  border-radius: 12px;
  padding: 8px 0;
}

li.tree ul li a {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="%23956e3e"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>') left center no-repeat;
  background-size: 10px;
  padding-left: 22px;
}

li.tree.opened ul {
  display: block;
}

/* Информационные блоки */
.info-block {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #e7dcc8;
}

.block-title {
  font-size: 16px;
  font-weight: bold;
  color: #2e5a3a;
  margin-bottom: 12px;
  padding-left: 25px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="%23d6a142"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>') left center no-repeat;
  background-size: 18px;
}

.info-block ul li {
  margin: 10px 0;
  padding-left: 20px;
}

.info-block a {
  color: #5a4a2e;
  font-size: 14px;
}

.info-block a:hover {
  color: #b97f10;
}

/* ===== 1.4.10. СПИСОК (стили для маркированных списков) ===== */
.styled-list {
  list-style-type: disc;
  margin: 15px 0 20px 30px;
}

.styled-list li {
  margin: 8px 0;
  line-height: 1.5;
}

.info-list {
  background: #f9f5e8;
  padding: 15px 20px;
  border-radius: 16px;
  margin-bottom: 25px;
}

/* ===== КАЛЬКУЛЯТОР (динамический элемент) ===== */
.calculator-block {
  margin-top: 30px;
  padding: 15px;
  background: #f0ebe0;
  border-radius: 16px;
  border: 1px solid #e0d5c0;
}

.calculator-form .form-group {
  margin-bottom: 12px;
}

.calculator-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3a5a3a;
  margin-bottom: 5px;
}

/* 1.4.8. ПОЛЕ ВВОДА */
.calculator-form input[type="text"],
.calculator-form select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c0b59a;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.calculator-form input[type="text"]:focus,
.calculator-form select:focus {
  border-color: #d6a142;
  outline: none;
  box-shadow: 0 0 5px rgba(214, 161, 66, 0.3);
}

.calculator-form input[readonly] {
  background-color: #e8e0d0;
  cursor: default;
}

/* 1.4.9. КНОПКА */
.calc-btn,
.demo-btn {
  background: #2e5a3a;
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  width: 100%;
}

.calc-btn:hover,
.demo-btn:hover {
  background: #d6a142;
  cursor: pointer;
  transform: translateY(-2px);
}

.calc-btn:active,
.demo-btn:active {
  background: #b8872e;
  transform: translateY(0);
}

.calc-note {
  font-size: 11px;
  color: #8a7a60;
  margin-top: 10px;
  text-align: center;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.content-main {
  flex: 3;
  min-width: 280px;
}

.breadcrumbs {
  font-size: 13px;
  color: #7f6b46;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 3px solid #d6a142;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  color: #2c5e3a;
  margin-bottom: 15px;
}

.intro-text {
  color: #5a4a2e;
  line-height: 1.5;
  margin-bottom: 30px;
}

.section-title {
  font-size: 22px;
  font-weight: bold;
  color: #2e5a3a;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eeddbb;
}

/* Сетка товаров */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.product-card {
  background: #fffef7;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s;
  border: 1px solid #f0e5d4;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.product-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8dfcf;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  border-radius: 0;
}

.product-info {
  padding: 15px;
}

.product-name {
  font-size: 18px;
  font-weight: bold;
  color: #3a623a;
  margin-bottom: 8px;
}

.product-desc {
  font-size: 13px;
  color: #6f604a;
  margin-bottom: 12px;
  line-height: 1.4;
}

.product-price {
  font-size: 20px;
  font-weight: bold;
  color: #c47d2e;
  margin-bottom: 12px;
}

.btn-buy {
  background: #2e5a3a;
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-buy:hover {
  background: #c47d2e;
  cursor: pointer;
  transform: scale(0.98);
}

.btn-buy:active {
  background: #9e651f;
}

/* Блок преимуществ */
.features-block {
  background: #fbf5e8;
  border-radius: 20px;
  padding: 20px;
  margin: 30px 0;
}

.features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: space-around;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  border: none;
}

/* CSS иконка */
.css-icon {
  width: 32px;
  height: 32px;
  background-color: #d6a142;
  border-radius: 50%;
  border: none;
}

.clock-icon {
  background: #d6a142 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="white"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zM12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>') center no-repeat;
  background-size: 20px;
}

/* Ссылки с иконкой */
.icon-link {
  background: url(icon.png) 0px 2px no-repeat;
  padding-left: 18px;
  background-size: 14px;
  color: #c47d2e;
}

.icon-link:hover {
  color: #2e5a3a;
}

/* Демо-форма полей ввода */
.demo-form {
  background: #f5f0e6;
  padding: 20px;
  border-radius: 16px;
  margin-top: 25px;
}

.demo-input {
  width: calc(50% - 10px);
  padding: 10px;
  margin: 5px 5px;
  border: 1px solid #aaa;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.demo-input:focus {
  border-color: #00cccc;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 204, 204, 0.3);
}

.demo-btn {
  width: auto;
  padding: 10px 25px;
  margin-top: 10px;
}

.demo-note {
  font-size: 11px;
  color: #8a7a60;
  margin-top: 10px;
}

/* ===== ПОДВАЛ ===== */
.main-footer {
  background: #1e3524;
  padding: 35px 30px 20px;
  color: #e6e2cf;
  border-top: 3px solid #d6a142;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #ffdfaa;
  border-left: 3px solid #d6a142;
  padding-left: 10px;
}

.footer-col ul li {
  margin: 8px 0;
}

.footer-col a {
  color: #d4cfb0;
  font-size: 13px;
}

.footer-col a:hover {
  color: #f7c56e;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #47663b;
  font-size: 12px;
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ В ПОДВАЛЕ ===== */
.footer-col .footer-dropdown {
  position: relative;
}

.footer-dropdown .footer-dropdown-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background-color: #2e5a3a;
  min-width: 200px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 8px 0;
  z-index: 100;
  margin-bottom: 5px;
}

.footer-dropdown .footer-dropdown-content li {
  margin: 0;
}

.footer-dropdown .footer-dropdown-content a {
  color: #ffefcf;
  padding: 8px 16px;
  display: block;
  font-size: 13px;
}

.footer-dropdown .footer-dropdown-content a:hover {
  background-color: #d6a142;
  color: #1e3524;
  text-decoration: none;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  
  .header-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .main-menu li {
    margin: 0 8px;
  }
  
  .main-menu .dropdown-content {
    position: static;
    box-shadow: none;
    margin-top: 5px;
  }
  
  .footer-dropdown .footer-dropdown-content {
    position: static;
    box-shadow: none;
    margin-top: 8px;
    margin-bottom: 0;
  }
  
  .demo-input {
    width: 100%;
    margin: 5px 0;
  }
}

/* Дополнительные стили для авторизации и счёта */
.auth-block {
    background: #fef8ed;
    border: 1px solid #e0d5c0;
}

.auth-form input,
.register-form input {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #d6a142;
    border-radius: 8px;
    box-sizing: border-box;
}

.auth-form input:focus,
.register-form input:focus {
    border-color: #c47d2e;
    outline: none;
    box-shadow: 0 0 5px rgba(196, 125, 46, 0.3);
}

.invoice-block {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.products-section .btn-buy:active {
    transform: scale(0.98);
}

/* Стили для защищённого раздела */
.user-greeting {
    background: linear-gradient(135deg, #2e5a3a 0%, #1e3524 100%);
    color: white;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-greeting a {
    color: #ffd966;
}