/* ============================================
   NEXTCONTACT - Stylesheet
   Servicios Tecnológicos Profesionales | 2026
   ============================================ */

:root {
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #555;
  --color-text-tertiary: #888;
  --color-surface: #fff;
  --color-surface-secondary: #f5f5f5;
  --color-border: #e5e5e5;
  --color-positive: #16a34a;
  --color-accent: #2563eb;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-purple: #7c3aed;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--color-text-primary); background: var(--color-surface); line-height: 1.6; }
img { display: block; max-width: 100%; }

/* NAV */
.nav { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--color-border); }
.nav-logo { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.nav-logo-icon { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--color-accent); flex-shrink: 0; }
.nav-logo-icon svg { width: 26px; height: 26px; }
.nc-logo-img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { padding: 8px 14px; font-size: 14px; color: var(--color-text-secondary); text-decoration: none; border-radius: 8px; transition: all 0.2s; font-weight: 500; }
.nav-links a:hover { color: var(--color-text-primary); background: var(--color-surface-secondary); }
.nav-links a.active { color: var(--color-text-primary); background: var(--color-surface-secondary); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-primary); cursor: pointer; }

/* HERO */
.hero { position: relative; height: 520px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity 1.4s ease; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,15,30,0.8) 0%, rgba(10,15,30,0.3) 50%, rgba(10,15,30,0.5) 100%); }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 60px 48px; max-width: 1200px; margin: 0 auto; }
.hero h1 { font-size: 48px; font-weight: 600; color: #fff; margin: 0 0 12px 0; line-height: 1.1; max-width: 600px; letter-spacing: -1px; }
.hero p { font-size: 18px; color: rgba(255,255,255,0.8); margin: 0 0 28px 0; max-width: 480px; line-height: 1.6; }
.hero-btns { display: flex; gap: 12px; }
.btn-primary { padding: 14px 28px; background: #fff; color: var(--color-text-primary); border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: var(--color-surface-secondary); transform: translateY(-1px); }
.btn-secondary { padding: 14px 28px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.45); border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-block; }
.btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.hero-dots { position: absolute; bottom: 24px; right: 48px; display: flex; gap: 8px; z-index: 3; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.3s; border: none; }
.hero-dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* SECTIONS */
.section { padding: 80px 48px; max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 32px; font-weight: 600; margin: 0 0 8px 0; letter-spacing: -0.5px; }
.section-header p { font-size: 16px; color: var(--color-text-secondary); margin: 0; }

/* SERVICES */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card { border: 1px solid var(--color-border); border-radius: 14px; padding: 28px; transition: all 0.25s; cursor: pointer; background: var(--color-surface); }
.service-card:hover { border-color: var(--color-text-primary); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.service-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.service-icon.blue { background: rgba(37,99,235,0.1); color: var(--color-accent); }
.service-icon.green { background: rgba(22,163,74,0.1); color: var(--color-positive); }
.service-icon.red { background: rgba(220,38,38,0.1); color: var(--color-danger); }
.service-icon.purple { background: rgba(124,58,237,0.1); color: var(--color-purple); }
.service-icon.orange { background: rgba(217,119,6,0.1); color: var(--color-warning); }
.service-card h4 { font-size: 17px; font-weight: 600; margin: 0 0 8px 0; }
.service-card p { font-size: 14px; color: var(--color-text-secondary); margin: 0; line-height: 1.6; }

/* STATS */
.stats-bar { display: flex; gap: 16px; margin-top: 32px; padding: 18px 24px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface-secondary); }
.stat { text-align: center; flex: 1; }
.stat-value { font-size: 28px; font-weight: 600; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--color-text-tertiary); margin-top: 4px; }

/* TOUR */
.tour-section { padding: 0 48px 80px; max-width: 1200px; margin: 0 auto; }
.tour-container { position: relative; border-radius: 20px; overflow: hidden; height: 520px; background: #000; box-shadow: 0 12px 48px rgba(0,0,0,0.15); }
.tour-slides { position: absolute; inset: 0; }
.tour-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s ease; }
.tour-slide.active { opacity: 1; }
.tour-slide img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns { 0% { transform: scale(1) translate(0, 0); } 100% { transform: scale(1.18) translate(-2%, -1%); } }
.tour-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%); z-index: 2; }
.tour-labels { position: absolute; bottom: 28px; left: 32px; right: 32px; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; }
.tour-labels h3 { font-size: 22px; font-weight: 600; color: #fff; margin: 0 0 6px 0; }
.tour-labels p { font-size: 14px; color: rgba(255,255,255,0.7); margin: 0; }
.tour-play-btn { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; border: none; }
.tour-play-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.08); }
.tour-play-btn svg { width: 22px; height: 22px; color: #fff; }
.tour-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(255,255,255,0.2); z-index: 4; }
.tour-progress-fill { height: 100%; background: #fff; width: 0%; transition: width 0.3s linear; }
.tour-caption { position: absolute; top: 20px; left: 24px; z-index: 3; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.4); padding: 6px 14px; border-radius: 20px; backdrop-filter: blur(6px); }
.tour-caption .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.tour-caption span { font-size: 12px; color: rgba(255,255,255,0.9); font-weight: 600; letter-spacing: 1px; }

