/* ==========================================================
   reviews-page.css
   Стилі для сторінки «Відгуки» (Сімпа)
   Використовує CSS-змінні та базові класи з основного styles.css
   ========================================================== */


/* === HERO ================================================ */
.reviews-hero {
  padding: 50px 0 30px;
  position: relative;
}
.reviews-hero .breadcrumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 22px; flex-wrap: wrap;
}
.reviews-hero .breadcrumbs a { color: var(--muted); transition: color .2s; }
.reviews-hero .breadcrumbs a:hover { color: var(--rose-deep); }
.reviews-hero .breadcrumbs .sep { opacity: 0.4; }
.reviews-hero .breadcrumbs .current { color: var(--ink); font-weight: 600; }

.reviews-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: 16px;
  max-width: 800px;
}
.reviews-hero h1 em { font-style: italic; color: var(--rose); }
.reviews-hero .subtitle {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 8px;
}


/* === Таби (заміна .nav-tabs) ============================= */
.nav-tabs {
  list-style: none;
  display: inline-flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 32px 0 8px;
  box-shadow: 0 8px 20px -12px rgba(31,26,38,0.12);
}
.nav-tabs li {
  list-style: none;
  margin: 0;
}
.nav-tabs li > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-tabs li > a:hover {
  color: var(--rose-deep);
}
.nav-tabs li.active > a {
  background: var(--ink);
  color: #fff;
  cursor: default;
}


/* === Tab content ========================================= */
.tab-content {
  margin-top: 24px;
}
.tab-pane {
  display: none;
  animation: fadeIn .35s ease;
}
.tab-pane.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* === Список перукарень для додавання відгуку ============ */
/* Перевизначаємо Bootstrap-list-group у наші картки */
.list-group {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 12px 0 0;
  padding: 0;
}
.list-group-item {
  margin: 0;
  padding: 0;
  list-style: none;
  background: transparent;
  border: 0;
}
.list-group-item > a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 15.5px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.list-group-item > a:hover {
  transform: translateY(-3px);
  border-color: var(--rose);
  box-shadow: 0 16px 32px -16px rgba(217,114,8,0.3);
}
/* Помаранчевий пін зліва — перша літера назви перукарні (через ::before з content). 
   Бо ми не можемо стилізовано додати символ, додамо універсальну іконку */
.list-group-item > a::before {
  content: '';
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rose-pale);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23d97208' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: background .25s;
}
.list-group-item > a:hover::before {
  background-color: var(--rose);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'/%3E%3C/svg%3E");
}
/* Chevron справа */
.list-group-item > a::after {
  content: '';
  margin-left: auto;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235a4856' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .25s;
}
.list-group-item > a:hover::after {
  transform: translateX(4px);
}


/* === FB-посилання ======================================== */
.tab-pane .fb-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: #1877f2;
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  border-radius: 999px;
  text-decoration: none;
  margin-bottom: 24px;
  box-shadow: 0 12px 28px -10px rgba(24,119,242,0.4);
  transition: transform .2s, box-shadow .2s;
}
.tab-pane .fb-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -10px rgba(24,119,242,0.5);
  color: #fff;
}
.tab-pane .fb-link svg { flex-shrink: 0; }


/* === Список відгуків ===================================== */
.comments-tree-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  counter-reset: review;
}
.comments-tree-item {
  list-style: none;
  margin: 0;
  padding: 0;
}


/* === Картка одного відгуку — переніс із Bootstrap .panel .panel-default === */
.comments-tree-item .panel-default {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.comments-tree-item .panel-default:hover {
  transform: translateY(-2px);
  border-color: var(--rose-soft);
  box-shadow: 0 18px 36px -20px rgba(217,114,8,0.25);
}
/* Невелика помаранчева крапка зверху-зліва як акцент */
.comments-tree-item .panel-default::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rose-pale), transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s;
}
.comments-tree-item .panel-default:hover::before { opacity: 1; }


/* Шапка відгуку (panel-heading) — переробляємо */
.comments-tree-item .panel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 0;
  background: transparent;
  border: 0;
  position: relative;
  z-index: 1;
}
/* Аватар-кружечок з ініціалом (генеруємо через JS — додамо клас) */
.comments-tree-item .panel-heading .review-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-soft), var(--rose-pale));
  color: var(--rose-deep);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}
/* Контейнер з ім'ям і датою */
.comments-tree-item .panel-heading .review-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
}
.comments-tree-item .panel-heading .review-name,
.comments-tree-item .panel-heading > a {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
  border-bottom: none;
  pointer-events: none;
  cursor: default;
}
.comments-tree-item .panel-heading .review-date {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
/* 5 зірочок */
.comments-tree-item .panel-heading .review-stars {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #ffb800;
  font-size: 14px;
  letter-spacing: 1px;
  font-style: normal;
}

/* "&nbsp;|&nbsp;дата" — приховуємо стандартний |  
   Він залишається в DOM, але JS вже розрбав на name+date */
.comments-tree-item .panel-heading .sep-hidden {
  display: none;
}


/* Тіло відгуку */
.comments-tree-item .panel-body {
  padding: 0;
  background: transparent;
  border: 0;
  position: relative;
  z-index: 1;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.65;
}
.comments-tree-item .panel-body div {
  margin-bottom: 8px;
}
.comments-tree-item .panel-body div:last-child {
  margin-bottom: 0;
}
.comments-tree-item .panel-body p {
  margin-bottom: 8px;
}
.comments-tree-item .panel-body strong { color: var(--ink); }

/* Відповідь салону — підкреслимо її окремим блоком.
   Це додається через JS-обгортку. */
.comments-tree-item .review-reply {
  display: block;
  margin-top: 18px;
  padding: 18px 22px 18px 56px;
  background: var(--cream);
  border-radius: var(--r-md);
  border-left: 4px solid var(--rose);
  position: relative;
  font-style: normal;
  font-weight: 400;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}
.comments-tree-item .review-reply::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rose);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.comments-tree-item .review-reply .reply-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 6px;
}
.comments-tree-item .review-reply strong,
.comments-tree-item .review-reply b,
.comments-tree-item .review-reply i,
.comments-tree-item .review-reply em {
  font-style: normal;
  font-weight: 400;
}


