/* ==========================
   Seinyor S.R.L. - Estilos
   Bootstrap 5 helper styles
   ========================== */

/* Contact Section */
#contacto .container {
  max-width: 1200px;
  margin: 0 auto;
}

#contacto .row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

#contacto .col-lg-6 {
  padding: 0 15px;
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  #contacto .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

#contacto .map-container {
  position: relative;
  padding-bottom: 75%;
  height: 0;
  overflow: hidden;
  border-radius: 0.375rem;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

#contacto .map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Fix for form height */
#contacto form {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#contacto .form-content {
  flex: 1;
}

/* Contact Section Layout */
#contacto .contact-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 992px) {
  #contacto .contact-container {
    flex-direction: row;
  }
  
  #contacto .contact-form,
  #contacto .contact-map {
    flex: 0 0 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }
}

:root{
  --bg-light: #fafaf8;
  --blue: #102742;
  --wine: #a11863;
  --beige: #cdc196;
  --metal: #89919b;
  --white: #ffffff;
  --dark: #0c1522;
}

html, body { background-color: var(--bg-light); }

/* Typography */
.section-title { color: var(--blue); font-weight: 700; }
.brand-text { color: var(--blue); }
/* Brand color utilities */
.text-brand-blue{ color: var(--blue) !important; }
.text-brand-wine{ color: var(--wine) !important; }
.text-brand-beige{ color: var(--beige) !important; }
.text-brand-metal{ color: var(--metal) !important; }

/* Preloader */
.preloader{
  position: fixed;
  inset: 0;
  background: var(--bg-light);
  display: grid;
  place-items: center;
  z-index: 2000; /* above floating buttons */
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease, visibility .5s ease;
}
.preloader.is-hidden{ opacity: 0; visibility: hidden; }
.preloader .pl-wrap{ display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem 1.25rem; text-align: center; }
.preloader .pl-logo{
  width: 104px; height: 104px; border-radius: 999px; display: grid; place-items: center;
  border: 3px solid var(--blue);
  box-shadow: 0 10px 28px rgba(16,39,66,.12), inset 0 0 0 6px rgba(16,39,66,.06);
  background: radial-gradient(circle at 35% 30%, rgba(16,39,66,.10), rgba(205,193,150,.08));
  animation: pl-pulse 1.8s ease-in-out infinite;
}
.preloader .pl-logo img{ width: 84px; height: 84px; object-fit: contain; border-radius: 50%; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }
.preloader .pl-text{ color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; }
.preloader .pl-dots{ display: inline-flex; }
.preloader .pl-dots span{ display: inline-block; margin-left: 2px; opacity: .25; animation: pl-dot 1.2s ease-in-out infinite; }
.preloader .pl-dots span:nth-child(2){ animation-delay: .2s; }
.preloader .pl-dots span:nth-child(3){ animation-delay: .4s; }
.preloader .pl-progress{ width: 220px; max-width: 62vw; height: 6px; background: rgba(16,39,66,.15); border-radius: 999px; overflow: hidden; }
.preloader .pl-bar{ width: 0%; height: 100%; background-image: linear-gradient(90deg, var(--wine), var(--beige)); transition: width .28s ease; }
.preloader .pl-percent{ margin-top: .15rem; font-size: .85rem; color: var(--metal); font-variant-numeric: tabular-nums; }
@keyframes pl-pulse{ 0%,100%{ transform: scale(1) } 50%{ transform: scale(1.04) } }
@keyframes pl-dot{ 0%{ opacity:.25 } 50%{ opacity:1 } 100%{ opacity:.25 } }
@media (prefers-reduced-motion: reduce){
  .preloader{ transition: none; }
  .preloader .pl-logo{ animation: none; }
  .preloader .pl-dots span{ animation: none; opacity: 1; }
  .preloader .pl-bar{ transition: none; }
}

