/* ===== БАЗОВЫЕ НАСТРОЙКИ ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --container-width: min(90%, 1280px);
  --block-padding: clamp(2rem, 5vw, 4rem);
  --font-base: clamp(1rem, 2vw, 1.125rem);
  
  --color-amber: #E6A017;
  --color-amber-light: #F0B429;
  --color-baltic: #1E466E;
  --color-baltic-light: #2C5A8C;
  --color-terracotta: #9E5A3A;
  --color-terracotta-light: #C16F48;
  --color-bg: #F9F7F3;
  --color-text: #2E2E2E;
  --color-gray: #6c757d;
  --color-border: #e5e5e5;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 12px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

/* ===== КОНТЕЙНЕР И ЕДИНАЯ СЕТКА ===== */
.container {
  width: var(--container-width);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* ===== БЛОКИ ===== */
.block {
  padding: var(--block-padding) 0;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.block:nth-child(even) {
  background: #ffffff;
}

.block h2 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  color: var(--color-baltic);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  letter-spacing: -0.02em;
}

.block h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--color-amber);
  border-radius: 4px;
}

/* ===== ХЕДЕР ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  padding: 0.8rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: clamp(0.8rem, 2vw, 2rem);
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-baltic);
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.nav-links a:hover {
  border-bottom-color: var(--color-amber);
  color: var(--color-amber);
}

#adminToggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 0.3rem;
}

#adminToggle:hover {
  opacity: 1;
}

/* ===== ПРОФИЛЬ ===== */
.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 4vw, 2rem);
}

.profile-photo {
  width: clamp(120px, 20vw, 180px);
  height: clamp(120px, 20vw, 180px);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-amber);
  box-shadow: var(--shadow-sm);
}

.profile-info h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--color-baltic);
  margin-bottom: 0.3rem;
}

.profile-city {
  color: var(--color-terracotta);
  font-size: 1rem;
  margin-bottom: 0.8rem;
  display: inline-block;
  background: rgba(158,90,58,0.1);
  padding: 0.2rem 0.8rem;
  border-radius: 30px;
}

.profile-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.rating-value {
  font-weight: 700;
  color: var(--color-amber);
  font-size: 1.5rem;
}

.btn-respond {
  display: inline-block;
  background: var(--color-amber);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-respond:hover {
  background: var(--color-amber-light);
  transform: translateY(-2px);
}

/* ===== О СЕБЕ ===== */
.about-content {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 4vw, 2rem);
}

.about-content p {
  margin-bottom: 1.8rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

.about-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem 1.5rem;
}

.about-details dt {
  font-weight: 700;
  color: var(--color-baltic);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.about-details dd {
  margin: 0;
  color: var(--color-text);
  font-weight: 500;
}

/* ===== ДИПЛОМЫ ===== */
.diplomas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.5rem;
}

.diploma-item {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: visible;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #f0f0f0;
  position: relative;
}

.diploma-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.diploma-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* ===== УСЛУГИ ===== */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  width: 100%;
}

.service-item {
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--color-border);
  position: relative;
}


.service-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.service-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-baltic);
}

.service-price {
  font-weight: 700;
  color: var(--color-amber);
  font-size: 1.2rem;
  background: rgba(230,160,23,0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 30px;
}

.service-description {
  color: var(--color-gray);
  margin: 0.8rem 0;
  line-height: 1.5;
}

.service-images {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.service-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ===== ОТЗЫВЫ ===== */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review-item {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  position: relative;
  transition: box-shadow 0.2s;
}

.review-item:hover {
  box-shadow: var(--shadow-md);
}

.review-header {
  margin-bottom: 0.5rem;
}

.review-author {
  font-weight: 700;
  color: var(--color-baltic);
  font-size: 1.1rem;
}

.review-date {
  color: var(--color-gray);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.review-rating {
  color: var(--color-amber);
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 0.8rem;
}

.review-text {
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.review-photos {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.review-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s;
}

.review-photo:hover {
  transform: scale(1.05);
}

/* Пагинация */
.reviews-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 0.8rem;
  background: #fff;
  border: 2px solid var(--color-baltic-light);
  border-radius: 30px;
  color: var(--color-baltic);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  background: var(--color-baltic);
  color: #fff;
  border-color: var(--color-baltic);
}

.page-btn.active {
  background: var(--color-amber);
  border-color: var(--color-amber);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== ФОРМА ДОБАВЛЕНИЯ ОТЗЫВА ===== */
.review-form-container {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.8rem;
  margin-bottom: 2rem;
  border: 2px solid var(--color-amber);
}

.review-form-container h3 {
  font-size: 1.5rem;
  color: var(--color-baltic);
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-baltic);
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-amber);
}

.star-rating {
  display: flex;
  gap: 0.3rem;
  font-size: 1.8rem;
  cursor: pointer;
  margin: 0.5rem 0;
}

.star-rating .star {
  color: #ddd;
  transition: color 0.15s;
}

.star-rating .star.active {
  color: var(--color-amber);
}

.photo-preview-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.photo-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.remove-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.btn-form-save {
  background: var(--color-amber);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-form-save:hover {
  background: var(--color-amber-light);
}

.btn-form-cancel {
  background: var(--color-gray);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 600;
}

/* ===== АДМИН-КНОПКИ ===== */
.admin-controls {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.admin-controls button {
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background: var(--color-terracotta);
  color: #fff;
}

.btn-add {
  background: var(--color-baltic);
  color: #fff;
}

.btn-save {
  background: var(--color-amber);
  color: #fff;
}

/* Кнопка удаления для дипломов/услуг */
.btn-delete {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.btn-delete:hover {
  transform: scale(1.05);
}

/* Кнопка удаления отзыва */
.btn-del-review {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-item:hover .btn-del-review {
  opacity: 1;
}

/* ===== ФУТЕР ===== */
.site-footer {
  padding: 2rem 0;
  background: var(--color-baltic);
  color: #fff;
  text-align: center;
}

.site-footer p {
  margin: 0.3rem 0;
  opacity: 0.9;
}

.footer-note {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ===== УТИЛИТЫ ===== */
.hidden {
  display: none !important;
}

.loading {
  text-align: center;
  color: var(--color-gray);
  padding: 2rem;
}

/* Адаптация для мобилок */
@media (max-width: 768px) {
  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .profile-photo {
    margin: 0 auto;
  }
  
  .profile-rating {
    justify-content: center;
  }
  
  .header-inner {
    justify-content: center;
  }
  
  .nav-links {
    justify-content: center;
  }
  
  .service-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .review-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .block h2::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .block h2 {
    text-align: center;
    display: block;
  }
  
  .about-details {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .about-details dt {
    margin-top: 0.5rem;
  }
}

/* Стили для элементов, добавляемых админкой */
.upload-box {
  border: 2px dashed var(--color-amber);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(230,160,23,0.05);
  transition: background 0.2s;
  color: var(--color-amber);
  font-weight: 500;
}

.upload-box:hover {
  background: rgba(230,160,23,0.1);
}

.preview-img {
  max-width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* Режим редактирования профиля */
.profile-block.editing .profile-photo {
  cursor: pointer;
  position: relative;
}

.profile-block.editing .profile-photo::after {
  content: '📷';
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--color-amber);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.star-rating .star.active {
  color: var(--color-amber);
}