/* ============================================================
   Clínica Veracruz — Custom Styles
   Art Deco Geométrico | Fresco & Juvenil | Azul & Verde
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --primary-50: #eff8ff;
  --primary-100: #dbeeff;
  --primary-300: #84c5fe;
  --primary-500: #1a82f7;
  --primary-600: #0b62ec;
  --primary-700: #0a4ed9;
  --primary-800: #0f3fb1;
  --primary-900: #12388b;
  --primary-950: #0d2255;

  --accent-300: #6ee7b7;
  --accent-400: #34d399;
  --accent-500: #10b981;
  --accent-600: #059669;
  --accent-700: #047857;

  --gold: #c9a84c;
  --gold-light: #e4c87c;

  --font-heading: 'Lora', serif;
  --font-body: 'Rubik', sans-serif;

  --shadow-md: 0 4px 20px rgba(13, 34, 85, 0.12);
  --shadow-lg: 0 8px 40px rgba(13, 34, 85, 0.18);
  --shadow-xl: 0 16px 60px rgba(13, 34, 85, 0.24);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ── Header Styles ── */
#header {
  background: transparent;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(13, 34, 85, 0.1);
}

#header.scrolled .nav-link {
  color: var(--primary-800) !important;
}
#header.scrolled .nav-link:hover {
  color: var(--accent-600) !important;
}

.btn-cta-nav {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  color: white;
  font-family: var(--font-body);
}
.btn-cta-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(11, 98, 236, 0.4);
}

/* ── Hero Section ── */
.hero-section {
  position: relative;
}

.hero-bg {
  background: var(--primary-950);
}

.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(13, 34, 85, 0.85) 0%,
    rgba(5, 150, 105, 0.4) 50%,
    rgba(13, 34, 85, 0.9) 100%
  );
}

.hero-geo-pattern {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(201, 168, 76, 0.3) 40px,
      rgba(201, 168, 76, 0.3) 41px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(201, 168, 76, 0.15) 40px,
      rgba(201, 168, 76, 0.15) 41px
    );
}

/* Art Deco Frame */
.deco-frame {
  border: 1px solid rgba(201, 168, 76, 0.4);
  position: absolute;
}
.deco-frame::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 168, 76, 0.2);
}
.deco-frame::after {
  content: '';
  position: absolute;
  top: -3px; left: -3px; right: -3px; bottom: -3px;
  border: 1px solid rgba(201, 168, 76, 0.15);
}

/* Hero decorative elements */
.deco-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.deco-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.text-gradient-hero {
  background: linear-gradient(135deg, var(--accent-300), var(--accent-500), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero Buttons */
.btn-hero-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  color: white;
  font-family: var(--font-body);
  box-shadow: 0 0 40px rgba(11, 98, 236, 0.5), 0 4px 20px rgba(5, 150, 105, 0.3);
}
.btn-hero-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 60px rgba(11, 98, 236, 0.7), 0 8px 30px rgba(5, 150, 105, 0.4);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-family: var(--font-body);
  backdrop-filter: blur(10px);
}
.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Stat cards */
.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

/* ── Reveal Animations ── */
.reveal-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Section Helpers ── */
.section-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-50), var(--accent-50, #ecfdf5));
  color: var(--accent-600);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-family: var(--font-body);
}

.section-tag-light {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-300);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(110, 231, 183, 0.3);
  font-family: var(--font-body);
}

.deco-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
  border-radius: 2px;
  position: relative;
}
.deco-divider::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateX(-50%) translateY(-1px);
}

.deco-divider-light {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-400), var(--gold-light));
  border-radius: 2px;
}

/* ── Background Patterns ── */
.deco-bg-pattern {
  background-image:
    linear-gradient(30deg, var(--primary-900) 12%, transparent 12.5%, transparent 87%, var(--primary-900) 87.5%, var(--primary-900)),
    linear-gradient(150deg, var(--primary-900) 12%, transparent 12.5%, transparent 87%, var(--primary-900) 87.5%, var(--primary-900)),
    linear-gradient(30deg, var(--primary-900) 12%, transparent 12.5%, transparent 87%, var(--primary-900) 87.5%, var(--primary-900)),
    linear-gradient(150deg, var(--primary-900) 12%, transparent 12.5%, transparent 87%, var(--primary-900) 87.5%, var(--primary-900));
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}

