/* ============================================
   CLÍNICA BARCELONA — Custom Styles
   ============================================ */

:root {
  --primary: #1A3A6B;
  --primary-dark: #0D2247;
  --primary-mid: #2558A8;
  --accent: #2563EB;
  --accent-light: #3B82F6;
  --accent-glow: #60A5FA;
  --bg-light: #F0F6FF;
  --bg-surface: #F8FAFF;
  --text-dark: #0F172A;
  --text-mid: #1E3A5F;
  --text-muted: #64748B;
  --white: #FFFFFF;
  --border: #BFDBFE;
  --border-light: #DBEAFE;
  --gold: #F59E0B;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-xl: 48px;
  --shadow-sm: 0 2px 8px rgba(26,58,107,0.08);
  --shadow-md: 0 8px 32px rgba(26,58,107,0.14);
  --shadow-lg: 0 20px 60px rgba(26,58,107,0.18);
  --shadow-accent: 0 8px 32px rgba(37,99,235,0.25);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito Sans', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
}
h1, h2, h3, h4, h5 { font-family: 'Archivo Black', sans-serif; line-height: 1.15; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---- Typography ---- */
.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.label-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent); background: rgba(37,99,235,0.09);
  border: 1px solid rgba(37,99,235,0.2);
  padding: 5px 14px; border-radius: 100px;
}

/* ---- NAVBAR ---- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
  padding: 20px 0;
  background: linear-gradient(to bottom, rgba(13,34,71,0.72) 0%, rgba(13,34,71,0.0) 100%);
}
#navbar.scrolled {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 24px rgba(26,58,107,0.1);
  padding: 12px 0;
}
.nav-logo-img { height: 44px; width: auto; }
.nav-link {
  font-size: 0.875rem; font-weight: 600; color: var(--white);
  position: relative; transition: color 0.2s;
  padding: 4px 0;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--accent-glow); border-radius: 2px;
  transform: scaleX(0); transition: transform 0.25s;
}
.nav-link:hover::after { transform: scaleX(1); }
#navbar.scrolled .nav-link { color: var(--text-dark); }
#navbar.scrolled .nav-link:hover { color: var(--accent); }
.nav-cta {
  font-size: 0.875rem; font-weight: 700;
  background: var(--accent); color: var(--white);
  padding: 10px 22px; border-radius: 100px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-accent);
}
.nav-cta:hover { background: var(--primary); transform: translateY(-1px); box-shadow: 0 12px 36px rgba(37,99,235,0.35); }
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: 0.3s; }
#navbar.scrolled .hamburger span { background: var(--text-dark); }
#mobile-menu {
  display: none; position: fixed; top: 70px; left: 0; right: 0;
  background: white; padding: 20px 24px 28px;
  box-shadow: var(--shadow-md); z-index: 999;
  border-bottom: 2px solid var(--border-light);
}
#mobile-menu a { display: block; padding: 12px 0; font-weight: 600; color: var(--text-dark); border-bottom: 1px solid var(--border-light); font-size: 0.95rem; }
#mobile-menu a:last-child { border-bottom: none; }

/* ---- HERO ---- */
#hero {
  min-height: 100vh;
  background: linear-gradient(140deg, var(--primary-dark) 0%, var(--primary) 45%, var(--primary-mid) 100%);
  position: relative; overflow: hidden;
  display: flex; align-items: center;
}
.hero-blob {
  position: absolute; border-radius: 50%;
  background: rgba(96,165,250,0.07);
  pointer-events: none;
}
.hero-blob-1 { width: 600px; height: 600px; top: -200px; right: -100px; }
.hero-blob-2 { width: 400px; height: 400px; bottom: -150px; left: -100px; background: rgba(37,99,235,0.1); }
.hero-blob-3 { width: 200px; height: 200px; top: 40%; left: 30%; background: rgba(96,165,250,0.05); }

