/* ============================================================
   WINTER – SOLUCIONES DIGITALES
   Hoja de estilos principal
   ============================================================ */


/* ------------------------------------------------------------
   1. Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Paleta de colores */
  --color-bg:           #0a0a0a;
  --color-surface:      #111111;
  --color-surface-alt:  #161616;
  --color-surface-dark: #181818;
  --color-footer:       #050505;

  /* Texto */
  --color-text:         #f0f0f0;
  --color-text-muted:   #909090;
  --color-text-dim:     #555555;

  /* Acentos */
  --color-red:          #F0565A;
  --color-red-dark:     #d44447;
  --color-blue:         #003399;

  /* Bordes */
  --color-border:       rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(255, 255, 255, 0.16);

  /* Tipografía */
  --font:               'Lato', sans-serif;

  /* Formas */
  --radius:             0.75rem;
  --radius-sm:          0.5rem;

  /* Transiciones */
  --speed:              0.3s;
  --ease:               cubic-bezier(0.4, 0, 0.2, 1);
}


/* ------------------------------------------------------------
   2. Base y reset
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.72;
  font-size: 1rem;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--color-red);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

a:hover {
  color: var(--color-text);
}

/* Eliminar outline azul de Bootstrap en focus */
:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 3px;
}


/* ------------------------------------------------------------
   3. Tipografía
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  margin-bottom: 0;
}

/* Línea decorativa roja debajo del título */
.section-title-line {
  position: relative;
  padding-bottom: 1.25rem;
}

.section-title-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3rem;
  height: 3px;
  background: var(--color-red);
  border-radius: 2px;
}

/* En secciones con texto alineado a la izquierda */
.section-title-line.text-start::after {
  left: 0;
  transform: none;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
}


/* ------------------------------------------------------------
   4. Utilidades de layout
   ------------------------------------------------------------ */
.section-padding {
  padding: 6rem 0;
}

.text-muted-winter {
  color: var(--color-text-muted);
}


/* ------------------------------------------------------------
   5. Botones
   ------------------------------------------------------------ */
.btn-winter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  transition: background-color var(--speed) var(--ease),
              color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
  cursor: pointer;
  border: none;
}

.btn-winter-primary {
  background-color: var(--color-red);
  color: #fff;
}

.btn-winter-primary:hover {
  background-color: var(--color-red-dark);
  color: #fff;
  transform: translateY(-2px);
}

.btn-winter-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border-hover);
}

.btn-winter-outline:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

.btn-whatsapp {
  background-color: #25D366;
  color: #fff;
}

.btn-whatsapp:hover {
  background-color: #1bb855;
  color: #fff;
  transform: translateY(-2px);
}


/* ------------------------------------------------------------
   6. Navbar
   ------------------------------------------------------------ */
#navbar {
  padding: 1.375rem 0;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s var(--ease),
              border-color 0.4s var(--ease),
              padding 0.4s var(--ease),
              backdrop-filter 0.4s var(--ease);
}

#navbar.scrolled {
  background-color: rgba(8, 8, 8, 0.95);
  border-bottom-color: var(--color-border);
  padding: 0.875rem 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.navbar-brand img {
  height: 34px;
  width: auto;
}

.navbar-toggler {
  border: 1px solid var(--color-border-hover) !important;
  padding: 0.375rem 0.625rem;
  color: var(--color-text) !important;
}

.navbar-toggler:focus {
  box-shadow: none !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28240%2C240%2C240%2C0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-nav .nav-link {
  color: rgba(240, 240, 240, 0.8) !important;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.025em;
  padding: 0.5rem 0.875rem !important;
  position: relative;
  transition: color var(--speed) var(--ease);
}

/* Subrayado animado en los links */
.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0.1rem;
  left: 0.875rem;
  right: 0.875rem;
  height: 1px;
  background: var(--color-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--speed) var(--ease);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff !important;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  transform: scaleX(1);
}

/* Menú colapsado en móvil */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: rgba(10, 10, 10, 0.97);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
  }

  .navbar-nav .nav-link::after {
    display: none;
  }

  .navbar-nav .nav-link {
    padding: 0.625rem 0.5rem !important;
    border-bottom: 1px solid var(--color-border);
  }

  .navbar-nav .nav-item:last-child .nav-link {
    border-bottom: none;
  }
}


