/* ==========================================================================
   Vinklou — Estilos del perfil público (portado de perfiles/plantilla-base)
   Un solo archivo para todos los perfiles. Lo que cambia por cliente
   (colores, tipografía, portada, filtros por etiqueta) lo inyecta el
   template perfil.php en un <style> propio de cada perfil, con los valores
   cargados en ProcessWire. Este archivo no se edita por cliente.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) VARIABLES DE MARCA — valores por defecto (perfil.php los pisa por perfil)
   -------------------------------------------------------------------------- */
:root {
  --brand-primary: #1a5f7a;
  --brand-primary-rgb: 26, 95, 122; /* mismo color que --brand-primary, en RGB */
  --brand-primary-dark: #123f52;
  --brand-secondary: #c99a3b;
  --brand-secondary-hover: #b38731;
  --brand-font-heading: "Poppins", sans-serif;
  --brand-font-body: "Inter", sans-serif;
  --brand-radius: 0.75rem;
}

/* --------------------------------------------------------------------------
   Tipografía base
   -------------------------------------------------------------------------- */
body {
  font-family: var(--brand-font-body);
  color: #2b2b2b;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.hero-name {
  font-family: var(--brand-font-heading);
}

/* --------------------------------------------------------------------------
   Re-tematizado de componentes de Bootstrap con el color de marca.
   Bootstrap 5.3 define el color de cada componente con variables propias
   (--bs-btn-bg, etc.), no heredan solas de --bs-primary global, así que se
   pisan acá de forma explícita.
   -------------------------------------------------------------------------- */
.btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary-dark);
  --bs-btn-hover-border-color: var(--brand-primary-dark);
  --bs-btn-active-bg: var(--brand-primary-dark);
  --bs-btn-active-border-color: var(--brand-primary-dark);
  --bs-btn-disabled-bg: var(--brand-primary);
  --bs-btn-disabled-border-color: var(--brand-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
  --bs-btn-active-bg: var(--brand-primary);
  --bs-btn-active-border-color: var(--brand-primary);
}

.btn-secondary {
  --bs-btn-bg: var(--brand-secondary);
  --bs-btn-border-color: var(--brand-secondary);
  --bs-btn-color: #2b2b2b;
  --bs-btn-hover-bg: var(--brand-secondary-hover);
  --bs-btn-hover-color: #2b2b2b;
}

.text-primary { color: var(--brand-primary) !important; }
.bg-primary   { background-color: var(--brand-primary) !important; }
.text-brand-secondary { color: var(--brand-secondary) !important; }

a { color: var(--brand-primary); }
a:hover { color: var(--brand-primary-dark); }

.rounded-brand { border-radius: var(--brand-radius) !important; }

/* --------------------------------------------------------------------------
   Anclas de sección — que no queden tapadas por el navbar sticky
   -------------------------------------------------------------------------- */
section[id] {
  scroll-margin-top: 84px;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar-profile {
  background-color: #ffffff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.navbar-profile .nav-link {
  font-weight: 500;
  color: #444;
}

.navbar-profile .nav-link.active,
.navbar-profile .nav-link:hover {
  color: var(--brand-primary);
}

.navbar-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--brand-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Hero / top header
   La foto de portada la inyecta perfil.php como background-image.
   -------------------------------------------------------------------------- */
.profile-cover {
  background-color: var(--brand-primary-dark);
  background-size: cover;
  background-position: center;
  min-height: 220px;
  position: relative;
}

@media (min-width: 768px) {
  .profile-cover {
    min-height: 300px;
  }
}

/* Franja debajo de la portada donde viven el avatar, el nombre y las redes.
   Fondo propio a todo el ancho (se declara fuera del .container en el
   HTML) para que no quede como un bloque de texto flotando en blanco. */
.profile-info-band {
  background-color: rgba(var(--brand-primary-rgb), 0.06);
}

/* Avatar: <img> con el logo del cliente, o un <div> con las iniciales si
   todavía no hay logo (perfil.php elige cuál). */
.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid #fff;
  background-color: var(--brand-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--brand-font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  margin-top: -60px;
  /* .profile-cover es position:relative, así que Chrome la pinta por
     encima de cualquier elemento estático que se le superponga, aunque
     venga después en el HTML (como este avatar). position:relative +
     z-index acá aseguran que el avatar quede arriba, en vez de tapado
     por la portada, en el tramo donde se solapan. */
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .profile-avatar {
    width: 190px;
    height: 190px;
    font-size: 3.25rem;
    margin-top: -75px;
  }
}

.hero-name {
  font-weight: 700;
}

/* Redes sociales junto al nombre, en el espacio que antes quedaba vacío a
   la derecha en pantallas anchas. */
.profile-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.social-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
  background-color: #fff;
  color: var(--brand-primary);
  font-size: 1.15rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.social-icon-btn:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* Código QR con la vCard del cliente, arriba de .profile-social. */
.profile-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.profile-qr-img {
  width: 96px;
  height: 96px;
  padding: 6px;
  background-color: #fff;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
  border-radius: var(--brand-radius);
}

.profile-qr-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-align: center;
  max-width: 110px;
}

