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

/* ====== LOADER DE CARGA ====== */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #1a2a44 0%, #243655 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  opacity: 1;
  visibility: visible;
}

#pageLoader.loader-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  animation: fadeInDown 0.6s ease-out;
}

.loader-logo {
  max-width: min(70vw, 360px);
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

/* Spinner de tres puntos pulsantes */
.loader-spinner {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.loader-spinner span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8bd8bd;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

.loader-spinner span:nth-child(2) {
  animation-delay: 0.2s;
  background: rgba(139, 216, 189, 0.7);
}

.loader-spinner span:nth-child(3) {
  animation-delay: 0.4s;
  background: rgba(139, 216, 189, 0.4);
}

@keyframes loaderPulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1.2); opacity: 1;   }
}

html {
  background-color: #1a2a44;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: linear-gradient(135deg, #1a2a44 0%, #243655 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

/* Glassmorphism utility */
.glass-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  max-width: 1000px;
  width: 90%;
}

.bloquePrincipal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeInDown 1s ease-out;
}

.logo-animate {
  max-width: 80%;
  height: auto;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}
.logo-animate:hover {
  transform: scale(1.05);
}

/* Sitio front positioning */
#sitioFront {
  margin-top: 2rem;
  text-align: center;
  animation: fadeInUp 1s ease-out 0.5s both;
}

#sitioWeb a {
  color: #8bd8bd;
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  letter-spacing: 2px;
}

#sitioWeb a:hover {
  color: #a7f2d7;
  text-shadow: 0 0 15px rgba(139, 216, 189, 0.6);
}

.bloqueSecundario {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin: 0 auto;
}

.estructura {
  flex: 1 1 400px;
}

.estructura h1 {
  font-size: 5rem;
  color: #8bd8bd;
  margin-bottom: -1rem;
  margin-top: 0;
  font-weight: 700;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.estructura h3 {
  font-size: 2.5rem;
  color: #fff;
  margin-top: 0;
  font-weight: 300;
  margin-bottom: 2rem;
  letter-spacing: 5px;
}
.text-content p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #e0e6ed;
  margin-bottom: 1.2rem;
  font-weight: 300;
}

/* Maps Container */
.mapouter, .gmap_canvas {
  width: 100%;
  max-width: 450px;
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin: 0 auto;
  transition: transform 0.3s ease;
}
.mapouter:hover {
  transform: translateY(-5px);
}
iframe#gmap_canvas {
  width: 100%;
  height: 100%;
}

.contact-info {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(0,0,0,0.2);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #8bd8bd;
}
.contact-info a {
  color: #8bd8bd;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s ease;
  font-weight: 600;
}
.contact-info a:hover {
  color: #fff;
}

#txtActivity {
  font-size: 2.5rem;
  color: #8bd8bd;
  font-weight: 700;
  display: block;
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

ul.services-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

ul.services-grid li {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 216, 189, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  font-size: 1.1rem;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  font-weight: 300;
  color: #e0e6ed;
}
ul.services-grid li:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
  border-color: #8bd8bd;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  color: #fff;
}

#botonesBrands {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-top: 4rem;
  width: 100%;
}
.brand-logo {
  filter: grayscale(100%) brightness(200%);
  opacity: 0.6;
  transition: all 0.3s ease;
  max-height: 45px;
  object-fit: contain;
}
.brand-logo:hover {
  filter: grayscale(0%) brightness(100%);
  opacity: 1;
  transform: scale(1.1);
}

#trabajosR {
  font-size: 2.5rem;
  color: #8bd8bd;
  text-align: center;
  margin-bottom: 2.5rem;
  font-weight: 700;
  width: 100%;
}

/* Galleria Responsiveness */
.galleria { 
  width: 100%; 
  max-width: 1000px;
  height: 60vh; 
  min-height: 400px;
  max-height: 600px;
  background: #111e33;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .bloqueSecundario {
    flex-direction: column;
    text-align: center;
  }
  .contact-info {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .estructura h1 { font-size: 3.5rem; }
  .estructura h3 { font-size: 1.5rem; }
  #txtActivity, #trabajosR { font-size: 2rem; }
  ul.services-grid { grid-template-columns: 1fr; }
  .galleria { height: 50vh; }
  .glass-panel { padding: 1.5rem; }
  #botonesBrands { gap: 1.5rem; }
  .brand-logo { max-height: 35px; }
}

