/* ============================================
   FORMOTEC - Custom Styles
   Tecnología para el Desarrollo Formoseño
   ============================================ */

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

/* ============================================
   CSS VARIABLES - FORMOTEC Brand Identity
   ============================================ */
:root {
  /* Brand Colors - Inspired by Formosa nature */
  --formotec-green-primary: #2d7a3e;
  --formotec-green-light: #4caf50;
  --formotec-green-dark: #1b5e20;
  --formotec-blue-primary: #1976d2;
  --formotec-blue-light: #42a5f5;
  --formotec-blue-dark: #0d47a1;
  --formotec-earth: #d84315;
  --formotec-earth-light: #ff6f43;
  --formotec-earth-dark: #bf360c;
  
  /* Neutral Colors */
  --formotec-dark: #1a1a1a;
  --formotec-gray-dark: #2c2c2c;
  --formotec-gray: #757575;
  --formotec-gray-light: #e0e0e0;
  --formotec-light: #f5f5f5;
  --formotec-white: #ffffff;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--formotec-green-primary) 0%, var(--formotec-blue-primary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--formotec-blue-light) 0%, var(--formotec-green-light) 100%);
  --gradient-warm: linear-gradient(135deg, var(--formotec-earth) 0%, var(--formotec-earth-light) 100%);
  --gradient-overlay: linear-gradient(135deg, rgba(45, 122, 62, 0.9) 0%, rgba(25, 118, 210, 0.9) 100%);
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 3rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 2rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Logo del navbar - Responsive */
.navbar-logo {
  height: 32px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  transition: height var(--transition-base);
}

/* Ajuste para tablets */
@media (max-width: 991px) {
  .navbar-logo {
    height: 28px;
  }
  
  .navbar-brand {
    font-size: 1.35rem;
  }
}

/* Ajuste para móviles */
@media (max-width: 576px) {
  .navbar-logo {
    height: 24px;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
}

/* Ajuste cuando el navbar hace scroll */
.navbar.scrolled .navbar-logo {
  height: 28px;
}

@media (max-width: 576px) {
  .navbar.scrolled .navbar-logo {
    height: 22px;
  }
}

.hero-logo-wrapper {
  display: flex;
  justify-content: center;
}

.hero-logo {
  height: 220px;
  width: auto;
  transform-origin: center;
}

.hero-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 3rem;
}

.hero-content .lead {
  margin-top: 0.25rem;
  margin-bottom: 0.3rem;
}

/* Subtítulo "Tecnología Formoseña para el Desarrollo" */
.hero-content .lead:first-of-type {
  margin-top: 0.35rem; /* más cerca del título y logo */
  font-size: 1.5rem;   /* más grande que la descripción */
  font-weight: 600;    /* un poco más de presencia */
  font-style: italic;
}

/* Descripción debajo del subtítulo (segunda lead) */
.hero-content .lead:nth-of-type(2) {
  font-size: 1.05rem;
  font-weight: 400;
  opacity: 0.95;
}

.hero-heading.visible .hero-logo {
  animation: heroLogoIn 0.8s var(--transition-base) forwards,
             heroLogoFloat 3s ease-in-out 0.8s infinite;
}

@keyframes heroLogoIn {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(10px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes heroLogoFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Responsive HERO (tablets y móviles) */
@media (max-width: 768px) {
  .hero-heading {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }

  .hero-logo {
    height: 150px;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important; /* centra y anula cualquier margen lateral */
  }

  .hero-title {
    font-size: 2.4rem;
    text-align: center;
  }

  .hero-content {
    padding-inline: 1.5rem;
    text-align: center;
  }

  .hero-content .lead {
    font-size: 0.98rem;
  }

  .hero-content .lead:first-of-type {
    font-size: 1.25rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
  }
}

/* Ajustes extra para celulares pequeños */
@media (max-width: 576px) {
  .hero {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  .hero-logo {
    height: 125px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-content .lead:first-of-type {
    font-size: 1.3rem;
  }

  .hero-content .lead:nth-of-type(2) {
    font-size: 0.95rem;
  }

  .hero-cta {
    margin-top: 1.25rem;
  }
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--formotec-dark);
  background-color: var(--formotec-white);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--formotec-blue-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--formotec-blue-light);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  background: rgba(26, 26, 26, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  padding: 1rem 0;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-lg);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform var(--transition-fast);
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  color: var(--formotec-white) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.dropdown-menu {
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  margin-top: 0.5rem;
}

.dropdown-item {
  color: var(--formotec-white);
  padding: 0.75rem 1.5rem;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--gradient-accent);
  color: var(--formotec-white);
  transform: translateX(5px);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--formotec-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--formotec-white);
}

.btn-secondary {
  background: transparent;
  color: var(--formotec-white);
  border: 2px solid var(--formotec-white);
}

.btn-secondary:hover {
  background: var(--formotec-white);
  color: var(--formotec-dark);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--gradient-warm);
  color: var(--formotec-white);
  box-shadow: var(--shadow-md);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--formotec-white);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--font-size-lg);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--formotec-dark);
  overflow: hidden;
  color: var(--formotec-white);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  z-index: 1;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--spacing-md);
  animation: fadeInUp 1s ease;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hero .lead {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 300;
  margin-bottom: 4%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
}

