/* ══════════════════════════════════════════════════════════
   BARTOLYTO TOURS — Estilos del sistema de reseñas
   ══════════════════════════════════════════════════════════ */

/* ── Botón de auth en navbar ────────────────────────────── */
.bt-auth-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.bt-auth-nombre {
  color: var(--verde-oscuro);
  font-weight: 500;
}
.bt-auth-cuenta {
  color: var(--verde-oscuro);
  font-weight: 500;
  transition: color 0.2s;
}
.bt-auth-cuenta:hover { color: var(--verde); }
.bt-auth-sep { color: #d1d5db; }
.bt-auth-salir {
  color: var(--gris);
  cursor: pointer;
  font-size: 0.85rem;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}
.bt-auth-salir:hover { color: #dc2626; }
.bt-auth-login {
  background: transparent;
  border: 1.5px solid var(--verde);
  color: var(--verde);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.bt-auth-login:hover {
  background: var(--verde);
  color: white;
}

/* ── Bloque de reseñas al tope (por filtro activo) ─────── */
.bt-resenas-top {
  background: var(--crema);
  border-radius: var(--radio);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--dorado);
  animation: btFadeIn 0.25s ease;
}
@keyframes btFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bt-resenas-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #e5e7eb;
}
.bt-resenas-top-header h3 {
  font-size: 1.1rem;
  color: var(--verde-oscuro);
  margin: 0;
}
.bt-resenas-top .resenas-lista { max-height: 420px; overflow-y: auto; }
.bt-resenas-top .resena-item-tour-badge {
  font-size: 0.75rem;
  color: var(--verde);
  font-weight: 600;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── Rating de usuarios en header de hotel / agencia (derecha) ── */
.bt-hotel-rating {
  flex-shrink: 0;
  text-align: center;
  padding: 0.6rem 1rem;
  background: white;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  min-width: 130px;
}
/* Estrellas + nº de reseñas dentro del badge */
.bt-rating-stars { font-size: 1.05rem; }
.bt-rating-count { font-size: 0.74rem; color: var(--gris); margin-top: 4px; }
.bt-rating-count strong { color: var(--verde-oscuro); font-size: 0.85rem; }

/* ── Estrellas fraccionarias (solo lectura, soportan medias/decimales) ── */
.star-bar {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 2px;
}
.star-bar-bg { color: #d1d5db; }
.star-bar-fill {
  position: absolute;
  top: 0; left: 0;
  width: 0;
  overflow: hidden;
  color: var(--dorado);
}

/* ── Selector interactivo con medias estrellas ── */
.star-input { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.star-input-bar {
  position: relative;
  display: inline-block;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  font-size: 1.8rem;
  letter-spacing: 3px;
  user-select: none;
}
.star-input-bg { color: #d1d5db; }
.star-input-fill {
  position: absolute;
  top: 0; left: 0;
  width: 0;
  overflow: hidden;
  color: var(--dorado);
  pointer-events: none;
}
.star-input-val { font-size: 0.85rem; color: var(--gris); min-width: 64px; }
.bt-hotel-rating-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--verde-oscuro);
  line-height: 1;
  font-family: 'Playfair Display', serif;
}
.bt-hotel-rating-stars {
  font-size: 0.9rem;
  color: var(--dorado);
  margin: 3px 0 2px;
  letter-spacing: 1px;
}
.bt-hotel-rating-label {
  font-size: 0.72rem;
  color: var(--gris);
  line-height: 1.2;
}

/* ── Toggle de reseñas en cards de tours ────────────────── */
.resenas-toggle {
  margin-top: 0.8rem;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.8rem;
}
.resenas-toggle > summary {
  cursor: pointer;
  color: var(--dorado);
  font-size: 0.88rem;
  font-weight: 500;
  list-style: none;
  user-select: none;
}
.resenas-toggle > summary::-webkit-details-marker { display: none; }
.resenas-toggle > summary::before {
  content: '⭐ ';
}
.resenas-toggle[open] > summary { color: var(--dorado-claro); }

/* ── Panel de reseñas en hoteles ────────────────────────── */
.hotel-resenas-seccion {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--crema);
  border-radius: var(--radio);
}
.hotel-resenas-seccion h4 {
  font-size: 1.1rem;
  color: var(--verde-oscuro);
  margin-bottom: 1rem;
}

/* ── Panel interno de reseñas ───────────────────────────── */
.resenas-panel {
  margin-top: 0.8rem;
}
.resenas-loading {
  text-align: center;
  color: var(--gris);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

/* Resumen de estrellas */
.resenas-resumen {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: white;
  border-radius: 8px;
}
.resenas-promedio-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--verde-oscuro);
  line-height: 1;
}
.resenas-promedio-stars { font-size: 1.1rem; line-height: 1; }
.resenas-total-txt { color: var(--gris); font-size: 0.82rem; }

/* Formulario de nueva reseña */
.resena-form {
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.resena-form-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--verde-oscuro);
  margin-bottom: 0.8rem;
}

