/* ---------- Сброс и базовые настройки ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #faf3eb;
  color: #3e2c1b;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- ШАПКА ---------- */
header {
  background: linear-gradient(135deg, #3a1f0e 0%, #5c3a21 100%);
  color: #f5deb3;
  padding: 12px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid #d4a373;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.logo span {
  color: #d4a373;
}

nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
}
nav a {
  font-size: 18px;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 3px solid transparent;
  transition: 0.3s;
}
nav a:hover {
  border-bottom-color: #d4a373;
  color: #ffe6b0;
  transform: translateY(-2px);
}

/* ---- СТРАНИЦА КАТАЛОГА ---- */
.catalog-page {
  padding: 40px 0;
}
.catalog-page h1 {
  font-size: 32px;
  margin-bottom: 30px;
  color: #4a3320;
  text-align: center;
}

/* Фильтры */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  background: #fffaf5;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e6d4c4;
}
.filters input,
.filters select,
.filters button {
  padding: 10px 16px;
  border-radius: 30px;
  border: 1px solid #d4c0b0;
  background: #fff;
  font-size: 16px;
  outline: none;
}
.filters input:focus,
.filters select:focus {
  border-color: #b68b6b;
}
.filters input {
  flex: 1 1 200px;
}
.filters button {
  background: #d4a373;
  color: #3e2c1b;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.filters button:hover {
  background: #e8c49a;
}

/* Сетка каталога */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

/* Карточка в каталоге */
.catalog-card {
  background: #fffaf5;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  border: 1px solid #e6d4c4;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 18px;
}
.catalog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.catalog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  background: #d8c0a8;
  margin-bottom: 12px;
}
.catalog-card h3 {
  font-size: 18px;
  margin: 6px 0 4px;
  color: #3e2c1b;
  font-weight: 600;
}
.catalog-card .desc {
  flex-grow: 1;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 12px;
}
.card-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: auto;
}
.btn-order {
  flex: 1;
  background: #6a075d;
  color: #eadfdf;
  padding: 8px 0;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-order:hover {
  background: #9f178d;
  transform: scale(1.02);
}
.btn-details {
  flex: 1;
  background: #5c3a21;
  color: #f5deb3;
  padding: 8px 0;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn-details:hover {
  background: #7a4f2e;
  transform: scale(1.02);
}

/* ---- МОДАЛЬНОЕ ОКНО ---- */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  position: relative;
  background: #faf3eb;
  margin: 40px auto;
  padding: 30px 30px 50px;
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow: visible;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.modal-close {
  position: sticky;
  top: 10px;
  float: right;
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #d4a373;
  color: #3e2c1b;
  cursor: pointer;
  transition: 0.2s;
  z-index: 10;
  margin-top: -10px;
  margin-right: -10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.modal-close:hover {
  background: #e8c49a;
  transform: scale(1.05);
}

.modal-body-scroll {
  overflow-y: auto;
  max-height: 60vh;
  padding-right: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal-body-scroll::-webkit-scrollbar {
  display: none;
}

.modal-footer {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}
.modal-footer .btn-order {
  display: inline-block;
  padding: 12px 36px;
  background: #6a075d;
  color: #eadfdf;
  border-radius: 40px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  transition: 0.2s;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.modal-footer .btn-order:hover {
  background: #9f178d;
  transform: scale(1.02);
}
.modal-image {
  margin-bottom: 20px;
  position: relative;
}
.slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d8c0a8;
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
}
.slider-wrapper img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.7);
  border: none;
  font-size: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3e2c1b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.slider-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}
.slider-btn.prev {
  left: 10px;
}
.slider-btn.next {
  right: 10px;
}
.slider-counter {
  position: absolute;
  bottom: 10px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  pointer-events: none;
}
.no-image {
  padding: 40px;
  text-align: center;
  color: #7a5f4a;
  background: #d8c0a8;
  border-radius: 12px;
}
.modal-content h2 {
  font-size: 26px;
  margin-bottom: 16px;
  color: #3e2c1b;
  padding-right: 50px;
}
.modal-image {
  text-align: center;
  margin-bottom: 20px;
}
.modal-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  object-fit: contain;
  background: #d8c0a8;
}
.modal-info p {
  margin: 6px 0;
  font-size: 16px;
  line-height: 1.6;
}
.modal-info strong {
  color: #5c3a21;
}
.modal-description {
  margin: 16px 0;
  background: rgba(255,255,255,0.4);
  padding: 12px 16px;
  border-radius: 8px;
}
.modal-description p {
  margin: 6px 0 0;
}
.modal-chars {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.modal-chars li {
  padding: 6px 0;
  border-bottom: 1px solid #e6d4c4;
}
.modal-chars li:last-child {
  border-bottom: none;
}

/* ---- ФУТЕР ---- */
footer {
  background-size: cover;
  background-position: center;
  padding: 30px 0;
  color: #f5deb3;
  position: relative;
  margin-top: 0;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 20, 10, 0.7);
  z-index: 0;
}

footer .container {
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.copy {
  font-size: 16px;
  opacity: 0.9;
}

.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 30px;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #f5deb3;
}

.footer-contact-item img {
  width: 24px;
  height: 24px;
}

.footer-contact-icon {
  font-size: 22px;
  line-height: 1;
}

.footer-social {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.footer-social .social-link {
  display: inline-block;
  width: 44px;
  height: 44px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.footer-social .social-link img {
  width: 24px;
  height: 24px;
}

.footer-social .social-link:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

/* Адаптив */
@media (max-width: 600px) {
  .modal-content {
    margin: 20px auto;
    padding: 20px 20px 40px;
    max-height: 90vh;
  }
  .modal-actions .btn-order {
    transform: translateY(20px);
    padding: 10px 24px;
    font-size: 16px;
  }
  .modal-actions .btn-order:hover {
    transform: translateY(18px) scale(1.02);
  }
  .card-actions {
    flex-direction: column;
    gap: 8px;
  }
  .btn-order, .btn-details {
    flex: none;
    width: 100%;
  }
}

/* ---- МОДАЛКА ДЛЯ ВВОДА ПАРОЛЯ АДМИНА ---- */
.admin-password-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
}
.admin-password-content {
  background: #faf3eb;
  margin: 200px auto;
  padding: 30px 30px 40px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.admin-password-close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 28px;
  cursor: pointer;
  color: #3e2c1b;
  transition: 0.2s;
}
.admin-password-close:hover {
  color: #d4a373;
}
.admin-password-content h3 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #3e2c1b;
}
.admin-password-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.admin-password-input-group input {
  flex: 1 1 180px;
  padding: 10px 16px;
  border-radius: 30px;
  border: 1px solid #d4c0b0;
  font-size: 16px;
  outline: none;
}
.admin-password-input-group input:focus {
  border-color: #b68b6b;
}
.admin-password-input-group button {
  padding: 10px 24px;
  background: #6a075d;
  color: #eadfdf;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
}
.admin-password-input-group button:hover {
  background: #9f178d;
  transform: scale(1.02);
}
.admin-password-error {
  color: #b22222;
  margin-top: 12px;
  font-size: 15px;
}