.deco-bg-dark {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,0.03) 2px,
      rgba(255,255,255,0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,0.03) 2px,
      rgba(255,255,255,0.03) 4px
    );
  background-size: 40px 40px;
}

/* Geo accents */
.geo-accent-1 {
  background: radial-gradient(circle, var(--primary-600) 0%, transparent 70%);
  border-radius: 50%;
}
.geo-accent-2 {
  background: radial-gradient(circle, var(--accent-500) 0%, transparent 70%);
  border-radius: 50%;
}

/* ── Services ── */
.service-card {
  background: white;
  border: 1px solid rgba(13, 34, 85, 0.07);
  border-radius: 20px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(16, 185, 129, 0.2);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon-wrap {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-50), rgba(236, 253, 245, 0.8));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 185, 129, 0.15);
  transition: all 0.3s ease;
}

.service-card:hover .service-icon-wrap {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  border-color: transparent;
}

.service-icon {
  width: 32px;
  height: 32px;
  color: var(--primary-600);
  transition: color 0.3s ease;
}

.service-card:hover .service-icon {
  color: white;
}

.service-accent {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.service-card:hover .service-accent {
  width: 80px;
}

/* ── About Section ── */
.about-image-grid {
  display: grid;
  grid-template-columns: 1fr 0.6fr;
  grid-template-rows: 1fr 0.5fr;
  gap: 12px;
  height: 500px;
}

.about-img-main {
  grid-row: span 2;
  height: 100%;
}

.about-img-secondary {
  grid-column: 2;
}

.about-badge {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.value-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
}

/* ── Team Cards ── */
.team-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(13, 34, 85, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.team-img-wrap {
  height: 280px;
  overflow: hidden;
  background: var(--primary-100);
}

.team-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.team-card:hover .team-img-wrap img {
  transform: scale(1.05);
}

.team-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-500);
  color: white;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.team-social-btn:hover {
  background: var(--accent-700);
  transform: translateY(-2px);
}

.specialty-tag {
  background: linear-gradient(135deg, var(--primary-50), rgba(236, 253, 245, 0.8));
  color: var(--primary-700);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1px solid rgba(11, 98, 236, 0.15);
  font-family: var(--font-body);
}

/* ── Testimonials ── */
.testimonial-card {
  background: white;
  border: 1px solid rgba(13, 34, 85, 0.07);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 24px;
  font-family: var(--font-heading);
  font-size: 5rem;
  line-height: 1;
  color: var(--accent-200, #a7f3d0);
  opacity: 0.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.text-gold { color: var(--gold); }

.testimonial-highlight-card {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.testimonial-highlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(255,255,255,0.04) 20px,
      rgba(255,255,255,0.04) 21px
    );
}

/* ── Gallery ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 250px);
  gap: 12px;
}

.gallery-grid .gallery-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13, 34, 85, 0.7), rgba(5, 150, 105, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-case-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
  }
  .gallery-grid .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
    height: 200px;
  }
  .gallery-item {
    height: 160px;
  }
}

/* ── Lightbox ── */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-family: var(--font-body);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1001;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  font-family: var(--font-body);
}

/* ── CTA Section ── */
.cta-section {
  background: var(--primary-950);
}

.cta-overlay {
  background: linear-gradient(135deg, rgba(11, 98, 236, 0.3), rgba(5, 150, 105, 0.2));
}

.cta-geo {
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(52, 211, 153, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(11, 98, 236, 0.3) 0%, transparent 50%);
}

.btn-whatsapp {
  background: #25d366;
  color: white;
  font-family: var(--font-body);
  transition: all 0.3s ease;
}

.btn-whatsapp:hover {
  background: #1fba57;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
}

/* ── Contact Form ── */
.contact-form-card {
  background: white;
  border: 1px solid rgba(13, 34, 85, 0.08);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-800);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  font-family: var(--font-body);
}