.hero-vertical-text {
  writing-mode: vertical-rl; text-orientation: mixed;
  transform: rotate(180deg);
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.65rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: rgba(96,165,250,0.7);
  padding-right: 20px; flex-shrink: 0;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(96,165,250,0.15); border: 1px solid rgba(96,165,250,0.3);
  color: var(--accent-glow); padding: 8px 18px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 5rem);
  color: var(--white); line-height: 1.05;
}
.hero-title .highlight {
  display: block;
  background: linear-gradient(135deg, #60A5FA, #93C5FD);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc { color: rgba(255,255,255,0.75); font-size: 1.05rem; line-height: 1.7; max-width: 440px; }
.hero-cta-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: white;
  font-family: 'Archivo Black', sans-serif; font-size: 0.95rem; letter-spacing: 0.02em;
  padding: 16px 32px; border-radius: 100px;
  box-shadow: 0 8px 32px rgba(37,99,235,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(37,99,235,0.55); }
.hero-cta-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.85); font-weight: 700; font-size: 0.9rem;
  border: 1.5px solid rgba(255,255,255,0.3); padding: 15px 28px; border-radius: 100px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.hero-cta-secondary:hover { border-color: rgba(255,255,255,0.7); color: white; background: rgba(255,255,255,0.08); }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.hero-stat-num {
  font-family: 'Archivo Black', sans-serif; font-size: 2rem; color: white;
}
.hero-stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

.hero-img-frame {
  position: relative; flex-shrink: 0;
}
.hero-img-main {
  width: 100%; max-width: 520px;
  border-radius: 40px 40px 120px 40px;
  object-fit: cover; height: 560px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  position: relative; z-index: 2;
}
.hero-img-badge {
  position: absolute; bottom: 40px; left: -32px; z-index: 3;
  background: white; border-radius: 20px;
  padding: 16px 22px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 14px; min-width: 220px;
}
.hero-img-badge-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--bg-light); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hero-img-badge-text { font-size: 0.78rem; font-weight: 700; color: var(--text-dark); }
.hero-img-badge-sub { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.hero-img-dot {
  position: absolute; top: 32px; right: -24px; z-index: 3;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  color: white; border-radius: 18px; padding: 14px 18px;
  font-family: 'Archivo Black', sans-serif; font-size: 1.3rem;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
  text-align: center;
}
.hero-img-dot span { display: block; font-size: 0.62rem; font-family: 'Nunito Sans', sans-serif; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.9; }

/* ---- SECTION COMMON ---- */
section { padding: 96px 0; }
.section-header { max-width: 640px; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); color: var(--text-dark); line-height: 1.1; }
.section-subtitle { font-size: 1.05rem; color: var(--text-muted); line-height: 1.7; margin-top: 14px; }
.divider { width: 56px; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-glow)); border-radius: 4px; margin: 18px 0; }

/* ---- SERVICES ---- */
#servicios { background: var(--bg-surface); }
.service-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 32px; border: 1px solid var(--border-light);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(37,99,235,0.03), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.service-card:hover::before { opacity: 1; }
.service-card.featured {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  border-color: transparent; color: white;
  grid-column: span 2;
}
.service-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--bg-light); display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; flex-shrink: 0;
}
.service-card.featured .service-icon { background: rgba(255,255,255,0.15); }
.featured-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--primary-dark);
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 18px;
}
.service-title { font-family: 'Archivo Black', sans-serif; font-size: 1.3rem; margin-bottom: 12px; }
.service-card.featured .service-title { font-size: 1.7rem; color: white; }
.service-desc { font-size: 0.9rem; line-height: 1.65; color: var(--text-muted); }
.service-card.featured .service-desc { color: rgba(255,255,255,0.8); font-size: 1rem; }
.service-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-top: 18px; transition: gap 0.2s; }
.service-link:hover { gap: 10px; }
.service-card.featured .service-link { color: var(--accent-glow); }

