/* =============================================
   SHW Soluciones — Styles
   Mobile-first responsive
   ============================================= */

:root {
  --navy: #0C2D48;
  --blue: #145DA0;
  --sky: #5BA4CF;
  --light: #B1D4E0;
  --pale: #EEF5FA;
  --white: #FFFFFF;
  --gray: #6B7280;
  --dark: #1E293B;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  line-height: 1.6;
}

picture {
  display: block;
}

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

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

/* ==========
   NAV
   ========== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: height 0.3s;
}

.nav.nav-open {
  height: 100vh;
  flex-wrap: wrap;
  align-content: flex-start;
  background: var(--white);
}

.nav-logo {
  height: 64px;
  width: auto;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: none;
  list-style: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  width: 100%;
  flex-grow: 1;
}

.nav-links.open {
  display: flex;
}

.nav-links a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 500;
  font-size: 1.1rem;
}

.nav-links a:hover {
  color: var(--blue);
}

.nav-links a.nav-cta {
  background: var(--blue);
  color: var(--white);
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.nav-links a.nav-cta:hover {
  background: var(--navy);
}

/* ==========
   HERO
   ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-slider {
  position: absolute;
  inset: 0;
  display: flex;
  animation: slideHero 16s ease-in-out infinite;
}

.hero-slide {
  min-width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.hero-slide:nth-child(1) {
  background-image: url('../assets/img/brigadas.jpg');
}

.hero-slide:nth-child(2) {
  background-image: url('../assets/img/simulacros.jpg');
}

.hero-slide:nth-child(3) {
  background-image: url('../assets/img/planes.jpg');
}

.hero-slide:nth-child(4) {
  background-image: url('../assets/img/procedimientos.jpg');
}

@keyframes slideHero {
  0%, 22% { transform: translateX(0); }
  25%, 47% { transform: translateX(-100%); }
  50%, 72% { transform: translateX(-200%); }
  75%, 97% { transform: translateX(-300%); }
  100% { transform: translateX(0); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(12, 45, 72, 0.85) 0%, rgba(20, 93, 160, 0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 5%;
  max-width: 650px;
}

.hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero h1 span {
  color: var(--light);
}

.hero p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary {
  background: var(--white);
  color: var(--navy);
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background: var(--pale);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  padding: 0.9rem 2rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

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

/* ==========
   ABOUT
   ========== */
.about {
  padding: 4rem 5%;
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.about-img {
  border-radius: 16px;
  overflow: hidden;
  height: 300px;
  position: relative;
}

.about-img picture {
  width: 100%;
  height: 100%;
}

.about-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-img-badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(12, 45, 72, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--white);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
}

.about-img-badge .num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--sky);
}

.about-img-badge .lbl {
  font-size: 0.75rem;
  color: var(--light);
  line-height: 1.4;
}

.about-content h2 {
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

.about-content p {
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-highlight {
  background: var(--pale);
  border-left: 4px solid var(--blue);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1.5rem;
}

.about-highlight p {
  color: var(--navy);
  font-weight: 600;
  margin: 0;
  font-style: italic;
}

/* ==========
   SERVICES
   ========== */
.services {
  padding: 4rem 5%;
  background: var(--pale);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.section-header h2 {
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 0.8rem;
}

.section-header p {
  color: var(--gray);
  font-size: 1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #e5e7eb;
  transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(12, 45, 72, 0.1);
}

.service-img {
  height: 200px;
  overflow: hidden;
}

.service-img picture {
  width: 100%;
  height: 100%;
}

.service-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.service-card:hover .service-img img {
  transform: scale(1.08);
}

.service-body {
  padding: 1.5rem;
}

.service-body h3 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.service-body p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.7;
}

/* ==========
   GALLERY
   ========== */
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  height: 250px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery picture {
  flex-shrink: 0;
  min-width: 70vw;
  height: 100%;
  scroll-snap-align: start;
  overflow: hidden;
}

.gallery picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========
   CTA
   ========== */
.cta-section {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  padding: 4rem 5%;
  text-align: center;
  color: var(--white);
}

.cta-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.btn-white {
  background: var(--white);
  color: var(--navy);
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-white:hover {
  background: var(--pale);
}

/* ==========
   FOOTER
   ========== */
.site-footer {
  background: var(--navy);
  color: var(--light);
  padding: 2rem 5%;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-logo {
  height: 40px;
  width: auto;
}

.site-footer p {
  font-size: 0.85rem;
}

.site-footer span {
  color: var(--sky);
  font-weight: 600;
}

/* ============================
   TABLET — min-width: 768px
   ============================ */
@media (min-width: 768px) {
  /* Nav */
  .nav-toggle {
    display: none;
  }

  .nav.nav-open {
    height: auto;
    flex-wrap: nowrap;
    align-content: center;
  }

  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    background: transparent;
    gap: 2rem;
    width: auto;
    flex-grow: 0;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  /* Hero */
  .hero h1 {
    font-size: 2.8rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  /* About */
  .about {
    padding: 5rem 5%;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .about-img {
    height: 420px;
  }

  .about-img-badge {
    bottom: 1.5rem;
    left: 1.5rem;
    padding: 1rem 1.5rem;
  }

  .about-img-badge .num {
    font-size: 1.8rem;
  }

  .about-img-badge .lbl {
    font-size: 0.8rem;
  }

  .about-content h2 {
    font-size: 2rem;
  }

  /* Services */
  .services {
    padding: 5rem 5%;
  }

  .section-header h2 {
    font-size: 2.2rem;
  }

  .section-header p {
    font-size: 1.05rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Gallery — desktop flex with hover */
  .gallery {
    overflow: hidden;
    scroll-snap-type: none;
    height: 300px;
  }

  .gallery picture {
    flex: 1;
    min-width: 16.66%;
    flex-shrink: 1;
    scroll-snap-align: unset;
    transition: flex 0.5s;
  }

  .gallery picture:hover {
    flex: 2;
  }

  .gallery picture img {
    filter: saturate(0.8);
    transition: filter 0.5s;
  }

  .gallery picture:hover img {
    filter: saturate(1);
  }

  /* CTA */
  .cta-section {
    padding: 5rem 5%;
  }

  .cta-section h2 {
    font-size: 2.2rem;
  }

  /* Footer */
  .site-footer {
    padding: 2.5rem 5%;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-text {
    text-align: right;
  }
}

/* ============================
   DESKTOP — min-width: 1024px
   ============================ */
@media (min-width: 1024px) {
  .hero h1 {
    font-size: 3.2rem;
  }

  .hero p {
    font-size: 1.15rem;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================
   REDUCED MOTION
   ============================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-slider {
    animation: none;
  }

  .service-card {
    transition: none;
  }

  .service-img img {
    transition: none;
  }

  .gallery picture {
    transition: none;
  }

  .gallery picture img {
    transition: none;
  }

  .nav-toggle span {
    transition: none;
  }

  .nav {
    transition: none;
  }
}