/* Navbar */
.custom-nav{ transition: all .3s ease; background-color: rgba(255,255,255,0.95)!important; }
.custom-nav.scrolled{ box-shadow: 0 8px 20px rgba(0,0,0,.08); padding-top: .25rem; padding-bottom: .25rem; }
.nav-link{ color: var(--blue)!important; font-weight: 500; }
.nav-link:hover{ color: var(--wine)!important; }
.logo{ height: 80px; width: auto; object-fit: contain; transition: height .25s ease; }
.custom-nav.scrolled .logo{ height: 64px; }
@media (max-width: 575.98px) {
  .custom-nav.scrolled .logo{ height: 56px; }
}

/* Buttons */
.btn-primary{ background-color: var(--blue); border-color: var(--blue); }
.btn-primary:hover{ background-color: #0b1d33; border-color: #0b1d33; }
.btn-outline-light:hover{ color: var(--white); background-color: rgba(255,255,255,.15); }
.btn-success{ background-color: #25D366; border-color: #25D366; }

/* Emphasized download button */
.btn-download{
  background-image: linear-gradient(135deg, var(--blue), #0b1d33);
  border-color: #0b1d33;
  color: #fff;
  padding: .75rem 1rem;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  white-space: normal; /* allow wrapping on small screens */
  -webkit-tap-highlight-color: transparent; /* avoid grey overlay on iOS */
}
.btn-download:hover,
.btn-download:focus{
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16,39,66,.25);
}
.btn-download:active{
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(16,39,66,.22);
}

/* Download progress UI inside download buttons */
.btn-download .dl-progress{
  display: none;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.35);
  border-radius: 999px;
  overflow: hidden;
}
.btn-download .dl-progress-bar{
  width: 0%;
  height: 100%;
  background-image: linear-gradient(90deg, var(--wine), var(--beige));
  box-shadow: inset 0 0 1px rgba(0,0,0,.25);
  transition: width .2s ease;
}
.btn-download .dl-top{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  width: 100%;
  position: relative;
  z-index: 1; /* ensure label row is above any overlapping content */
}
.btn-download.is-loading{ cursor: progress; filter: brightness(1.02); display: flex; flex-direction: column; align-items: center; }
.btn-download.is-loading .dl-top{ margin-bottom: .35rem; }
.btn-download.is-loading .dl-progress{ display: block; }
.btn-download[aria-disabled="true"]{ pointer-events: none; opacity: 1; }

/* Ensure white text for all states and children (helps mobile contrast) */
.btn-download,
.btn-download:link,
.btn-download:visited,
.btn-download:hover,
.btn-download:active{ color: #fff !important; }
.btn-download .dl-label,
.btn-download .dl-dots,
.btn-download .dl-percent,
.btn-download i{ color: #fff !important; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* Blinking dots while downloading */
.btn-download .dl-dots{ display: inline-block; margin-left: 2px; }
.btn-download.is-loading .dl-dots{ animation: dl-blink .9s ease-in-out infinite; }
@keyframes dl-blink{ 0%{opacity:.25} 50%{opacity:1} 100%{opacity:.25} }

/* Slightly bolder label for readability */
.btn-download .dl-label{ font-weight: 700; }

/* Mobile-specific fixes: avoid filter text rendering issues on iOS Safari */
@media (max-width: 575.98px){
  .btn-download.is-loading{ filter: none; }
}

/* Hero */
.hero{
  position: relative;
  min-height: 85vh;
  background: url('../../img/imgi_22_1.jpg') center/cover no-repeat fixed;
}
.hero .overlay{
  position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,39,66,.80), rgba(137,145,155,.55)); z-index: 1;
}
.hero.video-bg{ position: relative; }
.hero-video{
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; background: #000; pointer-events: none;
  transform: translateZ(0);
}
@media (prefers-reduced-motion: reduce){
  .hero-video{ display: none; }
}
.section-bg-img{ position: relative; }
.section-bg-img .overlay{
  position: absolute; inset: 0; background: linear-gradient(135deg, rgba(16,39,66,.78), rgba(205,193,150,.40)); pointer-events: none; z-index: 0;
}
.section-bg-img > .container{ position: relative; z-index: 1; }
.hero .container{ position: relative; z-index: 2; }
.hero-logo{ max-height: 220px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.25)); border-radius: .5rem; }
@media (max-width: 991.98px){ /* tablets */
  .hero-logo{ max-height: 160px; }
}
@media (max-width: 575.98px){ /* phones */
  .hero-logo{ max-height: 90px; margin-top: 16px; }
}
@media (max-width: 400px){ /* extra small phones */
  .hero-logo{ max-height: 85px; margin-top: 20px; }
}

