/* Banner */

.banner {
  width: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 85dvh;
  perspective: 2000px;
  margin: 0 auto;
}

.slider {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(-8deg);
  transform-style: preserve-3d;
  width: 540px;
  height: 380px;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.slider:hover {
  animation-play-state: paused;
}

@keyframes auto-rotate {
  from {
    transform: translate(-50%, -50%) rotateX(-8deg) rotateY(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotateX(-8deg) rotateY(360deg);
  }
}

.item {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: visible;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px var(--border-soft);
}

/* Distribución de 5 elementos */
.item:nth-child(1) {
  transform: rotateY(0deg) translateZ(420px);
}

.item:nth-child(2) {
  transform: rotateY(72deg) translateZ(420px);
}

.item:nth-child(3) {
  transform: rotateY(144deg) translateZ(420px);
}

.item:nth-child(4) {
  transform: rotateY(216deg) translateZ(420px);
}

.item:nth-child(5) {
  transform: rotateY(288deg) translateZ(420px);
}

.item:hover {
  /* transform: rotateY(calc(var(--ry) * 1deg)) translateZ(520px) scale(1.1) !important; */
  z-index: 20;
  box-shadow:
    var(--shadow-hover),
    0 0 0 1px var(--border-light),
    0 0 30px rgba(14, 165, 233, 0.4);
}

.item-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-gradient);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  transition: all 0.4s ease;
}

.item:hover .item-inner {
  background: var(--card-hover);
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
}

.item-logo {
  width: 80px;
  height: 80px;
  margin: 5px 5px 5px 5px;
  background: linear-gradient(135deg, #fff, #f8fafc);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.item:hover .item-logo {
  transform: scale(1.05);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(14, 165, 233, 0.4);
  border-color: rgba(14, 165, 233, 0.3);
}

.item-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.4s ease;
}

.item:hover .item-logo img {
  transform: scale(1.05);
}

.item-text {
  display: flex;
  flex-direction: column;
}

.item-title {
  margin: 0;
  font-size: 1em;
  color: var(--text-light);
}

.item-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-soft);
}

.item-subtitle {
  margin: 2px 0 0;
  font-size: 0.8em;
  color: var(--text-accent);
  opacity: 0.9;
  font-weight: 500;
  line-height: 1.4;
}

.item-content {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
}

.item-info {
  font-size: 1em;
  line-height: 1.6;
  /* MEJORADO de 0.7 a 1.6 para mejor legibilidad */
  color: rgba(255, 255, 255, 0.9);
  overflow-y: auto;
  padding-right: 5px;
  max-height: 200px;
  flex-grow: 1;
  margin-top: 10px;
}

.item-info::-webkit-scrollbar {
  width: 5px;
}

.item-info::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.item-info::-webkit-scrollbar-thumb {
  background: var(--accent-gradient);
  border-radius: 10px;
}

