/* =========================================
   EtyK Soft — Estilos principales
   ========================================= */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #181818;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(244, 180, 0, 0.4);

  --accent: #F4B400;
  --accent-2: #c49000;
  --accent-3: #ffffff;
  --accent-glow: rgba(244, 180, 0, 0.22);

  --text: #ffffff;
  --text-muted: #a0a0a0;
  --text-faint: #555555;

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 8px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);

  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;

  --nav-h: 72px;
  --section-py: 100px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ---------- UTILITIES ---------- */
.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section { padding-block: var(--section-py); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(244, 180, 0, 0.35);
  background: rgba(244, 180, 0, 0.08);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(244, 180, 0, 0.45);
}

.btn-outline {
  border: 1px solid var(--border-hover);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  background: rgba(244, 180, 0, 0.08);
  border-color: var(--accent);
}

.btn-full { width: 100%; justify-content: center; }

/* ---------- REVEAL ANIMATION ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }

.nav-links .nav-cta {
  color: #000;
  background: var(--accent);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
}
.nav-links .nav-cta:hover {
  opacity: 0.88;
  background: var(--accent);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   HERO
   ========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 180, 0, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 180, 0, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 40%, transparent 100%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.hero-glow-1 {
  width: 600px;
  height: 600px;
  top: -100px;
  left: 50%;
  transform: translateX(-60%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}
.hero-glow-2 {
  width: 400px;
  height: 400px;
  bottom: -50px;
  right: -50px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.2;
}

.hero-content {
  position: relative;
  max-width: 800px;
  padding-inline: 24px;
  animation: heroFadeIn 0.9s ease both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--text);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

/* =========================================
   NOSOTROS
   ========================================= */
.nosotros { background: var(--bg-2); }

.nosotros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.nosotros-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.nosotros-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(244, 180, 0, 0.1);
}

.nosotros-icon {
  width: 48px;
  height: 48px;
  background: rgba(244, 180, 0, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.nosotros-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.nosotros-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.nosotros-card p { color: var(--text-muted); font-size: 0.95rem; }

/* =========================================
   SERVICIOS
   ========================================= */
.servicios { background: var(--bg); }

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.servicio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.servicio-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(244,180,0,0.04), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.servicio-card:hover::before { opacity: 1; }
.servicio-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(244, 180, 0, 0.08);
}

.servicio-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(244, 180, 0, 0.15);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.servicio-icon {
  width: 44px;
  height: 44px;
  background: rgba(244, 180, 0, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.servicio-icon svg { width: 22px; height: 22px; color: var(--accent); }

.servicio-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.servicio-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; }

.servicio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.servicio-tags li {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 100px;
}

.servicio-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.2s;
}
.servicio-link:hover { color: var(--text); }

/* =========================================
   PROYECTOS
   ========================================= */
.proyectos { background: var(--bg-2); }

.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.proyecto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.proyecto-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(244,180,0,0.2);
}

.proyecto-img {
  position: relative;
  height: 210px;
  background: var(--surface-2);
  overflow: hidden;
}
.proyecto-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.proyecto-card:hover .proyecto-img img { transform: scale(1.05); }

/* Placeholder cuando no hay imagen */
.proyecto-img.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.proyecto-img.no-img::after {
  content: '';
  width: 64px;
  height: 64px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1' stroke='%23F4B400'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.25;
}

.proyecto-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
}

.proyecto-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  background: var(--accent);
  padding: 4px 12px;
  border-radius: 100px;
}

.proyecto-body { padding: 24px; }

.proyecto-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.proyecto-body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

.proyecto-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.proyecto-techs span {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
}

.proyecto-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.2s, gap 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.proyecto-link:hover { color: var(--accent-3); }

/* =========================================
   CLIENTES
   ========================================= */
.clientes { background: var(--bg); }

.clientes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.cliente-logo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.cliente-logo:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(244,180,0,0.08);
}