/* Image mosaic */
.image-mosaic{ display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.image-mosaic img:nth-child(1){ grid-column: span 2; }
.image-mosaic img{ width: 100%; height: auto; transition: transform .35s ease, box-shadow .35s ease; }
.image-mosaic img:not(:first-child){ height: 240px; object-fit: cover; }
.image-mosaic img:hover{ transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 26px rgba(0,0,0,.15); }
@media (max-width: 991.98px){ .image-mosaic img:not(:first-child){ height: 200px; } }
@media (max-width: 575.98px){ .image-mosaic img:not(:first-child){ height: 160px; } }

  /* Vintage photo effect for Nosotros mosaic */
  .image-mosaic--vintage{ position: relative; isolation: isolate; }
  .image-mosaic--vintage img{
    filter: sepia(.78) saturate(.74) contrast(.98) brightness(.94) hue-rotate(-12deg);
    transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
  }
  .image-mosaic--vintage img:hover{
    filter: sepia(.68) saturate(.8) contrast(1) brightness(.97) hue-rotate(-10deg);
  }
  .image-mosaic--vintage::after{
    content: ""; position: absolute; inset: -1.5%; pointer-events: none; z-index: 1;
    background:
      radial-gradient(ellipse at center, rgba(58,42,21,0) 52%, rgba(58,42,21,.33) 100%),
      linear-gradient(0deg, rgba(255,245,220,.09), rgba(255,245,220,.09));
    mix-blend-mode: multiply;
  }
@media (prefers-reduced-motion: reduce){
  .image-mosaic--vintage img{ transition: none; }
}

/* Services */
.section-bg-img.section-bg-1{ position: relative; background: url('../../img/IMG-20250730-WA0046.jpg') center/cover no-repeat fixed; }
.section-bg-img.section-bg-2{ position: relative; background: url('../../img/IMG-20250730-WA0048.jpg') center/cover no-repeat fixed; }
.service-card{ background: rgba(255,255,255,.92); border: none; border-radius: .75rem; transition: transform .3s ease, box-shadow .3s ease; }
.service-card:hover{ transform: translateY(-6px); box-shadow: 0 18px 36px rgba(0,0,0,.18); }
.service-icon{ color: var(--wine); }

/* Products */
.product-card{ border: none; overflow: hidden; border-radius: .75rem; box-shadow: 0 8px 24px rgba(0,0,0,.06); transition: transform .25s ease, box-shadow .25s ease; }
.product-card:hover{ transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.product-card .card-img-top{ height: 180px; object-fit: cover; }
/* Override when using logo inside cards for crisp, attention-grabbing display */
.product-card .product-logo.card-img-top{
  height: 180px;
  object-fit: contain;
  object-position: center;
  background: none;
  padding: 8px;
  border-radius: .5rem;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.06));
  image-rendering: -webkit-optimize-contrast; /* WebKit hint for sharper edges */
  image-rendering: crisp-edges; /* Fallback */
}
@media (max-width: 575.98px){
  .product-card .product-logo.card-img-top{ height: 160px; padding: 6px; }
}