.form-input {
  display: block;
  width: 100%;
  background: var(--primary-50);
  border: 1.5px solid rgba(13, 34, 85, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: #1e293b;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(26, 130, 247, 0.12);
  background: white;
}

.form-input::placeholder { color: #94a3b8; }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  color: white;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(11, 98, 236, 0.4);
}

/* Contact info cards */
.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: white;
  border: 1px solid rgba(13, 34, 85, 0.07);
  border-radius: 16px;
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
}

.contact-info-card:hover {
  transform: translateX(4px);
}

.contact-info-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-50), rgba(236, 253, 245, 0.8));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-600);
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ── Footer ── */
.map-container {
  overflow: hidden;
  border-bottom: 3px solid var(--accent-600);
}

.footer-social-btn {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.footer-social-btn:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: white;
  transform: translateY(-2px);
}

.footer-link {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-family: var(--font-body);
  transition: color 0.2s ease;
  display: block;
}

.footer-link:hover {
  color: var(--accent-300);
}

.hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hours-badge {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-300);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, 0.2);
  font-family: var(--font-body);
}

/* ── Chat Widget "Ayuda Activa" ── */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.chat-tooltip {
  background: white;
  color: var(--primary-800);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(13, 34, 85, 0.1);
  white-space: nowrap;
  animation: tooltipFloat 3s ease-in-out infinite;
}

.chat-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: white;
  border-right: 1px solid rgba(13, 34, 85, 0.1);
  border-bottom: 1px solid rgba(13, 34, 85, 0.1);
  transform: rotate(45deg);
}

.chat-tooltip {
  position: relative;
}

@keyframes tooltipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.chat-toggle-btn {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  border-radius: 50%;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(11, 98, 236, 0.5);
  transition: transform 0.3s ease;
  animation: chatPulse 2.5s ease-in-out infinite;
  position: relative;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  animation: none;
}

.chat-icon-open, .chat-icon-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden { display: none !important; }

@keyframes chatPulse {
  0% { box-shadow: 0 0 0 0 rgba(11, 98, 236, 0.5), 0 4px 20px rgba(11, 98, 236, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(11, 98, 236, 0), 0 4px 20px rgba(11, 98, 236, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(11, 98, 236, 0), 0 4px 20px rgba(11, 98, 236, 0.4); }
}

.chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(13, 34, 85, 0.1);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  background: linear-gradient(135deg, var(--primary-700), var(--accent-700));
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-online-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-300);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-400);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(13, 34, 85, 0.2); border-radius: 4px; }

/* Message bubbles */
.chat-msg {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 16px;
  font-size: 0.8375rem;
  line-height: 1.5;
  font-family: var(--font-body);
}

.chat-msg.user {
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  background: var(--primary-50);
  color: #1e293b;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(13, 34, 85, 0.07);
}

.chat-msg a {
  color: var(--primary-600);
  text-decoration: underline;
}

.chat-msg.assistant a {
  color: var(--accent-600);
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-50);
  align-self: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(13, 34, 85, 0.07);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--primary-400, #44a4fb);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.chat-input-area {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(13, 34, 85, 0.07);
  background: white;
}

.chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--primary-50);
  border: 1.5px solid rgba(13, 34, 85, 0.1);
  border-radius: 12px;
  padding: 0.625rem 0.875rem;
  font-size: 0.8375rem;
  font-family: var(--font-body);
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--primary-400, #44a4fb);
  background: white;
}

.chat-input::placeholder { color: #94a3b8; }

.chat-send-btn {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  border: none;
  border-radius: 10px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.08);
}

/* ── Mobile Responsive Overrides ── */
@media (max-width: 640px) {
  .about-image-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 300px 150px;
    height: auto;
  }
  .about-img-main { grid-row: span 1; }
  .about-badge { bottom: 10px; left: 10px; }
  .chat-panel { width: 300px; right: 0; }
}

/* ── Smooth scroll padding for fixed header ── */
[id] { scroll-margin-top: 80px; }