/* ------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------ */
#inicio {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  /* Fallback negro si la imagen no carga */
  background: url('../img/hero.jpg') center center / cover no-repeat var(--color-bg);
}

/* Capa de oscurecimiento con degradé */
#inicio::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.78) 42%,
    rgba(0, 0, 0, 0.56) 100%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 7rem;
  padding-bottom: 5rem;
  width: 100%;
}

.hero-logo {
  max-width: auto;
  width: auto;
  margin-bottom: 2rem;
}


.hero-divider {
  width: 3rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.hero-left-text {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.9);
  line-height: 1.6;
}

.hero-description {
  font-size: clamp(1.0625rem, 1.8vw, 1.25rem);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.78;
  font-weight: 300;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  margin-bottom: 2.5rem;
}


/* ------------------------------------------------------------
   8. Sección Soluciones
   ------------------------------------------------------------ */
#soluciones {
  background-color: var(--color-bg);
}

.solution-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  height: 100%;
  transition: border-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

.solution-card:hover {
  border-color: rgba(240, 86, 90, 0.5);
  transform: translateY(-5px);
}

.solution-card .card-icon {
  font-size: 2.25rem;
  color: var(--color-red);
  display: block;
  margin-bottom: 1.5rem;
  transition: transform var(--speed) var(--ease);
}

.solution-card:hover .card-icon {
  transform: scale(1.08);
}

.solution-card .card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  color: var(--color-text);
}

.solution-card .card-text {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin: 0;
}


/* ------------------------------------------------------------
   9. Cómo Trabajamos
   ------------------------------------------------------------ */
#como-trabajamos {
  background-color: var(--color-surface-dark);
}

.step-block {
  text-align: center;
  padding: 2.5rem 1.75rem;
  position: relative;
}

/* Separador vertical entre pasos (solo desktop) */
@media (min-width: 992px) {
  .step-block + .step-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--color-border);
  }
}

.step-number {
  display: block;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 0.875rem;
}

.step-icon {
  font-size: 2.75rem;
  color: var(--color-blue);
  display: block;
  margin-bottom: 1.375rem;
  line-height: 1;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.step-text {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.72;
  margin: 0;
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}


/* ------------------------------------------------------------
   10. Clientes
   ------------------------------------------------------------ */
#clientes {
  background-color: var(--color-bg);
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  align-items: center;
}

.client-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease);
  min-height: 90px;
  background-color: white;
}

.client-logo-wrap:hover {
  border-color: var(--color-border-hover);
}

.client-logo-wrap img {
  max-height: 75px;
  max-width: 150px;
  width: 100%;
  object-fit: contain;

  filter: grayscale(100%);
  opacity: 0.72;

  transition: filter 0.4s var(--ease), opacity 0.4s var(--ease);
}

/* Al hacer hover se muestra el color original */
.client-logo-wrap:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* Responsive del grid de clientes */
@media (max-width: 991.98px) {
  .client-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 575.98px) {
  .client-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
  }

  .client-logo-wrap {
    padding: 1rem 0.75rem;
    min-height: 72px;
  }

  .client-logo-wrap img {
    max-height: 40px;
  }
}


/* ------------------------------------------------------------
   11. Nosotros
   ------------------------------------------------------------ */
#nosotros {
  background-color: var(--color-surface);
}

.nosotros-text h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 900;
  margin-bottom: 1.75rem;
  position: relative;
  padding-bottom: 1.25rem;
}

/* Línea roja debajo del H2 */
.nosotros-text h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--color-red);
  border-radius: 2px;
}

.nosotros-text p {
  color: var(--color-text-muted);
  font-size: 1.0rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.nosotros-text p:last-child {
  margin-bottom: 0;
}

.nosotros-img {
  height: 100%;
}

.nosotros-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position:center;
  border-radius: var(--radius);
  min-height: 420px;
}


/* ------------------------------------------------------------
   12. Contacto
   ------------------------------------------------------------ */
#contacto {
  background-color: var(--color-bg);
}

