/* =====================================================
   GRUPO EMCO - DESIGN SYSTEM
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;600;700;800;900&display=swap');

/* ---- CSS VARIABLES ---- */
:root {
  --green-primary:   #16a34a;
  --green-light:     #22c55e;
  --green-dark:      #15803d;
  --green-xdark:     #14532d;
  --green-glow:      rgba(22, 163, 74, 0.25);

  --dark-bg:         #0a0f0d;
  --dark-surface:    #111816;
  --dark-card:       #161f1a;
  --dark-border:     #1e2d24;
  --dark-muted:      #1a2620;

  --white:           #ffffff;
  --off-white:       #f8faf9;
  --gray-100:        #f1f5f2;
  --gray-200:        #e2e8e4;
  --gray-300:        #c8d6cc;
  --gray-400:        #94a89c;
  --gray-500:        #6b7f72;
  --gray-600:        #4a5c51;
  --gray-700:        #2e3d33;
  --gray-800:        #1c2b21;
  --gray-900:        #0f1a13;

  --font-primary:    'Inter', sans-serif;
  --font-display:    'Outfit', sans-serif;

  --shadow-sm:       0 1px 3px rgba(0,0,0,.3);
  --shadow-md:       0 4px 16px rgba(0,0,0,.35);
  --shadow-lg:       0 8px 32px rgba(0,0,0,.45);
  --shadow-xl:       0 20px 60px rgba(0,0,0,.55);
  --shadow-green:    0 8px 32px rgba(22,163,74,.3);

  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --radius-xl:       28px;
  --radius-full:     9999px;

  --transition:      all .3s cubic-bezier(.4,0,.2,1);
  --transition-fast: all .15s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .5s cubic-bezier(.4,0,.2,1);

  --header-h:        80px;
  --section-pad:     100px 0;
}

.overflow-hidden { overflow: hidden !important; }

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-primary);
  background: var(--white);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a  { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p  { line-height: 1.75; }

/* ---- UTILITIES ---- */
.container   { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm{ width: 100%; max-width: 900px;  margin: 0 auto; padding: 0 24px; }
.section     { padding: var(--section-pad); }
.section-dark{ background: var(--dark-bg); color: var(--white); }
.section-gray{ background: var(--gray-100); }

.text-center { text-align: center; }
.text-green  { color: var(--green-primary); }
.text-muted  { color: var(--gray-500); }
.text-white  { color: var(--white); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(22,163,74,.15);
  border: 1px solid rgba(22,163,74,.3);
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 600;
  color: var(--green-light);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px; height: 6px;
  background: var(--green-light);
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%,100%{ opacity:1; transform:scale(1); }
  50%    { opacity:.5; transform:scale(1.5); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--font-primary);
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.1);
  opacity: 0;
  transition: var(--transition-fast);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--green-primary);
  color: var(--white);
  box-shadow: var(--shadow-green);
}
.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(22,163,74,.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.4);
}
.btn-outline:hover {
  border-color: var(--green-light);
  color: var(--green-light);
  transform: translateY(-2px);
}

.btn-outline-green {
  background: transparent;
  color: var(--green-primary);
  border: 2px solid var(--green-primary);
}
.btn-outline-green:hover {
  background: var(--green-primary);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(22,163,74,.2);
  border-color: var(--green-light);
  color: var(--green-light);
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: #25d366;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(37,211,102,.35);
}
.btn-whatsapp:hover {
  background: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37,211,102,.45);
}

.btn-sm { padding: 10px 22px; font-size: .85rem; }
.btn-lg { padding: 18px 42px; font-size: 1.05rem; }
.btn-full{ width: 100%; }

/* ---- SECTION HEADER ---- */
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .badge { margin-bottom: 16px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p  { max-width: 600px; margin: 0 auto; color: var(--gray-500); font-size: 1.05rem; }
.section-header.light p { color: var(--gray-400); }

.section-divider {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--green-primary), var(--green-light));
  border-radius: 2px;
  margin: 20px auto 0;
}