.hero-cta {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-indicator i {
  font-size: 2rem;
  color: var(--formotec-white);
  opacity: 0.7;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: var(--spacing-xl) 0;
}

.section-dark {
  background: var(--formotec-dark);
  color: var(--formotec-white);
}

.section-light {
  background: var(--formotec-light);
}

.section-gradient {
  background: var(--gradient-primary);
  color: var(--formotec-white);
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-title h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
}

.section-title p {
  font-size: var(--font-size-lg);
  color: var(--formotec-gray);
  max-width: 700px;
  margin: 0 auto;
}

.section-dark .section-title p {
  color: var(--formotec-gray-light);
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
  background: var(--formotec-white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  font-size: 2.5rem;
  color: var(--formotec-white);
}

.product-card h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-sm);
  color: var(--formotec-dark);
}

.product-card .subtitle {
  font-size: var(--font-size-sm);
  color: var(--formotec-gray);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.product-card p {
  color: var(--formotec-gray);
  flex-grow: 1;
  margin-bottom: var(--spacing-sm);
}

.product-card .badge {
  background: var(--gradient-accent);
  color: var(--formotec-white);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  font-weight: 600;
  display: inline-block;
  margin-bottom: var(--spacing-sm);
}

.product-card-link {
  color: var(--formotec-blue-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap var(--transition-fast);
}

.product-card-link:hover {
  gap: 1rem;
}

/* Featured Product Card */
.product-card.featured {
  border: 2px solid var(--formotec-green-primary);
  background: linear-gradient(135deg, rgba(45, 122, 62, 0.09) 0%, rgba(25, 118, 210, 0.12) 100%);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px); /* ya se ve más alta que las demás incluso sin hover */
}

/* Hover sutil para la destacada (sin desplazarla más que a las otras) */
.product-card.featured:hover {
  transform: translateY(-10px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
}

/* ============================================
   FEATURES GRID
   ============================================ */
.feature-item {
  text-align: center;
  padding: var(--spacing-md);
  transition: transform var(--transition-base);
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-icon {
  width: 100px;
  height: 100px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-sm);
  font-size: 3rem;
  color: var(--formotec-white);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.feature-item:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: var(--shadow-xl);
}

.feature-item h4 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-xs);
  color: var(--formotec-dark);
}

.feature-item p {
  color: var(--formotec-gray);
  font-size: var(--font-size-sm);
}

.section-dark .feature-item h4 {
  color: var(--formotec-white);
}

.section-dark .feature-item p {
  color: var(--formotec-gray-light);
}

/* ============================================
   WHY FORMOTEC SECTION
   ============================================ */
.why-card {
  background: var(--formotec-white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
}

.why-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.why-icon {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-sm);
}

.why-card h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-sm);
  color: var(--formotec-dark);
}

.why-card p {
  color: var(--formotec-gray);
}

/* ============================================
   FORMS
   ============================================ */
.form-control,
.form-select {
  border: 2px solid var(--formotec-gray-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--formotec-blue-primary);
  box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--formotec-dark);
  margin-bottom: 0.5rem;
}

.form-text {
  color: var(--formotec-gray);
  font-size: var(--font-size-sm);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--formotec-dark);
  color: var(--formotec-white);
  padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer h5 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--formotec-white);
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 0.5rem;
}

.footer a {
  color: var(--formotec-gray-light);
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--formotec-white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--spacing-sm);
  margin-top: var(--spacing-md);
  text-align: center;
  color: var(--formotec-gray-light);
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: all var(--transition-base);
  cursor: pointer;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-float i {
  font-size: 2rem;
  color: var(--formotec-white);
}

/* ============================================
   UTILITIES
   ============================================ */
.glassmorphism {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-shadow {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(25, 118, 210, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 118, 210, 0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
  }
  
  .hero {
    min-height: 70vh;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .product-card {
    margin-bottom: var(--spacing-md);
  }
  
  .whatsapp-float {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
  
  .whatsapp-float i {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .section {
    padding: var(--spacing-md) 0;
  }
}