/* CHATBOT */
.chat-section { padding: 0 48px 80px; max-width: 1200px; margin: 0 auto; }
.chat-container { border: 1px solid var(--color-border); border-radius: 16px; overflow: hidden; background: var(--color-surface); display: grid; grid-template-columns: 240px 1fr; min-height: 480px; }
.chat-sidebar { background: var(--color-surface-secondary); padding: 24px; border-right: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 8px; }
.chat-sidebar h4 { font-size: 11px; font-weight: 600; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 8px 0; }
.chat-topic { padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--color-text-secondary); cursor: pointer; transition: all 0.2s; border: none; background: transparent; text-align: left; font-family: inherit; width: 100%; }
.chat-topic:hover, .chat-topic.active { background: var(--color-surface); color: var(--color-text-primary); }
.chat-main { display: flex; flex-direction: column; padding: 24px; }
.chat-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; background: rgba(22,163,74,0.1); color: var(--color-positive); margin-bottom: 16px; width: fit-content; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 320px; margin-bottom: 16px; padding-right: 4px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.chat-avatar.bot { background: rgba(37,99,235,0.1); color: var(--color-accent); }
.chat-avatar.user { background: var(--color-text-primary); color: #fff; }
.chat-bubble { padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.6; max-width: 85%; }
.chat-bubble.bot { background: var(--color-surface-secondary); color: var(--color-text-primary); border-bottom-left-radius: 4px; }
.chat-bubble.user { background: var(--color-text-primary); color: #fff; border-bottom-right-radius: 4px; margin-left: auto; }
.chat-input { display: flex; gap: 10px; }
.chat-input input { flex: 1; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 14px; background: var(--color-surface); color: var(--color-text-primary); font-family: inherit; }
.chat-input input:focus { outline: none; border-color: var(--color-accent); }
.chat-input button { padding: 12px 22px; background: var(--color-text-primary); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.chat-input button:hover { opacity: 0.85; }

/* APPS */
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.app-card { border: 1px solid var(--color-border); border-radius: 14px; padding: 28px; transition: all 0.25s; cursor: pointer; background: var(--color-surface); position: relative; overflow: hidden; }
.app-card:hover { border-color: var(--color-accent); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.app-tag { position: absolute; top: 16px; right: 16px; padding: 3px 10px; border-radius: 6px; font-size: 10px; font-weight: 600; background: rgba(37,99,235,0.08); color: var(--color-accent); }
.app-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: var(--color-surface-secondary); color: var(--color-accent); }
.app-card h4 { font-size: 17px; font-weight: 600; margin: 0 0 8px 0; }
.app-card p { font-size: 14px; color: var(--color-text-secondary); margin: 0 0 18px 0; line-height: 1.6; }
.app-stats { display: flex; gap: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.app-stat { font-size: 12px; color: var(--color-text-tertiary); }
.app-stat strong { color: var(--color-text-primary); font-weight: 600; }
.app-more-btn { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; background: transparent; border: 1px solid var(--color-border); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--color-text-primary); cursor: pointer; font-family: inherit; transition: all 0.2s; }
.app-more-btn:hover { background: var(--color-text-primary); color: #fff; border-color: var(--color-text-primary); }
.app-more-btn svg { transition: transform 0.2s; }
.app-more-btn:hover svg { transform: translateX(2px); }

/* MODAL: más info de App */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,15,30,0.55); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--color-surface); border-radius: 18px; max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; position: relative; box-shadow: 0 24px 64px rgba(0,0,0,0.25); transform: translateY(12px); transition: transform 0.2s ease; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--color-text-secondary); z-index: 2; transition: all 0.2s; }
.modal-close:hover { background: var(--color-surface-secondary); color: var(--color-text-primary); }
.modal-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; }
.modal-main { padding: 36px 32px; }
.modal-main h3 { font-size: 24px; font-weight: 600; margin: 0 0 12px 0; letter-spacing: -0.3px; }
.modal-main p { font-size: 14.5px; color: var(--color-text-secondary); line-height: 1.7; margin: 0 0 20px 0; }
.modal-stats { display: flex; gap: 24px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.modal-qr { background: var(--color-surface-secondary); padding: 36px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-left: 1px solid var(--color-border); }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--color-border); }
.qr-box img { width: 160px; height: 160px; display: block; }
.qr-label { font-size: 12px; color: var(--color-text-tertiary); margin: 14px 0 18px 0; font-weight: 500; }
.modal-install-btn { width: 100%; text-align: center; background: var(--color-text-primary); color: #fff; }
.modal-install-btn:hover { background: var(--color-text-primary); opacity: 0.85; }

/* COMPONENTES */
.components-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.component-card { border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; background: var(--color-surface); transition: all 0.25s; }
.component-card:hover { border-color: var(--color-text-primary); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.component-img { height: 180px; background-size: cover; background-position: center; background-color: var(--color-surface-secondary); }
.component-body { padding: 20px 22px 24px; }
.component-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.component-top h4 { font-size: 16px; font-weight: 600; margin: 0; }
.component-status { flex-shrink: 0; padding: 3px 10px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.component-status.new { background: rgba(22,163,74,0.1); color: var(--color-positive); }
.component-status.used { background: rgba(217,119,6,0.1); color: var(--color-warning); }
.component-price { font-size: 20px; font-weight: 600; color: var(--color-text-primary); margin-bottom: 14px; }
.component-features { list-style: none; margin: 0; padding: 14px 0 0 0; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 8px; }
.component-features li { font-size: 13px; color: var(--color-text-secondary); padding-left: 18px; position: relative; }
.component-features li::before { content: ''; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); }

/* FOOTER admin link */
.footer-admin-link { color: var(--color-text-tertiary); text-decoration: none; border-bottom: 1px dotted var(--color-text-tertiary); }
.footer-admin-link:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* CONTACT */
.contact-section { padding: 80px 48px; background: var(--color-surface-secondary); }
.contact-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-info h3 { font-size: 28px; font-weight: 600; margin: 0 0 16px 0; }
.contact-info p { font-size: 15px; color: var(--color-text-secondary); margin: 0 0 28px 0; line-height: 1.7; }
.contact-item { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; color: var(--color-text-secondary); }
.contact-item svg { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 14px; background: var(--color-surface); padding: 32px; border-radius: 16px; border: 1px solid var(--color-border); }
.contact-form input, .contact-form textarea, .contact-form select { padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 15px; background: var(--color-surface); color: var(--color-text-primary); font-family: inherit; transition: border-color 0.2s; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { outline: none; border-color: var(--color-accent); }
.contact-form textarea { min-height: 100px; resize: vertical; }
.contact-form button { padding: 16px; background: var(--color-text-primary); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.contact-form button:hover { opacity: 0.85; transform: translateY(-1px); }

/* FOOTER */
.footer { padding: 32px 48px; text-align: center; font-size: 13px; color: var(--color-text-tertiary); border-top: 1px solid var(--color-border); background: var(--color-surface); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav { padding: 12px 18px; position: relative; }
  .nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: 10px; box-shadow: 0 12px 24px rgba(0,0,0,0.08); z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 8px; }

  .hero { height: 460px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; max-width: 100%; }
  .hero-content { padding: 32px 20px; }
  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns a { text-align: center; }
  .hero-dots { right: 20px; }

  .section { padding: 48px 20px; }
  .section-header h2 { font-size: 26px; }
  .section-header p { font-size: 14px; }
  .services-grid, .apps-grid, .components-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .stat { flex: 1 1 45%; }

  .tour-section { padding: 0 20px 48px; }
  .tour-container { height: 300px; border-radius: 14px; }
  .tour-labels { left: 18px; right: 18px; bottom: 18px; }
  .tour-labels h3 { font-size: 17px; }
  .tour-play-btn { width: 48px; height: 48px; }

  .chat-container { grid-template-columns: 1fr; min-height: 0; }
  .chat-sidebar { display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 14px; border-right: none; border-bottom: 1px solid var(--color-border); }
  .chat-sidebar h4 { display: none; }
  .chat-topic { white-space: nowrap; width: auto; flex-shrink: 0; }
  .chat-main { padding: 18px; }
  .chat-messages { max-height: 300px; }

  .modal { max-height: 92vh; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-main { padding: 26px 22px; }
  .modal-qr { border-left: none; border-top: 1px solid var(--color-border); padding: 24px 20px; }

  .contact-section { padding: 48px 20px; }
  .contact-inner { grid-template-columns: 1fr; gap: 28px; }
  .contact-form { padding: 22px; }

  .footer { padding: 22px 20px; font-size: 12px; }
}

@media (max-width: 420px) {
  .hero { height: 420px; }
  .hero h1 { font-size: 26px; }
  .section-header h2 { font-size: 22px; }
  .stat { flex: 1 1 100%; }
  .stat-value { font-size: 24px; }
  .app-card, .service-card { padding: 22px; }
  .modal-main h3 { font-size: 20px; }
}