/* ---- GRID UTILITIES ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(22,163,74,.3);
}

.card-dark {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  color: var(--white);
}
.card-dark:hover {
  border-color: rgba(22,163,74,.5);
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(22,163,74,.2);
}

/* ---- ICON BOX ---- */
.icon-box {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: rgba(22,163,74,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: var(--transition);
}
.icon-box-lg {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  font-size: 1.8rem;
}

/* ---- FORM ELEMENTS ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: 13px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .95rem;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.form-control::placeholder { color: var(--gray-400); }

textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { 
  cursor: pointer; 
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5c51'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}
select.form-control option {
  color: var(--gray-800);
  background-color: var(--white);
  padding: 10px;
}

.form-error { font-size: .82rem; color: #ef4444; margin-top: 5px; }
.form-success{
  padding: 14px 20px;
  background: rgba(22,163,74,.1);
  border: 1px solid rgba(22,163,74,.3);
  border-radius: var(--radius-md);
  color: var(--green-dark);
  font-weight: 500;
}

/* ---- ALERTS ---- */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert-success { background: rgba(22,163,74,.1); border-left: 3px solid var(--green-primary); color: var(--green-xdark); }
.alert-error   { background: rgba(239,68,68,.1);  border-left: 3px solid #ef4444; color: #7f1d1d; }
.alert-info    { background: rgba(59,130,246,.1);  border-left: 3px solid #3b82f6; color: #1e3a8a; }

/* ---- TAGS / PILLS ---- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-600);
}
.tag-green {
  background: rgba(22,163,74,.12);
  color: var(--green-dark);
}

/* ---- SCROLL TO TOP ---- */
.scroll-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 48px; height: 48px;
  background: var(--green-primary);
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-green);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 999;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}
.scroll-top:hover {
  background: var(--green-dark);
  transform: translateY(-3px);
}

/* ---- FLOATING WHATSAPP ---- */
.whatsapp-float {
  position: fixed;
  bottom: 88px; right: 32px;
  width: 56px; height: 56px;
  background: #25d366;
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(37,211,102,.45);
  transition: var(--transition);
  z-index: 999;
  animation: wa-pulse 3s ease infinite;
}
.whatsapp-float:hover {
  background: #1da851;
  transform: scale(1.1);
}
@keyframes wa-pulse {
  0%,100%{ box-shadow: 0 8px 24px rgba(37,211,102,.45); }
  50%    { box-shadow: 0 8px 40px rgba(37,211,102,.7); }
}

/* ---- LOADING OVERLAY ---- */
#page-loader {
  position: fixed; inset: 0;
  background: var(--dark-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .5s ease, visibility .5s ease;
}
#page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: .05em;
}
.loader-logo span { color: var(--green-light); }
.loader-bar {
  width: 240px; height: 3px;
  background: var(--dark-border);
  border-radius: 2px;
  margin: 24px auto 0;
  overflow: hidden;
}
.loader-bar::after {
  content: '';
  display: block;
  width: 0; height: 100%;
  background: linear-gradient(90deg, var(--green-primary), var(--green-light));
  border-radius: 2px;
  animation: load-bar 1.5s ease forwards;
}
@keyframes load-bar {
  to { width: 100%; }
}

/* ---- ANIMATIONS ---- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.delay-1 { transition-delay: .1s !important; }
.delay-2 { transition-delay: .2s !important; }
.delay-3 { transition-delay: .3s !important; }
.delay-4 { transition-delay: .4s !important; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  :root { --section-pad: 80px 0; --header-h: 72px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --section-pad: 64px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 16px; }
  .btn-lg { padding: 15px 30px; font-size: .95rem; }
  .card { padding: 24px; }
  .whatsapp-float { bottom: 80px; right: 20px; }
  .scroll-top { bottom: 24px; right: 20px; }
}
