/* static/css/style.css – полный файл стилей «Царский стол» */

/* ========== ПЕРЕМЕННЫЕ ========== */
:root {
  --yellow: #FFC452;
  --yellow-dark: #e6a800;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray: #e0e0e0;
  --text: #333333;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --transition: 0.2s ease;
}

/* ========== БАЗОВЫЕ СБРОСЫ ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

#app-bg {
  background: linear-gradient(180deg, var(--yellow) 0%, var(--white) 50%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== ЛОГОТИП (НЕ ТРОГАЕМ) ========== */
.main-header {
  text-align: center;
  padding: 30px 0 10px;
}
.logo-link img {
  width: 90%;
  max-width: 1000px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* ========== ПУБЛИЧНОЕ МЕНЮ ========== */
.public-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px auto 20px;
  flex-wrap: wrap;
}
.nav-item {
  background: rgba(255,255,255,0.9);
  padding: 10px 24px;
  border-radius: 30px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: 1px solid transparent;
}
.nav-item.active,
.nav-item:hover {
  background: white;
  border-color: var(--yellow-dark);
  transform: translateY(-1px);
}

/* ========== ОСНОВНАЯ КАРТОЧКА КОНТЕНТА ========== */
.content-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 30px;
  margin: 20px auto;
  max-width: 1100px;
  width: 90%;
  box-shadow: var(--shadow);
  flex: 1;
}

.content-card p {
  text-align: center;
}

/* ========== АДМИНКА ========== */
.admin-layout {
  display: flex;
  gap: 20px;
  min-height: 60vh;
}
.admin-sidebar {
  width: 220px;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.admin-nav-item {
  display: block;
  padding: 10px 15px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 5px;
  transition: var(--transition);
}
.admin-nav-item:hover,
.admin-nav-item.active {
  background: var(--yellow);
  color: #000;
  font-weight: 500;
}
.admin-nav-item.logout {
  margin-top: 20px;
  color: #c0392b;
}
.admin-content {
  flex: 1;
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* Дашборд */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--yellow-dark);
}
.stat-desc {
  color: #666;
  font-size: 0.9rem;
}

/* Формы */
.auth-form {
  max-width: 420px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.input-group {
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  font-size: 14px;
  transition: var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255,196,82,0.3);
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-sm {}
.btn-primary {
  background: var(--yellow);
  color: #000;
  border: 1px solid var(--yellow-dark);
}
.btn-primary:hover { background: var(--yellow-dark); }
.btn-warning { background: #e67e22; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-ran { background: #2e842b; color: white; }
.btn-block { width: 100%; }

/* Переключатели */
.form-switch { margin-bottom: 20px; }
.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.switch-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  transition: var(--transition);
}
.switch-label input:checked + .switch-slider {
  background: var(--yellow);
}
.switch-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}
.switch-label input:checked + .switch-slider::after {
  left: 22px;
}