/* ---- ABOUT ---- */
#nosotros .about-img {
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-sm);
  object-fit: cover; width: 100%; height: 480px;
  box-shadow: var(--shadow-lg);
}
.about-card {
  background: var(--bg-light); border-radius: var(--radius-md);
  padding: 20px 24px; border-left: 4px solid var(--accent);
  display: flex; align-items: flex-start; gap: 14px;
}
.cedula-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--primary); color: white;
  padding: 12px 22px; border-radius: 100px;
  font-size: 0.85rem; font-weight: 700;
  box-shadow: var(--shadow-md);
}
.stat-pill {
  background: white; border-radius: var(--radius-md);
  padding: 18px 24px; text-align: center;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
}
.stat-pill-num { font-family: 'Archivo Black', sans-serif; font-size: 2rem; color: var(--accent); }
.stat-pill-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- TESTIMONIALS ---- */
#testimonios { background: var(--bg-surface); }
.testi-card {
  background: white; border-radius: var(--radius-lg);
  padding: 32px; border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}
.testi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.testi-stars { color: var(--gold); font-size: 1.1rem; letter-spacing: 2px; }
.testi-quote { font-size: 1.6rem; color: var(--accent-glow); line-height: 1; margin-bottom: 8px; }
.testi-text { font-size: 0.95rem; line-height: 1.7; color: var(--text-mid); font-style: italic; }
.testi-author { font-family: 'Archivo Black', sans-serif; font-size: 0.95rem; color: var(--text-dark); }
.testi-role { font-size: 0.78rem; color: var(--text-muted); }
.testi-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  display: flex; align-items: center; justify-content: center;
  color: white; font-family: 'Archivo Black', sans-serif; font-size: 1rem;
  flex-shrink: 0;
}

/* ---- GALLERY ---- */
#galeria { background: var(--white); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
  gap: 14px;
}
.gallery-item {
  position: relative; overflow: hidden; border-radius: var(--radius-md);
  cursor: pointer; background: var(--bg-light);
}
.gallery-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(4) { grid-column: span 2; }
.gallery-img {
  width: 100%; height: 100%; min-height: 200px;
  object-fit: cover; display: block;
  transition: transform 0.5s;
}
.gallery-item:nth-child(1) .gallery-img { min-height: 360px; }
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,34,71,0.7) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: flex-end; padding: 20px;
  color: white; font-weight: 700; font-size: 0.9rem;
}
.gallery-item:hover .gallery-img { transform: scale(1.06); }
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-zoom {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.95); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s; font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.gallery-item:hover .gallery-zoom { opacity: 1; }

/* Lightbox */
#lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(9,18,40,0.95);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
#lightbox.open { display: flex; }
#lightbox-img {
  max-width: min(90vw, 960px); max-height: 85vh;
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  object-fit: contain;
}
.lightbox-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: white; border: none; cursor: pointer;
  font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; backdrop-filter: blur(8px);
}
.lightbox-btn:hover { background: rgba(255,255,255,0.25); }
#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }
#lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: white; border: none; cursor: pointer;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#lightbox-close:hover { background: rgba(255,255,255,0.25); }
#lightbox-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.1em;
}
#lightbox-caption {
  position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%);
  color: white; font-size: 0.95rem; font-weight: 700; text-align: center;
  background: rgba(0,0,0,0.4); padding: 8px 20px; border-radius: 100px;
  white-space: nowrap;
}

/* ---- FAQ ---- */
#faq { background: var(--bg-surface); }
.faq-item {
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  overflow: hidden; transition: box-shadow 0.3s;
}
.faq-item.open { box-shadow: var(--shadow-md); border-color: var(--border); }
.faq-question {
  width: 100%; background: white; padding: 22px 28px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; text-align: left; border: none;
  font-family: 'Nunito Sans', sans-serif; font-size: 1rem; font-weight: 700;
  color: var(--text-dark); transition: background 0.2s; gap: 16px;
}
.faq-question:hover { background: var(--bg-light); }
.faq-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.2rem; font-weight: 300;
  transition: background 0.2s, transform 0.3s;
}
.faq-item.open .faq-icon { background: var(--accent); color: white; transform: rotate(45deg); }
.faq-answer {
  background: white; max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  padding: 0 28px;
  font-size: 0.95rem; color: var(--text-muted); line-height: 1.75;
}
.faq-item.open .faq-answer { max-height: 400px; padding: 0 28px 24px; }

