/* ===================================
   ProAire - Estilos custom (desde pa_web_page)
   =================================== */

/* Logo del header: mismo tamaño que pa_web_page (it-business 55px) */
header .navbar-brand img {
  max-height: 55px;
}

/* Subtítulo de la sección page title: fondo blanco con opacidad de izquierda a derecha */
.page-title-extra-large > p {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.95));
  color: #252840 !important;
  padding: 8px 24px;
  border-radius: 100px;
  display: inline-block;
  font-weight: 600;
  opacity: 1 !important;
}

/* Header al hacer scroll: fondo azul ProAire en lugar de blanco */
header.sticky.sticky-active .header-reverse.glass-effect {
  background-color: #065290 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Enlaces y texto del header en scroll: blanco para leer sobre azul */
header.sticky.sticky-active .navbar-nav .nav-link,
header.sticky.sticky-active .custom-dropdown .dropdown-trigger,
header.sticky.sticky-active .dropdown-icon {
  color: #ffffff !important;
}
header.sticky.sticky-active .custom-dropdown .dropdown-trigger:hover {
  color: #ffffff !important;
  opacity: 0.9;
}
header.sticky.sticky-active .header-button .btn {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
}
header.sticky.sticky-active .header-button .btn:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}
/* Logo sigue siendo blanco en scroll (alt-logo ya se muestra) */
header.sticky.sticky-active .navbar-brand .alt-logo {
  visibility: visible;
  opacity: 1;
  width: auto;
}

.navbar-proaire {
  background-color: rgba(6, 82, 144, 0.8); /* Azul con 40% de opacidad */
}

.page-enter-active,
.page-leave-active {
  transition: opacity 0.3s;
}
.page-enter,
.page-leave-to {
  opacity: 0;
}

.client-box img {
  max-width: 100% !important;
}

.slider-card-title {
  min-height: 152px;
}

footer .footer-logo img {
  max-height: 96px;
}

/* Contenedor de la imagen */
.responsive-slider-card {
  width: 100%;
  height: 220px;              /* 👈 Ajusta este valor visualmente (200–240 ideal) */
  overflow: hidden;
  position: relative;
}

/* Imagen interna */
.responsive-slider-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* 🔥 Mantiene proporción y recorta sobrante */
  display: block;
}