/* Enlaces adicionales (sitio propio, tienda online, LinkedIn, portfolio,
   etc.), debajo de los CTA principales. A diferencia de .profile-social
   (íconos de redes conocidas), cada chip lleva texto porque el destino no
   es obvio solo con un ícono. */
.profile-extra-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.extra-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--brand-radius);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.25);
  background-color: #fff;
  color: var(--brand-primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.extra-link-chip:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Galería: grilla de miniaturas + vista previa en modal
   Las fotos salen del campo "galeria" de cada perfil (hasta 24). Miniaturas
   cuadradas de tamaño fijo y centradas; la foto entera, en su proporción,
   se ve en el modal.
   -------------------------------------------------------------------------- */
.profile-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 576px) {
  .profile-gallery {
    grid-template-columns: repeat(auto-fit, 140px);
    justify-content: center;
    gap: 0.75rem;
  }
}

.profile-gallery-thumb {
  position: relative;
  padding: 0;
  border: 0;
  background: #e9ecef;
  border-radius: var(--brand-radius);
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.profile-gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.profile-gallery-zoom {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  background: rgba(var(--brand-primary-rgb), 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-gallery-thumb:hover,
.profile-gallery-thumb:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.profile-gallery-thumb:hover .profile-gallery-zoom,
.profile-gallery-thumb:focus-visible .profile-gallery-zoom {
  opacity: 1;
}

.profile-gallery-thumb:focus-visible {
  outline: 3px solid var(--brand-secondary);
  outline-offset: 2px;
}

/* Modal de vista previa */
/* El modal toma el ancho de la foto: una vertical queda en una tarjeta angosta, sin bandas negras */
.gallery-modal .modal-dialog {
  width: fit-content;
  max-width: min(960px, calc(100vw - 1.5rem));
  margin-left: auto;
  margin-right: auto;
}

.gallery-modal .modal-content {
  min-width: min(360px, calc(100vw - 1.5rem));
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.gallery-modal-stage {
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.gallery-modal-stage img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 640px);
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.gallery-modal-stage img.cargando {
  opacity: 0;
}

.gallery-modal-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #212529;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-modal-btn:hover {
  background: #fff;
  transform: scale(1.06);
}

.gallery-modal-close {
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
}

.gallery-modal-prev,
.gallery-modal-next {
  top: 50%;
  margin-top: -1.25rem;
}

.gallery-modal-prev { left: 0.75rem; }
.gallery-modal-next { right: 0.75rem; }

.gallery-modal-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem 0.5rem;
}

.gallery-modal-caption {
  margin: 0;
  font-weight: 500;
}

.gallery-modal-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: #6c757d;
  white-space: nowrap;
}

.gallery-modal-strip {
  display: flex;
  gap: 0.5rem;
  justify-content: safe center;
  overflow-x: auto;
  padding: 0.5rem 1.25rem 1rem;
  scrollbar-width: thin;
}

.gallery-modal-strip button {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  opacity: 0.5;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: opacity 0.2s ease, outline-color 0.2s ease;
}

.gallery-modal-strip button:hover { opacity: 0.85; }

.gallery-modal-strip button.active {
  opacity: 1;
  outline-color: var(--brand-primary);
}

.gallery-modal-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 575.98px) {
  .gallery-modal-stage img { max-height: 62vh; }
  .gallery-modal-btn { width: 2.25rem; height: 2.25rem; }
  .gallery-modal-prev,
  .gallery-modal-next { margin-top: -1.125rem; }
}

.hero-tagline {
  color: #555;
}

/* --------------------------------------------------------------------------
   Badges de estado: verificación y nivel de perfil.
   No son parte de los 3 ejes de personalización por cliente (color/tipo-
   grafía, imágenes, contenido) — colores fijos e iguales en toda la
   plataforma, para que funcionen como señal reconocible sin importar la
   marca del cliente. Qué estado mostrar se elige en index.html alternando
   la clase modificadora (is-verified/is-unverified, is-premium/is-standard).
   -------------------------------------------------------------------------- */
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.profile-badge .bi {
  font-size: 0.9rem;
}

