/* ════════════════════════════════════════════════════════════
   Fábrica de Currículums — Centro de Reseñas (v03.2)
   Diseño visual premium, ultra optimizado para Móvil, Tablet y Desktop
   (1 col móvil · 2 col tablet · 3 col portátil · 4 col desktop)
   ════════════════════════════════════════════════════════════ */

:root {
  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.96);
  --border-color: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --brand-navy: #0f172a;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-blue-subtle: #eff6ff;
  --brand-gold: #f59e0b;
  
  --success: #10b981;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 12px 20px -3px rgba(37, 99, 235, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ══════════════ CABECERA PRINCIPAL ══════════════ */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-name-link {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: var(--transition);
}

.brand-name-link:hover {
  color: var(--brand-blue);
}

/* Brand Badge — Indicador informativo (no sincroniza al hacer clic) */
.brand-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2px;
  background: var(--brand-blue-subtle);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: default;
  user-select: none;
  font-family: var(--font-body);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
}

.header-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: var(--brand-blue-subtle);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.header-cta-link:hover {
  background: var(--brand-blue);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* ══════════════ TOAST NOTIFICACIÓN DE ACTUALIZACIÓN ══════════════ */
.toast-notice {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 90vw;
  text-align: center;
}

.toast-notice.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast-notice.success {
  background: #065f46;
  border-color: #10b981;
}

/* ══════════════ CONTENIDO PRINCIPAL ══════════════ */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  width: 100%;
}

/* ══════════════ HERO & FICHA GOOGLE REVIEWS ══════════════ */
.dashboard-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

/* Google Profile Card */
.google-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.google-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.google-g-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.google-profile-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
}

.verified-badge {
  color: #1a73e8;
  display: inline-flex;
}

.google-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.google-rating-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.1rem 0 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.rating-number-big {
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
  font-family: var(--font-title);
}

.rating-stars-gold {
  color: var(--brand-gold);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.rating-count-pill {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  margin-left: auto;
}

.google-location-tag {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* KPI Summary Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.775rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.icon-blue { background: var(--brand-blue-subtle); color: var(--brand-blue); }
.icon-gold { background: rgba(245, 158, 11, 0.15); color: var(--brand-gold); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.icon-purple { background: rgba(147, 51, 234, 0.15); color: #9333ea; }

.kpi-value {
  font-size: 1.95rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 0.6rem 0 0.3rem;
  color: var(--text-primary);
  font-family: var(--font-title);
}

.kpi-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.35;
}

/* ══════════════ SECCIÓN CARRUSEL DESTACADO ══════════════ */
.slider-section {
  margin-bottom: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem 2rem;
  box-shadow: var(--shadow-md);
}

.section-header-row {
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title-group h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-title-group p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Contenedor Flanqueado con Flechas < y > a ambos lados */
.slider-container-flanked {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.slider-side-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--brand-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  font-family: 'Courier New', Courier, monospace, sans-serif;
  transition: var(--transition);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  user-select: none;
  z-index: 10;
  touch-action: manipulation;
}

.slider-side-btn:hover:not(:disabled) {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.slider-side-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.slider-side-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Viewport del Slider */
.slider-viewport {
  overflow: hidden;
  width: 100%;
  position: relative;
  border-radius: var(--radius-md);
}

.slider-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  gap: 1rem;
}

/* Slider cards: responsive widths */
.slider-card {
  flex: 0 0 calc(25% - 0.75rem); /* Desktop: 4 tarjetas */
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-height: 230px;
}

.slider-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

/* Responsive slider widths */
@media (max-width: 1300px) {
  .slider-card {
    flex: 0 0 calc(33.333% - 0.666rem); /* Portátil: 3 tarjetas */
  }
}

@media (max-width: 960px) {
  .slider-card {
    flex: 0 0 calc(50% - 0.5rem); /* Tablet: 2 tarjetas */
  }
}

@media (max-width: 600px) {
  .slider-card {
    flex: 0 0 100%; /* Móvil: 1 tarjeta */
  }
}

.slider-dots-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.slider-dot.active {
  width: 22px;
  background: var(--brand-blue);
}

/* ══════════════ CUADRÍCULA COMPLETA DE RESEÑAS ══════════════ */
.grid-section-header {
  margin-bottom: 1.75rem;
  text-align: center;
  padding: 0 0.5rem;
}

.grid-section-header h2 {
  font-family: var(--font-title);
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.grid-section-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0.4rem auto 0;
  font-weight: 500;
}

.grid-section-badge-info {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding: 0.3rem 0.85rem;
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Grid de Reseñas Responsive:
   >1300px: 4 columnas
   961px - 1300px: 3 columnas
   601px - 960px: 2 columnas
   <=600px: 1 columna
*/
.reviews-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

@media (max-width: 1300px) {
  .reviews-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 960px) {
  .reviews-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .reviews-grid-container {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta de Reseña Pública */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.review-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.card-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.author-meta-box {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.review-source-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2px;
}

.badge-nuevo {
  background: var(--brand-navy);
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  display: inline-block;
}

.review-stars-row {
  color: var(--brand-gold);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.review-body-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.85rem;
  word-break: break-word;
}

/* Cuadro de Respuesta Oficial del Propietario */
.owner-response-box {
  margin: 0.75rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border-left: 3px solid var(--brand-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-top: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.owner-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.owner-response-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.owner-response-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.owner-response-text {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-footer-service {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.service-pill-clean {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
}

.location-mini {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ══════════════ BOTÓN FLOTANTE SCROLL TO TOP ══════════════ */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--brand-blue);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              bottom 0.25s ease-out;
  z-index: 999;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--brand-blue-hover);
  transform: translateY(-3px) scale(1.05);
}

/* ══════════════ PIE DE PÁGINA ══════════════ */
.main-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 2rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-brand img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--brand-blue);
}

/* ══════════════ AJUSTES ESPECÍFICOS PARA TABLETS Y MÓVILES ══════════════ */
@media (max-width: 960px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 1.25rem 1rem 3rem;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 0.75rem 0.85rem;
  }
  .brand-wrapper {
    gap: 0.65rem;
  }
  .brand-logo-img {
    width: 38px;
    height: 38px;
  }
  .brand-name-link {
    font-size: 1.1rem;
  }
  .brand-badge {
    font-size: 0.675rem;
    padding: 1px 6px;
  }
  .header-cta-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
  .header-cta-link .cta-text-full {
    display: none;
  }
  .header-cta-link .cta-text-short {
    display: inline;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .slider-section {
    padding: 1.25rem 0.85rem 1.5rem;
  }
  .slider-container-flanked {
    gap: 0.4rem;
  }
  .slider-side-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 1rem;
  }
  .footer-brand {
    justify-content: center;
  }
  .footer-links {
    justify-content: center;
    gap: 0.85rem;
  }
}

@media (min-width: 601px) {
  .header-cta-link .cta-text-short {
    display: none;
  }
}
