/* ==========================================================================
   LB & CO Global Advisors — adaptaciones sobre clinica-premium-inspirada.css
   Importar DESPUÉS de la hoja base:
   <link rel="stylesheet" href="/assets/css/clinica-premium.css">
   <link rel="stylesheet" href="/assets/css/lb-co.css">
   ========================================================================== */

/* ---- Overrides de variables ---- */
:root {
  --color-primary: #8b6a3a;
  --color-primary-dark: #4c362d;
  --color-secondary: #b88a64;
  --color-accent: #c8a15a;
  --color-gold: #c8a15a;
  --container: 1180px;
}

/* ---- Logo LB&CO ---- */
.logo-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--color-primary-dark);
  color: var(--color-primary-dark);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}

.logo-name {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-primary-dark);
  text-transform: uppercase;
}

.logo-tagline {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* ---- Nav lang switcher ---- */
.lang-switcher {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.3rem 0.7rem;
  border: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-soft);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

.lang-btn.active,
.lang-btn:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* ---- Hero overrides para imagen lado derecho ---- */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  background: var(--color-bg-soft);
  overflow: hidden;
}

.hero-split-content {
  padding: clamp(3rem, 7vw, 7rem) clamp(1.5rem, 4vw, 4rem);
}

.hero-split-media {
  position: relative;
  height: 100%;
  min-height: 560px;
}

.hero-split-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Overlay degradado en la foto */
.hero-split-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-bg-soft) 0%, transparent 18%);
  pointer-events: none;
}

.hero-split .hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 3.8vw, 5rem);
  font-weight: 600;
  line-height: 1.03;
  color: var(--color-primary-dark);
  text-transform: none;
  letter-spacing: 0.01em;
}

.hero-split .hero-text {
  color: var(--color-text-soft);
}

.hero-split .hero-actions {
  margin-top: 1.75rem;
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ---- Services section ---- */
.services-section {
  background: var(--color-bg-soft);
}

.service-card-lb {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.service-card-lb:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.service-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-muted);
  color: var(--color-primary);
  flex-shrink: 0;
}

.service-icon-wrap svg {
  width: 26px;
  height: 26px;
  stroke: var(--color-primary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.service-card-text {
  color: var(--color-text-soft);
  font-size: var(--text-sm);
  line-height: 1.7;
  flex: 1;
}

/* ---- Blog / insights ---- */
.blog-lb {
  background: var(--color-bg);
}

.blog-grid-lb {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}

.post-card-lb {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.post-card-lb .post-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.post-date {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.post-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary-dark);
  margin-bottom: 0.6rem;
}

.post-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  line-height: 1.65;
  margin-bottom: 0.9rem;
}

/* ---- CTA / footer contact ---- */
.cta-section {
  background: var(--color-bg-muted);
  border-top: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -4rem;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 161, 90, 0.12), transparent 70%);
  pointer-events: none;
}

.cta-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 3rem;
}

.cta-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cta-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}

.cta-contact-icon {
  width: 18px;
  height: 18px;
  stroke: var(--color-primary);
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

/* ---- Footer ---- */
.site-footer-lb {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 1.25rem 0;
}

.footer-bottom-lb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.footer-badge svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 2;
}

.footer-multilingual {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.75rem;
}

/* ---- Chat widget (estático) ---- */
.chat-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 2000;
  width: min(320px, calc(100% - 3rem));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chat-widget[hidden],
.chat-launcher[hidden] {
  display: none;
}

.chat-launcher {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 2000;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-accent));
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.chat-launcher-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-bg-muted);
  object-fit: cover;
}

.chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.chat-agent {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chat-agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-muted);
  object-fit: cover;
  border: 2px solid var(--color-accent);
}

.chat-agent-name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-primary-dark);
}

.chat-agent-status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #496b55;
}

.chat-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}

.chat-widget-body {
  padding: 1rem;
}

.chat-bubble {
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* ---- Responsive overrides ---- */
@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
  }

  .hero-split-media {
    min-height: 340px;
  }

  .hero-split-media::after {
    background: linear-gradient(0deg, var(--color-bg-soft) 0%, transparent 20%);
  }

  .blog-grid-lb {
    grid-template-columns: 1fr;
  }

  .post-card-lb {
    grid-template-columns: 180px 1fr;
  }

  .cta-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 680px) {
  .chat-launcher {
    width: 64px;
    height: 64px;
  }

  .post-card-lb {
    grid-template-columns: 1fr;
  }

  .footer-bottom-lb {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Chat widget — message list, input, message roles, typing ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem 0.1rem 0.75rem;
  margin-bottom: 0.75rem;
}

.chat-msg {
  display: flex;
  width: 100%;
}

.chat-msg--user {
  justify-content: flex-end;
}

.chat-msg--assistant {
  justify-content: flex-start;
}

.chat-msg-bubble {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg-soft);
  margin: 0;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-msg--user .chat-msg-bubble {
  background: var(--color-primary-dark);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
}

.chat-msg--assistant .chat-msg-bubble {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.chat-msg-warning {
  margin: 0.35rem 0 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-primary-dark);
  background: rgba(200, 161, 90, 0.15);
  border: 1px solid rgba(200, 161, 90, 0.4);
  border-radius: var(--radius-pill);
  display: inline-block;
  align-self: flex-start;
  max-width: 85%;
}

.chat-msg--user .chat-msg-warning {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

.chat-input {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  border-top: 1px solid var(--color-border);
  padding: 0.5rem 0 0.25rem;
  margin-top: 0.25rem;
}

.chat-input-field {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color var(--speed-fast) var(--ease);
}

.chat-input-field:focus {
  border-color: var(--color-accent);
}

.chat-input-field:read-only {
  opacity: 0.6;
}

.chat-input-send {
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-white);
  background: var(--color-primary-dark);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--speed-fast) var(--ease), opacity var(--speed-fast) var(--ease);
}

.chat-input-send:hover:not(:disabled) {
  background: var(--color-primary);
}

.chat-input-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-footer {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.chat-handoff {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
}

.chat-handoff:hover {
  color: var(--color-primary-dark);
}

.chat-typing {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--color-text-muted);
}

.chat-typing::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: chat-typing-dots 1.2s steps(4, end) infinite;
}

@keyframes chat-typing-dots {
  0%, 20% { content: ""; }
  40% { content: "."; }
  60% { content: ".."; }
  80%, 100% { content: "..."; }
}

.chat-error {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  color: #5a1f1f;
  background: rgba(170, 50, 50, 0.08);
  border: 1px solid rgba(170, 50, 50, 0.25);
  border-radius: var(--radius-sm);
}