/* Circular variant for product logos */
.product-card .product-logo.product-logo--circle{
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle at 35% 30%, rgba(16,39,66,.10), rgba(16,39,66,.06));
  padding: 14px;
  border: 3px solid var(--blue);
  box-shadow: 0 10px 22px rgba(0,0,0,.14), 0 0 0 6px rgba(16,39,66,.12);
  display: block;
  margin: 12px auto 0;
}
@media (max-width: 575.98px){
  .product-card .product-logo.product-logo--circle{
    width: 150px;
    height: 150px;
    padding: 12px;
    margin-top: 10px;
  }
}

/* Brands */
.brand{ 
  filter: grayscale(100%); 
  opacity: .75; 
  transition: all .3s ease; 
  height: clamp(100px, 22vw, 180px);
  width: auto;
  max-width: 100%;
  padding: 1rem;
  object-fit: contain;
}
.brand:hover{ 
  filter: grayscale(0%); 
  opacity: 1; 
  transform: scale(1.03); 
}

/* Carrusel de marcas */
#marcasCarousel {
  max-width: 1140px;
  margin: 0 auto;
}
@media (max-width: 575.98px){
  #marcasCarousel .carousel-control-prev,
  #marcasCarousel .carousel-control-next{ display: none; }
  /* reduce padding en columnas para dar más espacio a los logos */
  #marcasCarousel .p-3{ padding: .25rem !important; }
  .brand{ padding: .5rem; }
}
.carousel-control-prev,
.carousel-control-next {
  width: 5%;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-size: 1.5rem 1.5rem;
  opacity: 0.9;
}

/* Fabricación spotlight */
.video-spotlight{ position: relative; border-radius: .75rem; overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.video-spotlight video{ width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; background: #000; }
.video-spotlight .video-overlay-gradient{ position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.45) 75%); pointer-events: none; }
.video-spotlight .video-overlay-text{ position: absolute; left: 1rem; right: 1rem; bottom: 1rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.55); pointer-events: none; }
.video-spotlight .video-overlay-text .overlay-title{ font-weight: 700; }
.video-spotlight .video-overlay-text .overlay-subtitle{ opacity: .95; }
@media (max-width: 575.98px){
  .video-spotlight .video-overlay-text{ left: .75rem; right: .75rem; bottom: .75rem; }
  /* Full-bleed video on mobile (compensate container padding) */
  #servicios .video-spotlight{ 
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    border-radius: 0;
  }
}

/* Service gallery */
.service-gallery img{ width: 100%; height: 220px; object-fit: cover; }
@media (max-width: 991.98px){ .service-gallery img{ height: 200px; } }
@media (max-width: 575.98px){ .service-gallery img{ height: 160px; } }

.carousel-item {
  padding: 1rem 0;
}

/* Benefits */
.benefit{ margin-bottom: 1.5rem; }
.benefit i{ font-size: 1.5rem; min-width: 2rem; text-align: center; margin-top: 0.25rem; }

/* FAQ */
.accordion-button{ font-weight: 600; }
.accordion-button:not(.collapsed){ color: var(--blue); background-color: rgba(16,39,66,.06); }

