/* =====================================================
   PREVENCIÓN DE OVERFLOW HORIZONTAL
===================================================== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* =====================================================
   ANIMACIONES Y EFECTOS AVANZADOS
===================================================== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Elementos con animación */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* =====================================================
   UTILIDADES DE RELACIÓN DE ASPECTO
===================================================== */
.ratio-16x9 { position: relative; }
.ratio-16x9::before { content:""; display:block; padding-top:56.25%; }
.ratio-16x9 > * { position:absolute; inset:0; }

.ratio-4x3 { position: relative; }
.ratio-4x3::before { content:""; display:block; padding-top:75%; }
.ratio-4x3 > * { position:absolute; inset:0; }

/* =====================================================
   HERO / PARALLAX (INDEX)
===================================================== */
.parallax-bg{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transform: translateZ(0);
  will-change: transform, background-position;
}
.hero-grid-lines{
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.7) 0%, transparent 70%);
}
@media (prefers-reduced-motion: reduce){
  .parallax-bg{ background-attachment: scroll !important; transform: none !important; }
}

/* =====================================================
   BANNER (mails corporativos)
===================================================== */
.section-banner{
  background-image: url('/img/fondo.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  min-height: 320px;
}

/* =====================================================
   SWIPER: BULLETS Y AJUSTES
===================================================== */
.swiper { overflow: hidden; }
.swiper-pagination-bullet{
  width: 8px; height: 8px; opacity: .6; background: #fff;
}
.swiper-pagination-bullet-active{
  opacity: 1; transform: scale(1.25); background: #f97316;
}
.montage-swiper, .anclaje-swiper { padding-left: 6px; padding-right: 6px; }

/* =====================================================
   WhatsApp FAB
===================================================== */
.wa-fab{
  width:64px; height:64px; border:0; border-radius:9999px;
  background:#25D366; color:#fff; display:flex; align-items:center; justify-content:center;
  box-shadow:0 12px 30px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.18);
  cursor:pointer; transition:transform .15s ease, box-shadow .15s ease;
}
.wa-fab:hover{ transform:translateY(-2px); box-shadow:0 16px 34px rgba(0,0,0,.28), 0 3px 10px rgba(0,0,0,.20); }
.wa-fab svg{ width:34px; height:34px; }

.wa-popover{ position:absolute; right:80px; bottom:0; transform:translateY(-8px); }
.wa-popover-content{
  background:rgba(0,0,0,.85); color:#fff; padding:12px 14px; border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.35); backdrop-filter:blur(6px); max-width:260px;
}
.wa-popover:after{
  content:""; position:absolute; right:-8px; bottom:16px;
  border-width:8px; border-style:solid; border-color:transparent transparent transparent rgba(0,0,0,.85);
}
.wa-sub{ font-size:.85rem; opacity:.9; margin-top:2px; }
.wa-popover-btn{
  display:inline-block; margin-top:10px; background:#25D366; color:#fff; text-decoration:none;
  padding:8px 12px; border-radius:10px; font-weight:600;
}
.hidden{ display:none; }

/* =====================================================
   ALIANZAS – grid y tarjetas
===================================================== */
.ally-grid{
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 640px){
  .ally-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 1024px){
  .ally-grid{ gap: 22px; }
}
.ally-card{
  position: relative; background: #fff; border-radius: 18px; border: 1px solid rgba(2,6,23,.08);
  box-shadow: 0 10px 30px rgba(2,6,23,.06); padding: 18px 16px 14px 16px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.ally-card:hover{
  transform: translateY(-3px); box-shadow: 0 18px 40px rgba(2,6,23,.10);
  border-color: rgba(234,88,12,.25);
}
.ally-inner{ display: grid; place-items: center; height: 120px; }
@media (min-width: 768px){ .ally-inner{ height: 150px; } }
.ally-logo{
  max-width: 90%; max-height: 120px; object-fit: contain;
  filter: grayscale(100%); opacity: .85; transition: transform .25s ease, filter .25s ease, opacity .25s ease;
}
.ally-card:hover .ally-logo{ transform: scale(1.03); filter: grayscale(0%); opacity: 1; }
.ally-cap{ text-align:center; margin-top:8px; font-weight:700; font-size:.95rem; color:#0f172a; opacity:.85; }

/* =====================================================
   HERO servicios (fondo izaje)
===================================================== */
.hero-servicios{
  background-image:
    linear-gradient(rgba(255,140,0,.25), rgba(255,140,0,.25)),
    url('/img/izaje2.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
  min-height: 380px;
}
.hero-grid{
  position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.85) 0%, transparent 72%);
}

/* =====================================================
   LIGHTBOX (pantalla completa) – servicios
===================================================== */
#lightbox{ display: none; }
#lightbox:not(.hidden){ display: flex; }

.lightbox-swiper{
  width: 100%;
  max-width: 1200px;
  position: relative;
}

.lightbox-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

@media (min-width: 768px){
  .lightbox-swiper .swiper-slide { height: 80vh; }
}
@media (max-width: 767.98px){
  .lightbox-swiper .swiper-slide { height: 70vh; }
}

#lightboxClose{
  background: transparent;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
}
#lightboxClose:hover{ background: rgba(255,255,255,.08); }