/* Formulario de Contacto Elementos */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}
.form-group {
  width: 100%;
}
.form-control {
  width: 100%;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(139, 216, 189, 0.3);
  border-radius: 8px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
.form-control:focus {
  outline: none;
  border-color: #8bd8bd;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(139, 216, 189, 0.4);
}
textarea.form-control {
  resize: vertical;
  min-height: 120px;
}
.btn-submit {
  background: #8bd8bd;
  color: #1a2a44;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
  margin-top: 0.5rem;
}
.btn-submit:hover {
  background: #a7f2d7;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(139, 216, 189, 0.4);
}
.btn-submit:disabled {
  background: #666;
  color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.hidden-honeypot {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 0;
  width: 0;
  z-index: -1;
}
.form-response {
  text-align: center;
  font-weight: 600;
  margin-top: 10px;
  min-height: 24px;
}

/* ====== MOBILE OPTIMIZATION & IOS FIXES ====== */
/* Safe area padding for iOS and background fix */
body {
  /* Prevent white overscroll backgrounds on iOS */
  background-color: #1a2a44;
  overscroll-behavior-y: none;
}

#fullpage {
  /* Ensure backgrounds cover safe areas on notched phones */
  padding-bottom: env(safe-area-inset-bottom);
  padding-top: env(safe-area-inset-top);
  min-height: 100vh;
  box-sizing: border-box;
}

/* Base adjustment for smaller heights (e.g., landscape mobile) */
@media (max-height: 700px) {
  .estructura h1 { font-size: 3rem; margin-bottom: 0;}
  .estructura h3 { font-size: 1.5rem; margin-bottom: 0.5rem;}
  #txtActivity, #trabajosR { font-size: 1.5rem; margin-bottom: 1rem; }
  .glass-panel { padding: 1.5rem; }
  .galleria { height: 45vh; min-height: 300px; }
  .form-group { margin-bottom: 0.5rem; }
  .form-control { padding: 0.8rem; font-size: 0.9rem; }
  textarea.form-control { min-height: 80px; }
}

@media (max-width: 480px) {
  /* Extreme mobile portrait fixes */
  .fp-scrollable { 
    /* Enable internal scrolling if content overflows */
    overflow-y: auto !important; 
  }
  
  .glass-panel {
    padding: 1.2rem;
    width: 95%;
    /* Maximize space on small phones */
    margin: 1rem auto;
    border-radius: 12px;
  }
  
  .bloqueSecundario {
    gap: 1.5rem;
  }

  .estructura h1 { font-size: 2.8rem; }
  .text-content p { font-size: 1rem; line-height: 1.5; }
  
  .mapouter, .gmap_canvas {
    height: 250px;
  }
  
  ul.services-grid li {
    padding: 1rem;
    font-size: 0.95rem;
  }
  
  #botonesBrands {
    gap: 1rem;
    margin-top: 2rem;
  }
  
  .brand-logo { max-height: 30px; }
  
  #sitioWeb a { font-size: 1.2rem; }
  
  .galleria { 
    height: 35vh; 
    min-height: 250px; 
    border-radius: 8px;
  }
}

/* ====== FIX OVERLAP ON TALL SECTIONS ====== */
.fp-scrollable {
  /* Ensure the fullPage.js generated scrollable wrapper works on mobile */
  height: 100%;
}

.fp-scroller {
  /* Provide padding to the bottom of the scroller so content isn't flush with the edge */
  padding-bottom: 2rem;
}

/* ==== FIX MOBILE SCROLL ==== */
/* Automatically un-stick fullPage scroll behavior and flow like a normal website on mobile */
@media (max-width: 768px), (max-height: 700px) {
  
  html, body {
    height: auto !important;
    overflow-y: auto !important;
  }
  
  #fullpage, .fullpage-wrapper {
    height: auto !important;
    transform: none !important;
  }
  
  .section, .fp-section {
    height: auto !important;     /* Natural height */
    min-height: 100vh;           /* At least viewport size */
    padding: 2rem 1rem !important; /* Space so things don't touch edges */
    position: relative;
    /* Maintain the cool visual presentation but let regular touch flow smoothly */
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }
  
  /* Reset centerings for auto height */
  .fp-tableCell {
    display: block !important;
    height: auto !important;
  }
  
  /* Reset custom overlap fixes not needed anymore on mobile */
  .fp-scrollable { height: auto !important; }
  .fp-scroller { padding-bottom: 0; }
  
}

/* ====== FOOTER COPYRIGHT ====== */
.site-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.8;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.site-footer strong {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.footer-copy {
  margin: 0 0 0.3rem;
}

.footer-dev {
  margin: 0;
}

.footer-dev a {
  color: #8bd8bd;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-dev a:hover {
  color: #a7f2d7;
}