/* Таблицы */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: var(--gray-light);
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
}
.data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid var(--gray);
}
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}
.badge-superadmin { background: #2ecc71; color: white; }
.badge-admin { background: #3498db; color: white; }
.badge-user { background: #95a5a6; color: white; }

/* ========== ПУБЛИЧНЫЕ СТРАНИЦЫ ========== */

/* Заголовок раздела */
.info_blok_centr_name {
  text-align: center;
  font-size: 2rem;
  margin: 0px;
  margin-top: -20px;
  color: #000;
  font-weight: 700;
}

/* Главная: пост с гибкой раскладкой */
.index_info {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
.index_info .imags-index_page,
.index_info .imags-index_page_right {
  flex: 1 1 300px;
  max-width: 100%;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
}
.imags-index {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  display: block;
}
.index_info_text {
  flex: 2 1 400px;
  padding: 10px;
}
.index_info_text h2 {
  margin-top: 0;
}
@media (max-width: 768px) {
  .index_info .imags-index_page,
  .index_info .imags-index_page_right {
    flex: none;
    width: 100%;
    margin: 0 0 -15px 0;
  }
}

/* Сетка товаров */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.product-card {
  background: white;
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.product-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}
.price { margin: 10px 0; }
.current-price { font-size: 1.3rem; font-weight: bold; color: #e67e22; }
.old-price { text-decoration: line-through; color: #999; margin-left: 8px; }

/* Список филиалов */
.branches {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.branch {
  background: white;
  border-radius: var(--radius);
  padding: 15px;
  width: 280px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.branch:hover { transform: translateY(-2px); }
.branch_span {
  background: var(--gray-light);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.9rem;
}
.office_span { flex: 1; }

/* Модальное окно офиса */
.office-modal h2 { margin-bottom: 15px; text-align: center; }
.office-gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.office-gallery img {
  max-width: 45%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.office-gallery img:hover { transform: scale(1.05); }
.office-links { margin-bottom: 20px; text-align: center; }
.office-links .btn { margin: 5px; }
.moved-office {
    background-color: #ffe6e6;
}
@media (max-width: 768px) {
  .office-gallery img {
    max-width: 100%;
    max-height: none;
  }
}

/* Отзывы */
.reviews-list { margin-bottom: 20px; }
.review-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
}
.admin-response {
  margin-top: 10px;
  font-style: italic;
  color: #555;
}

/* Форма отзыва */
.review-form {
  background: #f0f0f0;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}
.review-form input,
.review-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}
.review-form button {
  background: var(--yellow);
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}
.review-form button:hover { background: var(--yellow-dark); }

/* Модальное окно товара */
.product-modal {
  padding: 20px;
  text-align: center;
}
.product-modal img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
}
.product-modal h2 { margin-bottom: 15px; }
.product-modal .price { margin-top: 20px; }

/* Контакты */
.contact-page { text-align: center; }
.contact-list {
  list-style: none;
  margin: 30px 0;
}
.contact-list li {
  margin-bottom: 15px;
  font-size: 1.1rem;
}
.contact-list a {
  color: var(--text);
  text-decoration: underline;
}
.messaging-services { margin: 40px 0; }
.messaging-services img {
  width: 56px;
  height: 56px;
  margin: 0 15px;
  vertical-align: middle;
  transition: transform 0.2s;
}
.messaging-services img:hover { transform: scale(1.1); }
.social-media { margin-top: 10px; }
.social-media a {
  display: inline-block;
  margin: 8px 12px;
  padding: 10px 24px;
  background: var(--gray-light);
  border-radius: 25px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}
.social-media a:hover {
  background: var(--yellow);
  color: #000;
}

.contact-list {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.contact-list li, .social-media{
  margin: 0 10px;
  text-align: center;
}

/* Звёзды рейтинга */
.rating { direction: rtl; display: flex; justify-content: center; gap: 5px; margin: 10px 0; }
.rating input { display: none; }
.rating label { font-size: 30px; color: #ddd; cursor: pointer; }
.rating input:checked ~ label { color: var(--yellow); }

/* ========== ФУТЕР ========== */
.main-footer {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 30px;
  padding: 30px 20px;
  margin-top: auto;
  font-size: 0.95rem;
  color: #444;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}
.footer-col {
  flex: 1 1 250px;
  text-align: left;
  padding: 15px;
}
.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #000;
}
.footer-col img {
  height: 100px;
  margin-top: 10px;
}
.footer-col p { line-height: 1.6; }
@media (max-width: 768px) {
  .main-footer {
    flex-direction: column;
    align-items: center;
  }
}

/* ========== ПАГИНАЦИЯ ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.pagination .current { background: var(--yellow); font-weight: bold; }

/* ========== TOAST-УВЕДОМЛЕНИЯ ========== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: white;
  padding: 14px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-weight: 500;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}
.toast-success { border-left: 4px solid #2ecc71; }
.toast-danger { border-left: 4px solid #e74c3c; }
.toast-info { border-left: 4px solid #3498db; }
.toast.fade-out { animation: fadeOut 0.4s ease forwards; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ========== ЛОГ-ВЬЮЕР ========== */
.log-viewer {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 15px;
  border-radius: var(--radius);
  max-height: 500px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}
.log-viewer pre { white-space: pre-wrap; word-wrap: break-word; }

/* ========== МОДАЛЬНОЕ ПОДТВЕРЖДЕНИЕ ========== */
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 8000;
  justify-content: center;
  align-items: center;
}
.confirm-dialog {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.confirm-dialog p { margin-bottom: 20px; font-size: 1.1rem; }
.confirm-dialog .btn { margin: 0 10px; }

/* Кнопка "Наверх" */
.scroll-top-btn {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 5000;
  background: var(--yellow);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ========== ВСПОМОГАТЕЛЬНЫЕ ========== */
.flash {
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-danger { background: #f8d7da; color: #721c24; }
.flash-info { background: #d1ecf1; color: #0c5460; }

/* Превью загружаемых фото */
.preview-thumb {
    max-width: 250px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Модальное окно (публичное) */
#details {
  display: none;
  position: fixed;
  background-color: rgba(0, 0, 0, 0.7);
  width: 100%;
  height: 100%;
  text-align: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.5s ease;
}
#details.active { display: flex; }
body.modal-open { overflow: hidden; }
#blok_info_okno {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  margin: auto;
  max-width: 1000px;
  width: 80%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  max-height: 90%;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== АДАПТИВ ========== */
@media (max-width: 768px) {
  /* Админ‑структура */
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    position: relative;
    padding: 10px;
  }
  .sidebar-toggle {
    display: block;
    margin-bottom: 10px;
  }
  .admin-nav {
    display: none;
  }
  .admin-nav.open {
    display: block;
  }
  .admin-content {
    padding: 15px;
  }

  /* Дашборд */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Таблицы с горизонтальной прокруткой */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .data-table {
    min-width: 600px;   /* чтобы не сжималась, а скроллилась */
  }

  /* Кнопки */
  .btn {
    width: 100%;
    margin-bottom: 5px;
  }
  .btn + .btn {
    margin-left: 0;
  }

  /* Формы */
  .auth-form {
    width: 100%;
    padding: 20px;
  }
  .input-group label {
    font-size: 0.9rem;
  }
  .form-input {
    font-size: 16px;        /* чтобы не масштабировалось на iOS */
  }

  /* Посты главной */
  .index_info {
    flex-direction: column;
  }

  /* Сетка товаров */
  .products-grid {
    grid-template-columns: 1fr;
  }

  /* Футер */
  .main-footer {
    flex-direction: column;
    align-items: center;
  }
  .footer-col {
    text-align: center;
  }
}




.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.file-card {
    background: white;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}
.file-card img {
    max-width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
}
.file-info {
    margin: 10px 0;
}



.contact-section {
    margin-bottom: 30px;
}
.contact-section h2 {
    margin-bottom: 15px;
    color: var(--yellow-dark);
}
.messaging-services a, .social-media a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
}