/* =====================================================
   Botón "Pantalla completa" (lupa)
===================================================== */
.lb-btn{
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 25;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(0,0,0,.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.lb-btn:hover{
  transform: scale(1.05);
  background: rgba(0,0,0,.6);
  border-color: rgba(255,255,255,.7);
}
.lb-btn:active{ transform: scale(0.98); }
.lb-btn:focus{
  outline: 2px solid #fb923c;
  outline-offset: 2px;
}

/* Botón premium para galerías estáticas */
.lb-btn-premium{
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 30;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.8);
  background: linear-gradient(135deg, rgba(249,115,22,.95), rgba(234,88,12,.95));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .3s ease;
  box-shadow: 0 8px 20px rgba(234,88,12,.4);
  opacity: 0;
}
.group\/img:hover .lb-btn-premium{
  opacity: 1;
}
.lb-btn-premium:hover{
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 28px rgba(234,88,12,.6);
  border-color: rgba(255,255,255,1);
}
.lb-btn-premium:active{
  transform: scale(1.05) rotate(90deg);
}
.lb-btn-premium:focus{
  outline: 3px solid #fb923c;
  outline-offset: 3px;
}

/* =====================================================
   BESS (carrusel) – límite de ancho en escritorio
===================================================== */
.bess-block .swiper {
  max-width: 800px;
  margin: 0 auto;
}
.bess-block .swiper-slide img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
}
@media (min-width: 1024px) {
  .bess-block .swiper { max-width: 70%; }
  .bess-swiper-dev .ratio-4x3,
  .bess-swiper-fin .ratio-4x3{
    width: 60%;
    margin-left: auto;
    margin-right: auto;
  }
  .bess-swiper-dev .swiper-slide > p,
  .bess-swiper-fin .swiper-slide > p{
    max-width: 60%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* =====================================================
   Montaje / Anclaje – galería fija
===================================================== */
.gallery{
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px){
  .gallery{
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}
.gallery .gallery-item figcaption{
  text-align: center;
}
.montage-grid img,
.anclaje-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =====================================================
   Flechas overlay para carruseles
===================================================== */
.ov-prev, .ov-next{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(234,88,12,.35);
  background: linear-gradient(180deg, rgba(249,115,22,.95), rgba(234,88,12,.95));
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(234,88,12,.35);
  transition: transform .12s ease, box-shadow .12s ease, opacity .2s ease;
  opacity: .95;
}
.ov-prev{ left: 8px; }
.ov-next{ right: 8px; }
.ov-prev:hover, .ov-next:hover{
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 14px 26px rgba(234,88,12,.45);
}

@media (hover:hover){
  .swiper:hover .ov-prev,
  .swiper:hover .ov-next{ opacity: 1; }
}

.lightbox-swiper .ov-prev{ left: 6px; }
.lightbox-swiper .ov-next{ right: 6px; }

/* =====================================================
   EFECTOS VISUALES PREMIUM
===================================================== */

/* Glassmorphism avanzado */
.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sombras profundas */
.shadow-premium {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

.shadow-premium-lg {
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 12px 20px -8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Efectos de hover mejorados */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 30px 60px -15px rgba(234, 88, 12, 0.3),
    0 15px 25px -10px rgba(234, 88, 12, 0.2);
}

/* Bordes animados */
.border-gradient {
  position: relative;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #f97316, #ea580c, #f97316) border-box;
  border: 2px solid transparent;
  border-radius: 1rem;
}

/* Efectos de texto */
.text-gradient {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #c2410c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Partículas decorativas */
.decorative-dots {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(249, 115, 22, 0.15) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.3;
  pointer-events: none;
}

/* Líneas decorativas */
.decorative-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f97316, transparent);
  opacity: 0.3;
}

/* Efecto de brillo en hover */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.shine-effect:hover::before {
  left: 100%;
}

/* Header mejorado */
header {
  backdrop-filter: blur(12px) saturate(180%);
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/* Footer mejorado */
footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #f97316, transparent);
}

/* Botones premium */
.btn-premium {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f97316, #ea580c);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-premium:hover {
  box-shadow: 0 15px 40px rgba(249, 115, 22, 0.6);
  transform: translateY(-2px);
}

.btn-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-premium:hover::before {
  left: 100%;
}

/* =====================================================
   PREMIUM CAROUSEL STYLES
===================================================== */

/* Carousel wrapper - SIN padding excesivo */
.carousel-wrapper {
  position: relative;
  margin: 0 auto;
  max-width: 100%;
  overflow: visible;
}

/* Carousel container */
.carousel-premium {
  padding: 0 8px;
  position: relative;
  overflow: visible;
}

/* Carousel card wrapper */
.carousel-card {
  position: relative;
  height: 100%;
}

/* Card inner with premium effects */
.carousel-card-inner {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
  border-radius: 1.25rem;
  padding: 10px;
  height: 100%;
  box-shadow:
    0 12px 35px rgba(2,6,23,.09),
    0 4px 12px rgba(2,6,23,.05),
    inset 0 1px 0 rgba(255,255,255,.9);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(234,88,12,.1);
}

.carousel-card:hover .carousel-card-inner {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 25px 60px rgba(234,88,12,.18),
    0 12px 28px rgba(234,88,12,.12),
    inset 0 1px 0 rgba(255,255,255,1);
  border-color: rgba(234,88,12,.35);
}

/* Carousel image */
.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-card:hover .carousel-img {
  transform: scale(1.08);
}

/* Decorative corners mejorados */
.carousel-corners::before,
.carousel-corners::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(249,115,22,.7);
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 20;
}

.carousel-corners::before {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 6px;
}

.carousel-corners::after {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 6px;
}

.group\/slide:hover .carousel-corners::before,
.group\/slide:hover .carousel-corners::after {
  opacity: 1;
  border-color: rgba(249,115,22,.95);
}

/* Enhanced pagination */
.carousel-pagination {
  margin-top: 28px !important;
  position: relative !important;
}

.carousel-pagination .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: rgba(100,116,139,.35);
  opacity: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 6px !important;
}

.carousel-pagination .swiper-pagination-bullet:hover {
  background: rgba(100,116,139,.6);
  transform: scale(1.2);
}

.carousel-pagination .swiper-pagination-bullet-active {
  width: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 6px 16px rgba(249,115,22,.5);
  transform: scale(1.1);
}

/* Premium navigation arrows - MEJORADOS */
.carousel-nav-prev,
.carousel-nav-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 3px solid rgba(234,88,12,.4);
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  color: #ea580c;
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 12px 30px rgba(234,88,12,.25),
    0 4px 12px rgba(0,0,0,.08);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  user-select: none;
  overflow: hidden;
}

