/* ==========================================================================
   MUDANZA URGENTE - MAIN STYLESHEET (VANILLA CSS DESIGN SYSTEM)
   ========================================================================== */

/* 1. Imports & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* 2. Custom Properties (Design System Tokens) */
:root {
  /* Brand Colors - Verde Bosque */
  --primary: #2D8B4E;
  --primary-50: #F0F9F4;
  --primary-100: #D1F0DC;
  --primary-200: #A3E1B9;
  --primary-500: #3DA65E;
  --primary-700: #2D8B4E;
  --primary-800: #236B3C;
  --primary-900: #1A4F2C;

  /* Accent Colors - Naranja Moderno */
  --accent: #F97316;
  --accent-500: #F97316;
  --accent-700: #EA580C;

  /* Semantics */
  --success: #22C55E;
  --error: #EF4444;

  /* Slate Gray Scale */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Border Radii */
  --radius-btn: 8px;
  --radius-card: 12px;
  --radius-bubble: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-primary: 0 10px 15px -3px rgba(45, 139, 78, 0.2);

  /* Font Families */
  --font-sans: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* 3. Base Styles & Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #fff;
  color: var(--slate-600);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Accessibility Focus States */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-500), 0 0 0 4px var(--primary-50);
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}

/* 4. Core Layout & Container */
.max-w-7xl {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-32 { padding-top: 8rem; padding-bottom: 8rem; }

.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-8 { padding-top: 2rem; }
.pt-16 { padding-top: 4rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }

.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.my-10 { margin-top: 2.5rem; margin-bottom: 2.5rem; }

/* Grid / Flex Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: space-between; justify-content: center; }
.shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: 3rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* 5. Typography Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.leading-none { line-height: 1; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }
.leading-tight { line-height: 1.25; }

.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-widest { letter-spacing: 0.1em; }

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

/* 6. Border Radius Utilities */
.rounded-btn { border-radius: var(--radius-btn); }
.rounded-card { border-radius: var(--radius-card); }
.rounded-bubble { border-radius: var(--radius-bubble); }
.rounded-xl { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }
.rounded-tl-none { border-top-left-radius: 0; }

/* 7. Backgrounds & Colors */
.bg-white { background-color: #fff; }
.bg-slate-50 { background-color: var(--slate-50); }
.bg-slate-100 { background-color: var(--slate-100); }
.bg-primary { background-color: var(--primary); }
.bg-primary-50 { background-color: var(--primary-50); }
.bg-primary-100 { background-color: var(--primary-100); }
.bg-primary-200 { background-color: var(--primary-200); }
.bg-primary-900 { background-color: var(--primary-900); }
.bg-accent { background-color: var(--accent); }
.bg-accent\/10 { background-color: rgba(249, 115, 22, 0.1); }
.bg-emerald-50\/50 { background-color: rgba(236, 253, 245, 0.5); }
.bg-emerald-50 { background-color: rgba(236, 253, 245, 1); }

.text-white { color: #fff; }
.text-slate-200 { color: var(--slate-200); }
.text-slate-300 { color: var(--slate-300); }
.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-650 { color: #576574; }
.text-slate-700 { color: var(--slate-700); }
.text-slate-800 { color: var(--slate-800); }
.text-slate-900 { color: var(--slate-900); }
.text-primary { color: var(--primary); }
.text-primary-500 { color: var(--primary-500); }
.text-accent { color: var(--accent); }
.text-emerald-400 { color: #34d399; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }

/* Border utilities */
.border { border: 1px solid var(--slate-200); }
.border-t { border-top: 1px solid var(--slate-200); }
.border-b { border-bottom: 1px solid var(--slate-200); }
.border-l-2 { border-left: 2px solid var(--slate-200); }
.border-t-4 { border-top: 4px solid var(--slate-200); }
.border-slate-100 { border-color: var(--slate-100); }
.border-slate-200 { border-color: var(--slate-200); }
.border-slate-200\/50 { border-color: rgba(226, 232, 240, 0.5); }
.border-primary-100 { border-color: var(--primary-100); }
.border-primary-100\/30 { border-color: rgba(209, 240, 220, 0.3); }
.border-primary-100\/50 { border-color: rgba(209, 240, 220, 0.5); }
.border-primary-200\/50 { border-color: rgba(163, 225, 185, 0.5); }
.border-primary-700 { border-color: var(--primary-700); }
.border-primary-800 { border-color: var(--primary-800); }
.border-accent\/20 { border-color: rgba(249, 115, 22, 0.2); }
.border-accent\/35 { border-color: rgba(249, 115, 22, 0.35); }
.border-emerald-200\/60 { border-color: rgba(167, 243, 208, 0.6); }

/* Shadows utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-primary\/20 { box-shadow: 0 10px 15px -3px rgba(45, 139, 78, 0.2); }

/* Transitions & Transforms */
.transition-all { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-colors { transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.transition-transform { transition: transform 0.3s ease; }
.duration-200 { transition-duration: 0.2s; }
.duration-300 { transition-duration: 0.3s; }
.origin-bottom-right { transform-origin: bottom right; }

.hover\:-translate-y-0\.5:hover { transform: translateY(-2px); }
.hover\:-translate-y-1:hover { transform: translateY(-4px); }
.hover\:scale-105:hover { transform: scale(1.05); }
.active\:scale-95:active { transform: scale(0.95); }

/* 8. Component Styles */

/* Header / Glassmorphism */
header.sticky {
  position: sticky;
  top: 0;
  z-index: 50;
}
.bg-white\/90 {
  background-color: rgba(255, 255, 255, 0.9);
}
.backdrop-blur-md {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

header.sticky .flex-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem;
}

/* Brand Div Logo */
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }

/* Custom SVGs and Stars */
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.mr-2\.5 { margin-right: 0.625rem; }
.mr-8 { margin-right: 2rem; }
.mt-0\.5 { margin-top: 0.125rem; }

/* Dropdown */
.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.inset-0 { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
.overflow-hidden { overflow: hidden; }
.pointer-events-none { pointer-events: none; }

.group\/dropdown .absolute {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}
.group\/dropdown:hover .absolute {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Sub-links in Dropdown */
.w-64 { width: 16rem; }
.p-2 { padding: 0.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-2\.5 > * + * { margin-top: 0.625rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-3\.5 > * + * { margin-top: 0.875rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }

.block { display: block; }
.p-2\.5 { padding: 0.625rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }

/* Buttons & Links Styling */
.hover\:underline:hover { text-decoration: underline; }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:text-primary-500:hover { color: var(--primary-500); }
.hover\:text-primary-700:hover { color: var(--primary-700); }
.hover\:bg-primary-50\/50:hover { background-color: rgba(240, 249, 244, 0.5); }
.hover\:bg-primary-50:hover { background-color: var(--primary-50); }
.hover\:bg-primary-700:hover { background-color: var(--primary-700); }
.hover\:bg-primary-500:hover { background-color: var(--primary-500); }
.hover\:bg-slate-50:hover { background-color: var(--slate-50); }
.hover\:bg-slate-50\/50:hover { background-color: rgba(248, 250, 252, 0.5); }
.hover\:text-white:hover { color: #fff; }
.hover\:text-accent-700:hover { color: var(--accent-700); }
.hover\:text-slate-300:hover { color: var(--slate-300); }
.hover\:bg-accent-700:hover { background-color: var(--accent-700); }

/* Specific styled lists & content */
.bg-gradient-to-br {
  background-image: linear-gradient(135deg, var(--primary-50) 0%, #fff 50%, rgba(209, 240, 220, 0.3) 100%);
}
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--primary-900), var(--primary-700));
}
.bg-gradient-dark-hero {
  background-image: linear-gradient(135deg, var(--primary-900) 0%, var(--slate-900) 100%);
}

/* Decorative grid pattern */
.bg-grid-overlay {
  background-image: linear-gradient(to right, rgba(45, 139, 78, 0.02) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(45, 139, 78, 0.02) 1px, transparent 1px);
  background-size: 4rem 4rem;
}

/* Floating circles */
.bg-primary-200\/20 { background-color: rgba(163, 225, 185, 0.2); }
.bg-primary-500\/5 { background-color: rgba(61, 166, 94, 0.05); }
.blur-3xl { filter: blur(64px); }

/* Star Rating SVG */
.text-amber-400 { color: #fbbf24; }

/* Contact Form Specific Styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-700);
  letter-spacing: 0.05em;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--slate-200);
  background-color: var(--slate-50);
  font-size: 0.875rem;
  color: var(--slate-800);
  transition: all 0.2s ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  background-color: #fff;
  border-color: var(--primary-500);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-50), 0 0 0 4px var(--primary-100);
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--slate-600);
  cursor: pointer;
}
.checkbox-input {
  margin-top: 0.125rem;
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* 9. Chat Widget Styling */
#chat-container {
  font-family: var(--font-sans);
}
#chat-window {
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#chat-messages-container {
  scrollbar-width: thin;
  scrollbar-color: var(--slate-300) transparent;
}
#chat-messages-container::-webkit-scrollbar {
  width: 4px;
}
#chat-messages-container::-webkit-scrollbar-thumb {
  background-color: var(--slate-300);
  border-radius: 4px;
}
.fill-current { fill: currentColor; }

/* Micro animations / typing pulses */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes bounce {
  0%, 100% { transform: translateY(-5%); animation-timing-function: cubic-bezier(0.8,0,1,1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0,0,0.2,1); }
}
.animate-bounce { animation: bounce 1s infinite; }

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* 10. Responsive Breakpoints & Utilities */

.hidden { display: none !important; }
.block { display: block !important; }

/* Hamburger Open / Close SVGs */
#mobile-menu-btn #menu-icon-open { display: block; }
#mobile-menu-btn #menu-icon-close { display: none; }
#mobile-menu-btn[aria-expanded="true"] #menu-icon-open { display: none; }
#mobile-menu-btn[aria-expanded="true"] #menu-icon-close { display: block; }

/* Mobile Menu Slide In CSS helper */
#mobile-menu.hidden { display: none !important; }
#mobile-menu:not(.hidden) { display: block !important; }

/* Mobile styles for Chat Widget */
@media (max-width: 639px) {
  #chat-window {
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
  }
}

/* Breakpoint SM (>= 640px) */
@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:flex { display: flex; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:w-auto { width: auto; }
  
  .sm\:text-xs { font-size: 0.75rem; }
  .sm\:text-sm { font-size: 0.875rem; }
  .sm\:text-base { font-size: 1rem; }
  .sm\:text-lg { font-size: 1.125rem; }
  .sm\:text-xl { font-size: 1.25rem; }
  .sm\:text-4xl { font-size: 2.25rem; }
  .sm\:text-5xl { font-size: 3rem; }
  
  .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  
  /* Chat window on tablet/desktop */
  #chat-window {
    position: absolute;
    bottom: 5rem;
    right: 0;
    width: 380px !important;
    height: 560px !important;
    max-height: 80vh !important;
    border-radius: var(--radius-card) !important;
    border: 1px solid var(--slate-100) !important;
  }
}

/* Breakpoint MD (>= 768px) */
@media (min-width: 768px) {
  .md\:flex { display: flex !important; }
  .md\:hidden { display: none !important; }
  
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  
  .md\:mb-0 { margin-bottom: 0; }
  
  .px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Breakpoint LG (>= 1024px) */
@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .lg\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
  
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  
  /* Advanced 12 Column Layout grid for Heroes */
  .lg\:grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  
  .lg\:text-left { text-align: left; }
  .lg\:mx-0 { margin-left: 0; margin-right: 0; }
  
  .lg\:space-x-4 > * + * { margin-left: 1rem; }
  
  .lg\:text-6xl { font-size: 3.75rem; }
}