/* Contenedor de imagen con altura fija y centrado */
.cliente-img-wrap {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cliente-img-wrap img {
  max-height: 90px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Placeholder cuando no hay imagen */
.cliente-img-wrap.empty {
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px dashed rgba(244,180,0,0.2);
}

.logo-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* =========================================
   STATS
   ========================================= */
.stats {
  background: linear-gradient(135deg, rgba(244,180,0,0.07) 0%, rgba(255,255,255,0.03) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: 72px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 40px;
  text-align: center;
}

.stat-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 8px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* =========================================
   CONTACTO
   ========================================= */
.contacto { background: var(--bg-2); }

.contacto-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}

.contacto-info .section-title { text-align: left; }
.contacto-info p { color: var(--text-muted); margin-bottom: 36px; }

.contacto-datos {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contacto-datos li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.contacto-datos svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}
.contacto-datos a:hover { color: var(--accent); }

.contacto-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-faint); }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244,180,0,0.12);
}

.form-success {
  display: none;
  text-align: center;
  font-size: 0.9rem;
  color: #34d399;
  padding: 10px;
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius-sm);
}
.form-success.show { display: block; }

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-top: 64px;
  padding-bottom: 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.footer-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  margin-bottom: 16px;
}

.footer-brand p { color: var(--text-muted); font-size: 0.9rem; max-width: 280px; }

.footer-links h4, .footer-social h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

.social-links {
  display: flex;
  gap: 12px;
}
.social-links a {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}
.social-links a svg { width: 16px; height: 16px; }
.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(244,180,0,0.08);
}

.footer-bottom {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  :root { --section-py: 72px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    inset-inline: 0;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 4px;
    border-top: 1px solid var(--border);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    pointer-events: none;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav-links a { font-size: 1rem; padding: 10px 16px; width: 100%; }
  .hamburger { display: flex; }

  .contacto-wrapper { grid-template-columns: 1fr; gap: 40px; }
  .contacto-info .section-title { text-align: center; }
  .contacto-info { text-align: center; }
  .contacto-datos { align-items: center; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  :root { --section-py: 56px; }

  .proyectos-grid { grid-template-columns: 1fr; }
  .clientes-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
  .footer-social { grid-column: auto; }

  .hero-title { font-size: 2rem; }
  .contacto-form { padding: 24px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================
   CHAT WIDGET
   ========================================= */
.chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Boton flotante */
.chat-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(244,180,0,0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  flex-shrink: 0;
}
.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(244,180,0,0.55);
}

.chat-fab-icon,
.chat-fab-close {
  position: absolute;
  width: 26px;
  height: 26px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-fab-close {
  opacity: 0;
  transform: rotate(-90deg);
}
.chat-widget.open .chat-fab-icon {
  opacity: 0;
  transform: rotate(90deg);
}
.chat-widget.open .chat-fab-close {
  opacity: 1;
  transform: rotate(0deg);
}

.chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  transition: opacity 0.2s;
}
.chat-widget.open .chat-badge { opacity: 0; }

/* Panel del chat */
.chat-panel {
  width: 340px;
  background: var(--surface);
  border: 1px solid rgba(244,180,0,0.2);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.25s ease;
  max-height: 520px;
}
.chat-widget.open .chat-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.chat-header {
  background: linear-gradient(135deg, rgba(244,180,0,0.1), rgba(244,180,0,0.04));
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-avatar img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.chat-status {
  font-size: 0.72rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  transition: color 0.2s, background 0.2s;
}
.chat-close svg { width: 16px; height: 16px; }
.chat-close:hover { color: var(--text); background: var(--surface-2); }

/* Mensajes */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-height: 220px;
  max-height: 280px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  animation: msgIn 0.25s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-msg.user {
  background: var(--accent);
  color: #000;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--text-faint);
  border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(1); opacity: 0.4; }
  40% { transform: scale(1.3); opacity: 1; }
}

/* Sugerencias */
.chat-suggestions {
  padding: 0 12px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chat-suggestion {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(244,180,0,0.08);
  border: 1px solid rgba(244,180,0,0.25);
  border-radius: 100px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.chat-suggestion:hover {
  background: var(--accent);
  color: #000;
}

/* Input */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

#chatInput {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}
#chatInput::placeholder { color: var(--text-faint); }
#chatInput:focus {
  outline: none;
  border-color: rgba(244,180,0,0.4);
}

#chatSend {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #000;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}
#chatSend:hover { opacity: 0.85; transform: scale(1.05); }
#chatSend svg { width: 17px; height: 17px; }

@media (max-width: 400px) {
  .chat-panel { width: calc(100vw - 32px); }
  .chat-widget { right: 16px; bottom: 16px; }
}