/* Timeline */
.timeline{ position: relative; margin-left: .25rem; padding-left: 1.25rem; }
.timeline::before{
  content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px;
  background: rgba(16,39,66,.15);
}
.timeline-item{ position: relative; margin-bottom: 1rem; }
.timeline-icon{
  position: absolute; left: 12px; top: .5rem; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: var(--white);
  border: 2px solid var(--blue); color: var(--blue); display: grid; place-items: center;
  font-size: .75rem; z-index: 1; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.timeline-icon.ti-blue{ border-color: var(--blue); color: var(--blue); background: rgba(16,39,66,.06); }
.timeline-icon.ti-wine{ border-color: var(--wine); color: var(--wine); background: rgba(161,24,99,.08); }
.timeline-icon.ti-beige{ border-color: var(--beige); color: var(--beige); background: rgba(205,193,150,.18); }
.timeline-icon.ti-metal{ border-color: var(--metal); color: var(--metal); background: rgba(137,145,155,.14); }
.timeline-content{ margin-left: 2.5rem; }
@media (max-width: 575.98px){
  .timeline{ padding-left: 1.75rem; }
  .timeline::before{ left: 20px; width: 3px; background: rgba(16,39,66,.3); }
  .timeline-icon{ left: 20px; top: 1rem; width: 24px; height: 24px; font-size: .85rem; }
  .timeline-content{ margin-left: 3.75rem; }
  .timeline-item{ padding-top: .25rem; }
}

/* Contact */
.form-control:focus{ border-color: var(--wine); box-shadow: 0 0 0 .25rem rgba(161,24,99,.15); }

/* Footer */
.footer{ background: linear-gradient(180deg, var(--blue), var(--dark)); }
.hover-accent:hover{ color: var(--beige)!important; }
  
/* Social icons colors in footer */
.footer a[aria-label="Facebook"]{ color: #1877F2 !important; }
.footer a[aria-label="Facebook"]:hover,
.footer a[aria-label="Facebook"]:focus{ color: #1459b5 !important; }
  
.footer a[aria-label="Instagram"]{ color: #E4405F !important; }
.footer a[aria-label="Instagram"]:hover,
.footer a[aria-label="Instagram"]:focus{ color: #c0354c !important; }
 
/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1050;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  border: 2px solid #fff;
}

.whatsapp-float i {
  font-size: 1.75rem;
  transition: transform 0.2s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  filter: brightness(1.05);
}

.whatsapp-float:active {
  transform: translateY(-2px) scale(0.98);
}

/* Back to Top button */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 94px;
  z-index: 1049;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  outline: none;
}

.back-to-top i {
  font-size: 1.5rem;
  transition: transform 0.2s ease;
}

.back-to-top:hover,
.back-to-top:focus {
  background: #0b1d33;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top.show {
  opacity: 0.9;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top.show:hover {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .whatsapp-float {
    width: 56px;
    height: 56px;
    right: 16px;
    bottom: 20px;
  }
  
  .back-to-top {
    width: 48px;
    height: 48px;
    right: 16px;
    bottom: 86px;
  }
}

@media (max-width: 575.98px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    right: 12px;
    bottom: 16px;
  }
  
  .whatsapp-float i {
    font-size: 1.5rem;
  }
  
  .back-to-top {
    width: 44px;
    height: 44px;
    right: 12px;
    bottom: 78px;
  }
  
  .back-to-top i {
    font-size: 1.25rem;
  }
  
  .logo{ height: 64px; }
  /* Offset for fixed navbar on small screens to prevent overlap with hero title */
  main#inicio{ padding-top: 84px; padding-top: calc(84px + env(safe-area-inset-top)); }
}

/* Animations */
[data-animate]{ opacity: 0; transform: translateY(18px); }
/* Variants */
[data-animate="zoom-in"]{ transform: translateY(12px) scale(.94); filter: blur(3px); }
[data-animate="slide-in-right"]{ transform: translateX(24px); }
[data-animate="tilt-in"]{ transform: perspective(800px) rotateX(8deg) translateY(16px); transform-origin: top; }
.in-view{ opacity: 1 !important; transform: none !important; filter: none !important; transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1), filter .7s ease; }
@media (prefers-reduced-motion: reduce){
  [data-animate]{ opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
}

/* Utilities */
.bg-light-alt{ background-color: #f3f3ef; }

/* Responsive tweaks */
@media (max-width: 991.98px){
  .hero{ min-height: 70vh; background-attachment: scroll; }
}
@media (max-width: 575.98px){
  .whatsapp-float{ right: 14px; bottom: 18px; width: 50px; height: 50px; }
  .back-to-top{ right: 14px; bottom: 78px; width: 44px; height: 44px; }
}