/* ---- CONTACT ---- */
#contacto { background: var(--white); }
.contact-form-wrap {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 48px; border: 1px solid var(--border-light); box-shadow: var(--shadow-md);
}
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 700;
  color: var(--text-mid); margin-bottom: 8px; letter-spacing: 0.04em;
}
.form-input {
  width: 100%; padding: 14px 18px;
  border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
  font-family: 'Nunito Sans', sans-serif; font-size: 0.95rem; color: var(--text-dark);
  background: var(--bg-surface); transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: white; }
.form-input::placeholder { color: var(--text-muted); }
.form-submit {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--primary-mid));
  color: white; border: none; border-radius: 100px;
  font-family: 'Archivo Black', sans-serif; font-size: 1rem; letter-spacing: 0.02em;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-accent); display: flex; align-items: center; justify-content: center; gap: 10px;
}
.form-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(37,99,235,0.4); }
.contact-info-item {
  display: flex; align-items: flex-start; gap: 16px;
}
.contact-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--bg-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-info-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.contact-info-value { font-size: 0.95rem; font-weight: 600; color: var(--text-dark); }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 8px 0; font-size: 0.9rem; }
.hours-table td:first-child { color: var(--text-muted); font-weight: 600; }
.hours-table td:last-child { color: var(--text-dark); font-weight: 700; text-align: right; }

/* ---- CTA ---- */
#cta-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-mid) 100%);
  position: relative; overflow: hidden; padding: 96px 0;
}
.cta-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.cta-blob-1 { width: 500px; height: 500px; top: -200px; right: -100px; background: rgba(96,165,250,0.08); }
.cta-blob-2 { width: 300px; height: 300px; bottom: -100px; left: -80px; background: rgba(37,99,235,0.1); }
.cta-title { font-size: clamp(2rem, 4vw, 3.2rem); color: white; text-align: center; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: white; color: var(--accent);
  font-family: 'Archivo Black', sans-serif; font-size: 1rem;
  padding: 18px 40px; border-radius: 100px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 20px 56px rgba(0,0,0,0.3); }

/* ---- FOOTER ---- */
footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.8);
  padding: 72px 0 32px;
}
.footer-logo-img { height: 40px; width: auto; filter: brightness(10); }
.footer-title { font-family: 'Archivo Black', sans-serif; font-size: 1rem; color: white; margin-bottom: 16px; }
.footer-link { font-size: 0.875rem; color: rgba(255,255,255,0.65); transition: color 0.2s; display: block; margin-bottom: 10px; }
.footer-link:hover { color: var(--accent-glow); }
.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; font-size: 0.875rem; }
.footer-contact-item svg { flex-shrink: 0; margin-top: 2px; color: var(--accent-glow); }
.footer-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 48px 0 28px; }
.footer-bottom { font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.footer-map-wrap { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md); border: 2px solid rgba(255,255,255,0.1); }

/* ---- CHAT WIDGET ---- */
#chat-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 8000;
  display: flex; flex-direction: column; align-items: flex-end;
}
.chat-tooltip {
  background: white; color: var(--text-dark);
  font-size: 0.82rem; font-weight: 700;
  padding: 8px 16px; border-radius: 100px;
  box-shadow: var(--shadow-md); margin-bottom: 10px;
  white-space: nowrap; pointer-events: none;
  border: 1px solid var(--border-light);
  transition: opacity 0.3s, transform 0.3s;
}
.chat-tooltip::after {
  content: ''; position: absolute; bottom: -6px; right: 22px;
  width: 12px; height: 12px; background: white;
  transform: rotate(45deg); border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
}
.chat-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary-mid));
  border: none; cursor: pointer; color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-accent); position: relative;
  transition: transform 0.2s;
}
.chat-btn:hover { transform: scale(1.08); }
.chat-btn.open { animation: none !important; }