.profile-badge-verified.is-verified {
  background-color: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.profile-badge-verified.is-unverified {
  background-color: rgba(108, 117, 125, 0.12);
  color: #6c757d;
}

.profile-badge-tier.is-premium {
  background: linear-gradient(135deg, #d4af37, #a1791f);
  color: #fff;
}

.profile-badge-tier.is-standard {
  background-color: #f1f1f1;
  border: 1px solid #ddd;
  color: #666;
}

/* --------------------------------------------------------------------------
   Cards genéricas: servicios, destacados, novedades
   -------------------------------------------------------------------------- */
.profile-card {
  border: 1px solid #eee;
  border-radius: var(--brand-radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* Tarjeta del formulario de contacto: mismo estilo visual que .profile-card,
   pero SIN height: 100%. Ese card vive solo (no en una grilla de columnas
   parejas), y darle height:100% dentro de una .row con un solo <div>/<form>
   hace que el navegador calcule la altura de la columna a partir del alto
   del propio form, ignorando el texto que va arriba (kicker + título) — el
   form termina "flotando" más abajo de lo que la columna reserva y se
   solapa con el footer siguiente. */
.contact-form-card {
  border: 1px solid #eee;
  border-radius: var(--brand-radius);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* --------------------------------------------------------------------------
   Filtro de Servicios por etiqueta — CSS puro, sin JS propio.
   Mecanismo: un <input type="radio" class="btn-check"> oculto por opción
   (patrón "toggle buttons" de Bootstrap, ya themeado arriba vía
   --bs-btn-active-bg en .btn-outline-primary) + :has() para mostrar u
   ocultar las cards de .service-filter-wrapper según cuál esté marcado.
   Soportado en todos los navegadores modernos (Safari 15.4+, Chrome 105+,
   Firefox 121+). Las reglas por etiqueta las genera perfil.php a partir de
   las etiquetas cargadas en cada perfil.
   -------------------------------------------------------------------------- */
.service-tag {
  background-color: rgba(var(--brand-primary-rgb), 0.08);
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.75rem;
}

.service-card-cta {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
  color: var(--brand-primary);
}

.service-card-cta:hover {
  color: var(--brand-primary-dark);
}

/* --------------------------------------------------------------------------
   Filtro de Portafolio por etiqueta — mismo mecanismo CSS puro que el
   filtro de Servicios de arriba (radio .btn-check + :has()). Las reglas por
   etiqueta las genera perfil.php.
   -------------------------------------------------------------------------- */
.portfolio-tag {
  background-color: rgba(var(--brand-primary-rgb), 0.08);
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.75rem;
}

/* La card de Portafolio no lleva el p-3 que usan Servicios/Destacados/
   Novedades: la imagen tiene que llegar a los cuatro bordes (por eso
   .overflow-hidden junto a .profile-card en el HTML). El padding del texto
   vive solo en .card-body. */
.portfolio-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.portfolio-card-cta {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
  color: var(--brand-primary);
}

.portfolio-card-cta:hover {
  color: var(--brand-primary-dark);
}

.portfolio-modal-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--brand-radius);
}

.testimonial-stars {
  color: var(--brand-secondary);
  font-size: 0.9rem;
}

.news-date {
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Canales de contacto
   -------------------------------------------------------------------------- */
.contact-channel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #eee;
  border-radius: var(--brand-radius);
  color: #2b2b2b;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.contact-channel:hover {
  border-color: var(--brand-primary);
  background-color: rgba(var(--brand-primary-rgb), 0.05);
  color: #2b2b2b;
}

.contact-channel .bi {
  font-size: 1.4rem;
  color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.profile-footer {
  background-color: var(--brand-primary-dark);
  color: #eef3f5;
}

.profile-footer a {
  color: #eef3f5;
}

.profile-footer a:hover {
  color: var(--brand-secondary);
}

.footer-credit {
  color: #b7c6cc;
  font-size: 0.8rem;
}

/* Section title helper */
.section-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-kicker {
  color: var(--brand-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

/* ============================== CAMPAÑAS Y EVENTOS (dec-0036) ============================== */
/* Enlaces del perfil a sus landings de campaña en línea. */

.profile-campanas {
  background-color: rgba(var(--brand-primary-rgb), 0.04);
}

.campana-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.15);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.campana-card:hover {
  color: inherit;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), 0.15);
}

.campana-card-img {
  aspect-ratio: 2 / 1;
  background-size: cover;
  background-color: var(--brand-primary-dark);
}

.campana-card-sin-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 2.5rem;
}

.campana-card-cuerpo {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.4rem 1.4rem;
}

.campana-card-cuerpo h3 {
  font-family: var(--brand-font-heading);
  font-weight: 700;
}

.campana-card-fecha {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background-color: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.campana-card-ver {
  margin-top: auto;
  color: var(--brand-primary);
  font-weight: 600;
}

/* Una sola campaña: imagen al costado en pantallas anchas */
@media (min-width: 768px) {
  .campana-card-ancha {
    flex-direction: row;
  }
  .campana-card-ancha .campana-card-img {
    flex: 0 0 42%;
    aspect-ratio: auto;
    min-height: 240px;
  }
  .campana-card-ancha .campana-card-cuerpo {
    justify-content: center;
    padding: 2rem 2.25rem;
  }
}