/* Selector de estrellas interactivo */
.star-selector {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 2px;
  margin-bottom: 0.8rem;
}
.star-selector input { display: none; }
.star-selector label {
  font-size: 1.6rem;
  cursor: pointer;
  color: #d1d5db;
  transition: color 0.15s;
  line-height: 1;
}
.star-selector label:hover,
.star-selector label:hover ~ label,
.star-selector input:checked ~ label {
  color: var(--dorado);
}

.resena-nombre {
  width: 100%;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.6rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.resena-nombre:focus { border-color: var(--verde); }

.resena-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color 0.2s;
}
.resena-textarea:focus { border-color: var(--verde); }

.btn-resena-submit {
  margin-top: 0.6rem;
  padding: 0.55rem 1.2rem;
  background: var(--verde);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-resena-submit:hover { background: var(--verde-oscuro); }
.btn-resena-submit:disabled { background: #9ca3af; cursor: not-allowed; }

.resena-form-msg {
  font-size: 0.82rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  display: none;
}
.resena-form-msg.error { background: #fef2f2; color: #dc2626; }
.resena-form-msg.ok    { background: #f0fdf4; color: #15803d; }

/* Prompt de login */
.resena-login-prompt {
  text-align: center;
  padding: 0.8rem;
  background: white;
  border-radius: 8px;
  border: 1.5px dashed #d1d5db;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--gris);
}
.resena-login-prompt a {
  color: var(--verde);
  font-weight: 500;
}
.resena-login-prompt a:hover { color: var(--verde-oscuro); }

/* Ya dejó reseña */
.resena-ya-reseno {
  text-align: center;
  padding: 0.6rem;
  background: #f0fdf4;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #15803d;
  margin-bottom: 0.8rem;
}

/* Aviso cuando NO se puede reseñar (sin sesión, sin reserva pagada
   o la fecha de la reserva aún no se ha cumplido) */
.resena-aviso {
  text-align: center;
  padding: 0.7rem 0.9rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}
.resena-aviso a { color: #b45309; font-weight: 600; text-decoration: underline; }

/* Lista de reseñas */
.resenas-lista { display: flex; flex-direction: column; gap: 0.7rem; }
.resena-item {
  background: white;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  border: 1px solid #f3f4f6;
}
.resena-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.resena-autor { font-weight: 600; font-size: 0.88rem; color: var(--texto); }
.resena-fecha { font-size: 0.78rem; color: var(--gris); }
.resena-estrellas { font-size: 0.95rem; margin-bottom: 0.3rem; }
.resena-comentario { font-size: 0.88rem; color: #374151; line-height: 1.4; }
.resenas-vacio {
  text-align: center;
  color: var(--gris);
  font-size: 0.85rem;
  padding: 0.5rem;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — reseñas en móvil/tablet
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Cabeceras de hotel / agencia: el badge de rating baja a su propia línea
     en vez de apretar el logo y el texto (los headers usan display:flex). */
  .hotel-seccion > div:first-child,
  .tour-agencia  > div:first-child { flex-wrap: wrap; }
  .bt-hotel-rating {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* Bloque de reseñas por filtro: padding compacto y sin scroll interno
     (mejor scroll de página en móvil). */
  .bt-resenas-top { padding: 1.1rem; }
  .bt-resenas-top .resenas-lista { max-height: none; overflow-y: visible; }
  .bt-resenas-top-header h3 { font-size: 1rem; }

  /* Resumen de promedio: que envuelva y no se desborde */
  .resenas-resumen { flex-wrap: wrap; gap: 0.5rem 0.8rem; padding: 0.7rem 0.9rem; }
  .resenas-promedio-num { font-size: 1.7rem; }

  /* Cada reseña: autor y fecha pueden ir en líneas distintas */
  .resena-item-header { flex-wrap: wrap; gap: 0.15rem 0.6rem; }

  /* Estrellas un poco más grandes para el dedo */
  .star-input-bar { font-size: 2rem; }
  .star-selector label { font-size: 1.9rem; }

  /* Login en el menú móvil a ancho completo */
  .navbar-links .bt-auth-nav { width: 100%; justify-content: center; }
  .navbar-links .bt-auth-login { display: block; width: 100%; text-align: center; padding: 11px; }
}