/* Pulse animation using ONLY transform + opacity */
@keyframes chatPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}
.chat-pulse-ring {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(37,99,235,0.5);
  animation: chatPulse 2s ease-in-out infinite;
  pointer-events: none;
}
.chat-pulse-ring-2 {
  position: absolute; inset: -16px; border-radius: 50%;
  border: 2px solid rgba(37,99,235,0.25);
  animation: chatPulse 2s ease-in-out infinite 0.4s;
  pointer-events: none;
}
.chat-btn.open .chat-pulse-ring,
.chat-btn.open .chat-pulse-ring-2 { display: none; }

.chat-panel {
  position: absolute; bottom: 76px; right: 0;
  width: 360px; background: white;
  border-radius: var(--radius-lg); box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  border: 1px solid var(--border-light); overflow: hidden;
  display: none; flex-direction: column;
  max-height: 520px;
}
.chat-panel.open { display: flex; }
.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: white; padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
}
.chat-header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
}
.chat-header-name { font-family: 'Archivo Black', sans-serif; font-size: 0.95rem; }
.chat-header-status { font-size: 0.72rem; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 5px; }
.chat-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 200px; max-height: 320px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 16px;
  font-size: 0.875rem; line-height: 1.55;
}
.chat-msg.bot {
  background: var(--bg-light); color: var(--text-dark);
  border-bottom-left-radius: 4px; align-self: flex-start;
  border: 1px solid var(--border-light);
}
.chat-msg.user {
  background: linear-gradient(135deg, var(--accent), var(--primary-mid));
  color: white; border-bottom-right-radius: 4px; align-self: flex-end;
}
.chat-msg a { color: var(--accent-glow); text-decoration: underline; }
.chat-msg.user a { color: rgba(255,255,255,0.9); }
.chat-typing {
  display: flex; gap: 5px; align-items: center;
  padding: 12px 16px; background: var(--bg-light);
  border-radius: 16px; border-bottom-left-radius: 4px;
  align-self: flex-start; border: 1px solid var(--border-light);
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-glow);
  animation: typingBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
.chat-footer {
  padding: 12px 16px; border-top: 1px solid var(--border-light);
  display: flex; gap: 8px;
}
.chat-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--border-light);
  border-radius: 100px; font-family: 'Nunito Sans', sans-serif;
  font-size: 0.875rem; outline: none; background: var(--bg-surface);
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s; flex-shrink: 0;
}
.chat-send:hover { background: var(--primary); transform: scale(1.08); }

/* ---- ANIMATIONS ---- */
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left {
  opacity: 0; transform: translateX(-32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right {
  opacity: 0; transform: translateX(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .service-card.featured { grid-column: span 1; }
  .hero-img-main { height: 440px; }
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  nav ul { display: none; }
  .nav-cta-desktop { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item:nth-child(1) { grid-column: span 2; }
  .gallery-item:nth-child(4) { grid-column: span 1; }
  .hero-img-badge { display: none; }
  .hero-img-dot { display: none; }
  .contact-form-wrap { padding: 28px 20px; }
  .chat-panel { width: 310px; }
  section { padding: 64px 0; }
  .hero-stats { gap: 20px; }
  .hero-vertical-text { display: none; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .lightbox-btn { width: 40px; height: 40px; font-size: 1.1rem; }
  #lightbox-prev { left: 8px; }
  #lightbox-next { right: 8px; }
  .chat-panel { width: calc(100vw - 48px); right: 0; }
}