.item-info div {
  margin-bottom: 8px;
  /* padding-bottom: 8px; */
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.item-info div:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.item-info strong {
  color: var(--accent-light);
  font-weight: 600;
  display: inline-block;
  margin-right: 4px;
}

/* Indicador de filial activa */
.active-indicator {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.item:hover .active-indicator {
  width: 80px;
}

/* Título principal - MEJORADO */
.title-section {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  width: 100%;
}

.main-title {
  font-family: "Ica Rubrik", sans-serif;
  font-size: 2.2em;
  background: linear-gradient(
    90deg,
    #f8fafc,
    var(--accent-light),
    var(--accent-blue),
    #3b82f6
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: -1px;
  margin-bottom: 10px;
  animation: titleGlow 4s ease-in-out infinite alternate;
  background-size: 300% 100%;
}

@keyframes titleGlow {
  0% {
    text-shadow:
      0 4px 12px rgba(0, 0, 0, 0.3),
      0 0 20px rgba(14, 165, 233, 0.15);
    background-position: 0% 50%;
  }

  100% {
    text-shadow:
      0 4px 12px rgba(0, 0, 0, 0.3),
      0 0 30px rgba(14, 165, 233, 0.25),
      0 0 40px rgba(59, 130, 246, 0.15);
    background-position: 100% 50%;
  }
}

.subtitle {
  font-size: 1em;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  /* MEJORADO de 400 a 500 */
  letter-spacing: 1.5px;
  /* MEJORADO de 1px a 1.5px */
  text-transform: uppercase;
}

/* Controles de navegación */
.controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 20px;
  align-items: center;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  color: var(--text-light);
  font-size: 1.2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.control-btn:hover {
  background: var(--accent-gradient);
  transform: scale(1.1);
  border-color: transparent;
  box-shadow: 0 5px 20px rgba(14, 165, 233, 0.4);
}

.play-pause {
  width: 60px;
  height: 60px;
  font-size: 1.3em;
  background: var(--accent-gradient);
  border: none;
  box-shadow: 0 5px 20px rgba(14, 165, 233, 0.3);
}

/* Fondo decorativo - MEJORADO */
.silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50dvh;
  background:
    linear-gradient(to top, rgba(10, 25, 47, 0.9) 0%, transparent 100%),
    radial-gradient(
      ellipse at center bottom,
      rgba(30, 64, 175, 0.25) 0%,
      rgba(30, 64, 175, 0.1) 40%,
      transparent 70%
    );
  pointer-events: none;
  z-index: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .slider {
    width: 540px;
    height: 300px;
  }

  .item:nth-child(n) {
    transform: rotateY(calc(var(--ry) * 1deg)) translateZ(380px);
  }

  .item:hover {
    transform: rotateY(calc(var(--ry) * 1deg)) translateZ(480px) scale(1.08) !important;
  }
}

@media (max-width: 992px) {
  .main-title {
    font-size: 2.5em;
  }

  .slider {
    width: 500px;
    height: 300px;
  }

  .item:nth-child(n) {
    transform: rotateY(calc(var(--ry) * 1deg)) translateZ(350px);
  }
}

@media (max-width: 768px) {
  .main-title {
    font-size: 1.8em;
    top: 20px;
  }

  .subtitle {
    font-size: 0.8em;
  }

  .slider {
    width: 420px;
    height: 400px;
    top: 55%;
  }

  .item:nth-child(n) {
    transform: rotateY(calc(var(--ry) * 1deg)) translateZ(320px);
  }

  .item:hover {
    transform: rotateY(calc(var(--ry) * 1deg)) translateZ(400px) scale(1.06) !important;
  }

  .item-logo {
    width: 80px;
    height: 80px;
  }

  .item-title {
    font-size: 1.2em;
  }

  .item-subtitle {
    font-size: 0.8em;
  }

  .controls {
    bottom: 20px;
  }

  .control-btn {
    width: 45px;
    height: 45px;
  }

  .play-pause {
    width: 55px;
    height: 55px;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 2em;
  }

  .subtitle {
    font-size: 0.9em;
  }

  .title-section {
    top: 90px;
  }

  .carousel-container {
    height: auto;
  }

  .slider {
    width: 280px;
    height: 340px;
  }

  .item-logo {
    width: 100px;
    height: 100px;
  }

  .item-title {
    font-size: 1.4em;
  }

  .item-subtitle {
    font-size: 0.85em;
  }

  .item-info {
    font-size: 0.85em;
  }

  .controls {
    gap: 15px;
  }
}

/* Estilos específicos para árabe  */
body.arabic-font .item-info {
  font-size: 1em !important;
  /* En lugar de 0.8em normal */
  line-height: 1.8 !important;
  font-weight: 500 !important;
}

body.arabic-font .item-subtitle {
  font-size: 1.05em !important;
  /* En lugar de 1em normal */
  font-weight: 600 !important;
}

body.arabic-font .item-title {
  font-size: 1.3em !important;
  /* En lugar de 1.2em normal */
  font-weight: 700 !important;
}

/* Mejorar legibilidad del texto árabe */
body.arabic-font .item {
  font-family: "Arial", "Segoe UI", Tahoma, Geneva, sans-serif !important;
  letter-spacing: 0.5px !important;
}

body.arabic-font .item-info strong {
  font-weight: 700 !important;
}

/* Indicadores móviles */
.mobile-indicators {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.indicator-dots {
  display: flex;
  gap: 10px;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.indicator-dot.active {
  background: var(--accent-gradient);
  transform: scale(1.3);
}

.swipe-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.swipe-hint i {
  font-size: 0.9em;
  animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(5px);
  }
}

/* Mostrar controles móviles solo en dispositivos pequeños */
@media (max-width: 768px) {
  .mobile-indicators {
    display: none;
  }

  .controls {
    display: none;
  }

  /* Ajustar altura del banner para móviles */
  .banner {
    height: 100svh;
  }

  .carousel-container {
    height: 60svh;
  }
}

/* Mejoras para mejor experiencia táctil */
.item {
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.slider {
  touch-action: none;
  /* Para que el contenedor no interfiera */
}

/* Ajustes para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .mobile-indicators {
    display: flex;
    bottom: 120px;
  }

  .controls {
    display: flex;
  }
}