/* === Пагінація — як у новинах ============================ */
.pagination {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 48px 0 0;
  padding: 0;
}
.comments-tree-list ~ nav,
.comments-tree-list + .col-md-12,
.tab-pane .col-md-12:has(.pagination) {
  width: 100%;
  padding: 0;
  float: none;
}
.pagination li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}
.pagination li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
  line-height: 1;
}
.pagination li a:hover {
  border-color: var(--rose);
  color: var(--rose-deep);
  background: var(--rose-pale);
  transform: translateY(-1px);
}
.pagination li a > span[aria-hidden="true"] {
  font-size: 16px;
  line-height: 1;
}
.pagination li.active a,
.pagination li.active a:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  cursor: default;
  transform: none;
}
.pagination .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* === Кнопка «Показати ще» (клієнтська пагінація) ========= */
.reviews-load-more-wrap {
  text-align: center;
}
.reviews-load-more {
  min-width: 220px;
  justify-content: center;
}
.reviews-load-more .arrow {
  transition: transform .25s;
}
.reviews-load-more:hover .arrow {
  transform: translateY(3px);
}
.reviews-count {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}


/* === Адаптив ============================================= */
@media (max-width: 1060px) {
  .list-group { grid-template-columns: 1fr; gap: 12px; }
  .comments-tree-item .panel-default { padding: 24px 22px; }
}

@media (max-width: 640px) {
  .reviews-hero { padding: 24px 0 12px; }

  .nav-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs li > a {
    padding: 10px 16px;
    font-size: 13.5px;
  }

  .list-group-item > a {
    padding: 18px 18px;
    gap: 12px;
    font-size: 14.5px;
  }
  .list-group-item > a::before { width: 38px; height: 38px; }

  .comments-tree-item .panel-default { padding: 22px 18px; }
  .comments-tree-item .panel-heading {
    gap: 12px;
    flex-wrap: wrap;
  }
  .comments-tree-item .panel-heading .review-stars {
    width: 100%;
    order: 3;
  }
  .comments-tree-item .panel-heading .review-avatar {
    width: 42px; height: 42px;
    font-size: 18px;
  }
  .comments-tree-item .panel-heading .review-name {
    font-size: 16px;
  }
  .comments-tree-item .panel-body { font-size: 14.5px; }
  .comments-tree-item .review-reply {
    padding: 14px 16px 14px 48px;
    font-size: 13.5px;
  }
  .comments-tree-item .review-reply::before {
    top: 14px; left: 14px;
    width: 24px; height: 24px;
    background-size: 12px;
  }

  .pagination { margin-top: 36px; gap: 4px; }
  .pagination li a {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 13.5px;
    border-radius: 10px;
  }
}


/* ==========================================================
   МОДАЛЬНЕ ВІКНО ДОДАВАННЯ ВІДГУКУ
   ========================================================== */
.review-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20,15,22,0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.review-modal.open {
  display: flex;
  animation: reviewModalFade .25s ease;
}
@keyframes reviewModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.review-modal-box {
  background: #fff;
  border-radius: var(--r-lg);
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 36px;
  position: relative;
  box-shadow: 0 40px 90px -20px rgba(20,15,22,0.5);
  animation: reviewModalPop .3s ease;
}
@keyframes reviewModalPop {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.review-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0;
  transition: transform .25s, background .2s;
}
.review-modal-close:hover {
  background: var(--rose-pale);
  color: var(--rose-deep);
  transform: rotate(90deg);
}

.review-modal-box h3 {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 6px;
  padding-right: 40px;
}
.review-modal-salon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rose-deep);
  background: var(--rose-pale);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

/* Поля форми відгуку — використовуємо ті ж стилі, що .simpa-form-row */
.review-modal .simpa-form-row { margin-bottom: 16px; }
.review-modal .simpa-form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.review-modal .simpa-form-row label .req {
  color: var(--rose-deep);
  margin-left: 2px;
}
.review-modal .simpa-form-row input,
.review-modal .simpa-form-row textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  transition: border-color .2s, background .2s;
}
.review-modal .simpa-form-row input:focus,
.review-modal .simpa-form-row textarea:focus {
  outline: none;
  border-color: var(--rose);
  background: #fff;
}
.review-modal .simpa-form-row textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}
.review-modal .field-invalid {
  border-color: #e74c3c !important;
  background: #fef6f6;
}

.review-modal-submit {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.review-modal-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

/* Блок успіху всередині модалки */
.review-modal-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 24px 10px 10px;
}
.review-modal-success.active {
  display: flex;
}
.review-modal-success-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2f5e8;
  color: #2d8c4e;
  display: grid;
  place-items: center;
  font-size: 32px;
  animation: simpaFormPop .4s ease-out;
}
@keyframes simpaFormPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.review-modal-success h3 {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink);
  padding: 0;
}
.review-modal-success p {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
}
.review-modal-success .autoclose-hint {
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .review-modal { padding: 16px; }
  .review-modal-box { padding: 28px 22px; }
  .review-modal-box h3 { font-size: 22px; }
}