/* La card completa ahora se comporta como columna */
.services-box-style-03 {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* El bloque blanco (contenido) crece para ocupar espacio */
.services-box-style-03 > .bg-white {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* El texto ocupa el espacio flexible */
.slider-card-title {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* El párrafo no empuja el botón */
.slider-card-title p {
  margin-bottom: 0;
}

/* El bloque del botón SIEMPRE se pega abajo */
.services-box-style-03 .border-top {
  margin-top: auto;
}

/* ===================================
   Productos - Cards del grid con mismo tamaño
   =================================== */
/* Evitar doble fondo: que el contenedor no muestre gris detrás de la card */
.products-index .grid-item,
.products-index .grid-item a {
  background: none !important;
}

.products-index .grid-item a {
  display: block;
  height: 100%;
}

.products-index .portfolio-box {
  display: flex;
  flex-direction: column;
  height: 330px;
  border-radius: 4px;
  overflow: hidden;
  /* Una sola sombra en la card completa, no en el bloque blanco por separado */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
}

.products-index .portfolio-image {
  height: 220px;
  flex-shrink: 0;
  overflow: hidden;
}

.products-index .portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.products-index .portfolio-box > .bg-white {
  flex-shrink: 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  /* Quitar sombra del bloque blanco para no duplicar con la de .portfolio-box */
  box-shadow: none !important;
}

/* ===================================
   Calculadores - Cards con mismo tamaño (como productos)
   =================================== */
.calculators-index .blog-grid,
.calculators-index .blog-wrapper {
  align-items: stretch;
}

.calculators-index .grid-item {
  display: flex;
  align-items: stretch;
}

/* Altura fija para que todas las cards se vean igual (el grid usa Isotope/masonry) */
.calculators-index .calculator-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 420px;
  min-height: 420px;
}

.calculators-index .blog-image {
  height: 200px;
  flex-shrink: 0;
  overflow: hidden;
}

.calculators-index .blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.calculators-index .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Sin descripción en las tarjetas de calculadores */
.calculators-index .card-body .calculator-description {
  display: none;
}

.calculators-index .card-body p {
  flex: 1;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Espacio debajo del botón Contáctanos para que la animación del footer no lo solape */
.calculators-index .calculators-cta-row {
  padding-bottom: 4rem;
}

.calculators-index .card-body .author {
  margin-top: auto;
  flex-shrink: 0;
}

/* Evitar que el hover del tema oculte el texto (blog-date/author-name animation) */
.calculators-index .card .author .blog-date,
.calculators-index .card:hover .author .blog-date {
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
}

/* "Actualizado el ..." en mayúsculas */
.calculators-index .calculator-updated {
  text-transform: uppercase;
}

/* Contador de descargas: icono y número alineados horizontalmente, múltiples dígitos en una sola línea */
.calculators-index .like-count {
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-width: fit-content;
}
.calculators-index .like-count .calculator-download-count {
  margin-left: 0;
  white-space: nowrap;
  display: inline-block;
}
/* Evitar que overflow-hidden del .author corte o apile los dígitos */
.calculators-index .card-body .author {
  overflow: visible;
}
.calculators-index .like-count:hover i,
.calculators-index .like-count:hover .calculator-download-count {
  color: var(--base-color) !important;
}

/* ===================================
   Popup suscripción calculadores (como pa_web_page SubscribePopup)
   =================================== */
.subscribe-popup-custom {
  width: 100%;
  max-width: 95vw;
  padding-left: 15px;
  padding-right: 15px;
}
.subscribe-popup-custom .container {
  max-width: 520px;
  margin: 0 auto;
}
.subscribe-popup-custom .subscribe-popup-close {
  top: 10px;
  right: 10px;
  font-size: 1.25rem;
  color: var(--dark-gray);
}
.subscribe-popup-custom .subscribe-popup-close:hover {
  color: var(--base-color);
}
/* Sin subrayado en X y "No gracias" */
.subscribe-popup-custom .subscribe-popup-close,
.subscribe-popup-custom button[data-close-subscribe-popup] {
  text-decoration: none !important;
}
.subscribe-popup-custom .subscribe-popup-close:hover,
.subscribe-popup-custom button[data-close-subscribe-popup]:hover {
  text-decoration: none !important;
}
/* Contenido del popup centrado */
.subscribe-popup-custom .newsletter-popup {
  text-align: center;
}

/* ===================================
   Header - Dropdown Productos (estilos pa_web_page)
   =================================== */
.custom-dropdown {
  position: relative;
}

.custom-dropdown .dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
  position: relative;
  outline: none !important;
  border: none;
  background: transparent;
  color: inherit;
  font-size: inherit;
  text-decoration: none;
}

.custom-dropdown .dropdown-trigger:focus {
  outline: none !important;
  box-shadow: none !important;
}

.custom-dropdown .dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

.custom-dropdown .dropdown-icon {
  transition: transform 0.3s ease;
  font-size: 10px;
  opacity: 0.8;
}

.custom-dropdown .dropdown-icon.rotated {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.95);
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  min-width: 280px;
  max-width: 320px;
  padding: 12px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid rgba(6, 82, 144, 0.1);
  backdrop-filter: blur(20px);
  will-change: transform, opacity;
}

.custom-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1px solid rgba(6, 82, 144, 0.1);
  border-top: 1px solid rgba(6, 82, 144, 0.1);
  transform: translateX(-50%) rotate(45deg);
}

.custom-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.custom-dropdown-menu .dropdown-item {
  display: block;
  padding: 12px 20px;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 2px 8px;
  border-radius: 10px;
  position: relative;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none !important;
  will-change: color, background-color;
}

.custom-dropdown-menu .dropdown-item:focus {
  outline: none !important;
  box-shadow: none !important;
}

.custom-dropdown-menu .dropdown-item:hover {
  color: #065290;
  background: rgba(6, 82, 144, 0.05);
}

.custom-dropdown-menu .dropdown-item::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 20px;
  width: 0;
  height: 2px;
  background: #065290;
  transition: width 0.3s ease;
}

.custom-dropdown-menu .dropdown-item:hover::after {
  width: calc(100% - 40px);
}

.navbar-nav .nav-link,
.navbar-nav .dropdown-trigger {
  outline: none !important;
}

.navbar-nav .nav-link:focus,
.navbar-nav .dropdown-trigger:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Móvil: dropdown integrado en menú colapsable */
@media (max-width: 991.98px) {
  .custom-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    border: none;
    opacity: 1;
    visibility: visible;
    max-width: none;
    min-width: auto;
  }

  .custom-dropdown-menu::before {
    display: none;
  }

  .custom-dropdown-menu .dropdown-item {
    padding: 12px 20px;
    margin: 0;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.8);
    white-space: normal;
  }

  .custom-dropdown-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  .custom-dropdown-menu .dropdown-item::after {
    background: #ffffff;
    bottom: 6px;
  }

  .custom-dropdown .dropdown-trigger {
    color: rgba(255, 255, 255, 0.8);
  }

  .custom-dropdown .dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
  }
}

/* Descripción en ficha de producto (estilo ProductDetail.vue) */
.markdown-content p { margin-bottom: 1em; }
.markdown-content ul,
.markdown-content ol { margin-left: 1.5em; margin-bottom: 1em; }
.markdown-content li { margin-bottom: 0.5em; }
.markdown-content + .alert { margin-top: 1rem; }