.carousel-nav-prev {
  left: 8px;
}

.carousel-nav-next {
  right: 8px;
}

.carousel-nav-prev:hover,
.carousel-nav-next:hover {
  transform: translateY(-50%) scale(1.15);
  box-shadow:
    0 18px 40px rgba(234,88,12,.4),
    0 8px 20px rgba(0,0,0,.12);
  border-color: rgba(234,88,12,.7);
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  color: #c2410c;
}

.carousel-nav-prev:active,
.carousel-nav-next:active {
  transform: translateY(-50%) scale(1.05);
}

/* Desktop: Botones más afuera pero controlados */
@media (min-width: 1024px) {
  .carousel-nav-prev {
    left: -16px;
  }

  .carousel-nav-next {
    right: -16px;
  }
}

/* Efecto de pulso para llamar atención */
@keyframes pulse-nav {
  0%, 100% {
    box-shadow:
      0 12px 30px rgba(234,88,12,.25),
      0 4px 12px rgba(0,0,0,.08);
  }
  50% {
    box-shadow:
      0 12px 30px rgba(234,88,12,.4),
      0 4px 12px rgba(0,0,0,.12);
  }
}

.carousel-nav-prev,
.carousel-nav-next {
  animation: pulse-nav 3s ease-in-out infinite;
}

/* Efecto de brillo en los botones */
@keyframes shine {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 150%;
  }
}

.carousel-nav-prev::before,
.carousel-nav-next::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.6),
    transparent
  );
  transform: skewX(-25deg);
  animation: shine 4s infinite;
  pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .carousel-nav-prev,
  .carousel-nav-next {
    width: 52px;
    height: 52px;
    font-size: 28px;
  }
}

@media (max-width: 640px) {
  .carousel-nav-prev,
  .carousel-nav-next {
    width: 46px;
    height: 46px;
    font-size: 24px;
    border-width: 2px;
  }

  .carousel-nav-prev {
    left: 4px;
  }

  .carousel-nav-next {
    right: 4px;
  }
}