.contact-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 3rem;
}

.contact-wrap h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* Inputs del formulario */
.form-control-w,
.form-control-w:focus {
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  transition: border-color var(--speed) var(--ease);
  box-shadow: none;
}

.form-control-w:focus {
  border-color: var(--color-red);
  box-shadow: none;
  outline: none;
}

.form-control-w::placeholder {
  color: var(--color-text-dim);
}

.form-label-w {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
}

/* Contador de caracteres */
.char-counter {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  text-align: right;
  margin-top: 0.375rem;
  transition: color var(--speed) var(--ease);
}

.char-counter.warning {
  color: var(--color-red);
}

/* Campo con error de validación */
.form-control-w.field-invalid {
  border-color: var(--color-red) !important;
}

.form-control-w.field-invalid:focus {
  border-color: var(--color-red) !important;
}

/* Mensaje de error AJAX */
.form-error {
  background: rgba(240, 86, 90, 0.12);
  border: 1px solid rgba(240, 86, 90, 0.4);
  color: var(--color-red);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Mensaje de éxito del formulario */
.form-success {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
}

.form-success i {
  font-size: 3rem;
  color: #25D366;
  display: block;
  margin-bottom: 1rem;
}

.form-success h4 {
  margin-bottom: 0.5rem;
}

.form-success p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Botón submit */
.btn-submit {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--color-red);
  color: #fff;
  border: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background-color: var(--color-red-dark);
  transform: translateY(-2px);
}


/* ------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------ */
footer {
  background-color: var(--color-footer);
  border-top: 1px solid var(--color-border);
  padding: 4rem 0 0;
}

.footer-logo img {
  height: 36px;
  width: auto;
  margin-bottom: 1.125rem;
}

.footer-company-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.625rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.72;
  max-width: 300px;
}

.footer-heading {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 1.375rem;
}

/* Items de contacto en el footer */
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.footer-contact-item i {
  color: var(--color-red);
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 1.25rem;
}

.footer-contact-item a {
  color: var(--color-text-muted);
  transition: color var(--speed) var(--ease);
}

.footer-contact-item a:hover {
  color: var(--color-text);
}

/* Iconos sociales */
.footer-social {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.25rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 1rem;
  transition: border-color var(--speed) var(--ease),
              color var(--speed) var(--ease);
}

.footer-social a:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

/* Línea inferior del footer */
.footer-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  padding: 1.375rem 0;
  text-align: center;
  color: var(--color-text-dim);
  font-size: 0.8rem;
}


/* ------------------------------------------------------------
   14. Botón flotante de WhatsApp
   ------------------------------------------------------------ */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  width: 3.375rem;
  height: 3.375rem;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  transition: background-color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}

.whatsapp-float:hover {
  background: #1bb855;
  color: #fff;
  transform: scale(1.1);
}

/* Pulso sutil de atención */
.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.28);
  animation: wa-pulse 2.4s ease-out infinite;
}

@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}


/* ------------------------------------------------------------
   15. Animaciones con Intersection Observer
   ------------------------------------------------------------ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease),
              transform 0.65s var(--ease);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Escalonado de aparición con data-delay */
.fade-up[data-delay="100"] { transition-delay: 0.1s; }
.fade-up[data-delay="150"] { transition-delay: 0.15s; }
.fade-up[data-delay="200"] { transition-delay: 0.2s; }
.fade-up[data-delay="300"] { transition-delay: 0.3s; }
.fade-up[data-delay="400"] { transition-delay: 0.4s; }
.fade-up[data-delay="500"] { transition-delay: 0.5s; }


/* ------------------------------------------------------------
   16. Responsive
   ------------------------------------------------------------ */
@media (max-width: 991.98px) {
  .section-padding {
    padding: 4.5rem 0;
  }

  .hero-logo {
    max-width: auto;
  }

  .nosotros-img img {
    min-height: 320px;
  }
}

@media (max-width: 767.98px) {
  .section-padding {
    padding: 3.5rem 0;
  }

  .contact-wrap {
    padding: 2rem 1.5rem;
  }

  .step-block {
    padding: 2rem 1.25rem;
  }

  .whatsapp-float {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
  }
}
