/* Separación y protección de capa para los botones de portafolio superiores */
.portfolio-social-channels {
  position: relative !important;
  z-index: 60 !important;
  margin-bottom: 3.25rem !important;
  pointer-events: auto !important;
}

.brands-showcase-container {
  width: 100%;
  max-width: 1280px;
  margin: 3.25rem auto 1.5rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
}

/* Header del bloque de marcas */
.brands-showcase-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.brands-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.brands-badge-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5d0b5;
  box-shadow: 0 0 8px #f5d0b5;
}

/* Viewport 3D con límite vertical controlado */
.brands-3d-viewport {
  position: relative;
  width: 100%;
  height: 210px;
  margin: 0 auto;
  perspective: 1250px;
  perspective-origin: 50% 50%;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: grab;
}

.brands-3d-viewport:active,
.brands-3d-viewport.is-dragging {
  cursor: grabbing !important;
}

/* Escenario / Cilindro 3D */
.brands-3d-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Tarjeta individual de vidrio translúcido con separación nítida */
.brand-card-3d {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118px;
  height: 86px;
  translate: -50% -50%;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 14px;
  
  /* Vidrio Translúcido de Alta Gama (Liquid Glass / Frosted Obsidian) */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--brand-border, rgba(255, 255, 255, 0.12));
  border-top: 1px solid rgba(255, 255, 255, 0.38); /* Borde biselado superior reflectante */
  
  /* Leve glow distintivo del color más representativo del logo */
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), 
              0 0 20px var(--brand-glow, rgba(255, 255, 255, 0.12)),
              inset 0 1px 1px rgba(255, 255, 255, 0.15),
              inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  
  cursor: pointer;
  transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

/* Reflejo de luz interior en reposo */
.brand-card-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 70%);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

/* Imagen del logotipo contenida y encuadrada con precisión */
.brand-card-img {
  max-width: 86px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  display: block;
  
  /* Tono nítido y discreto en reposo */
  opacity: 0.88;
  filter: brightness(1) saturate(0.95);
  transform: translateZ(5px);
  transition: opacity 0.35s ease, 
              filter 0.35s ease, 
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   TOOLTIP / BADGE FLOTANTE CON NOMBRE DE MARCA Y BRILLO ENÉRGICO
   ========================================================================== */

.brand-name-badge {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translate3d(-50%, 0, 20px) scale(0.85);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  
  background: rgba(10, 10, 16, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85),
              0 0 14px var(--brand-glow, rgba(255, 255, 255, 0.18));
  
  overflow: hidden;
  z-index: 50;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
}

/* Estado Hover sobre la tarjeta (Exclusivo escritorio con ratón): resplandor del color corporativo */
@media (hover: hover) and (pointer: fine) {
  .brand-card-3d:hover {
    border-color: var(--brand-color, rgba(255, 255, 255, 0.55));
    border-top-color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.03) 100%);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75),
                0 0 36px var(--brand-glow, rgba(255, 255, 255, 0.35)),
                inset 0 1px 1px rgba(255, 255, 255, 0.4);
  }

  .brand-card-3d:hover::after {
    opacity: 1;
  }

  .brand-card-3d:hover .brand-card-img {
    opacity: 1;
    filter: brightness(1.15) saturate(1.12);
    transform: translateZ(15px) scale(1.06);
  }

  .brand-card-3d:hover .brand-name-badge {
    opacity: 1;
    visibility: visible;
    transform: translate3d(-50%, -26px, 32px) scale(1);
  }

  .brand-card-3d:hover .brand-sheen-beam {
    animation: brandBeamSweep 1.05s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  }
}

/* Texto de la marca con gradiente metálico y animación enérgica */
.brand-name-text {
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  
  background: linear-gradient(
    110deg,
    #cfcfd6 0%,
    #ffffff 25%,
    #ffe7a0 50%,
    #ffffff 75%,
    #cfcfd6 100%
  );
  background-size: 240% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandEnergeticTextSheen 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  position: relative;
  z-index: 2;
}

/* Haz de luz oblicuo ultra enérgico que cruza el badge */
.brand-sheen-beam {
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 25%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(245, 208, 181, 0.8) 70%,
    transparent 100%
  );
  transform: skewX(-28deg);
  pointer-events: none;
  z-index: 3;
}



/* Keyframes para el brillo enérgico */
@keyframes brandEnergeticTextSheen {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: -100% 50%;
  }
}

@keyframes brandBeamSweep {
  0% {
    transform: translateX(-120%);
  }
  60% {
    transform: translateX(220%);
  }
  100% {
    transform: translateX(220%);
  }
}

/* Indicador discreto de arrastre inferior */
.brands-drag-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.03em;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.brands-drag-hint svg {
  opacity: 0.6;
  animation: dragHandOscillate 2.4s ease-in-out infinite;
}

@keyframes dragHandOscillate {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ==========================================================================
   ADAPTACIÓN RESPONSIVA (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 768px) {
  .portfolio-social-channels {
    margin-bottom: 2.5rem !important;
  }

  .brands-showcase-container {
    margin-top: 2.25rem;
  }

  .brands-3d-viewport {
    height: 180px;
    perspective: 900px;
  }

  .brand-card-3d {
    width: 86px;
    height: 66px;
    padding: 6px 8px;
    border-radius: 12px;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(14, 16, 22, 0.88) !important;
    will-change: auto !important;
  }

  .brand-card-img {
    max-width: 64px;
    max-height: 40px;
  }

  .brand-name-badge {
    padding: 0.22rem 0.6rem;
  }

  .brand-name-text {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .portfolio-social-channels {
    margin-bottom: 2rem !important;
  }

  .brands-3d-viewport {
    height: 165px;
    perspective: 780px;
  }

  .brand-card-3d {
    width: 72px;
    height: 56px;
    padding: 5px 6px;
    border-radius: 10px;
  }

  .brand-card-img {
    max-width: 52px;
    max-height: 34px;
  }
}

/* Respetar accesibilidad para usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .brands-3d-stage {
    will-change: auto;
  }
  .brand-sheen-beam {
    animation: none !important;
  }
  .brand-name-text {
    animation: none !important;
  }
}
