:root {
  --primary-color: #e42f2c;
  --secondary-color: #2c3e5f;
  --dark-blue: #1a1f3a;
  --light-gray: #272626;
  --white: #ffffff;
  --text-color: #333333;
  --primary-red: #e42f2c;
  --primary-blue: #1a2b4a;
  --light-gray: #f5f7fa;
  --soft-gray: #f8f9fa;
}

:root {
  --primary-red: #e42f2c;
  --primary-blue: #1a2b4a;
  --dark-blue: #0d1829;
  --accent-blue: #2e91e7;
  --light-gray: #f5f7fa;
  --white: #ffffff;
  --text-dark: #1a1a1a;
  --text-gray: #4a4a4a;
  --soft-blue: #4a90e2;
  --light-blue: #e8f4fd;
  --dark-text: #2c3e50;
  --soft-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --border-light: #e0e6ed;
  --success-green: #27ae60;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

.header-e {
  background-color: var(--light-gray);
}

.container {
  /* max-width: 1400px; */
}

/* Espaciado para header fijo */
.content-wrapper {
  padding-top: 80px;
}

.hero {
  background-color: #f5f4f2;
  min-height: 240px;
}

/* Hero Section - franja gris pequeña */
.hero-project {
  background: var(--light-gray);
  padding: 60px 0 40px;
  position: relative;
}

.hero-title {
  color: var(--text-color);
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

/* Imagen grande sobrepuesta */
.hero-image-container {
  max-width: 1200px;
  margin: auto auto;
  padding: 20px 40px;
  position: relative;
  z-index: 10;
}

.hero-image-wrapper {
  width: 100%;
  height: 400px;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  filter: brightness(0.7);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay del título */
.hero-title-overlay {
  position: absolute;
  bottom: 5%;
  left: 5%;
  text-align: center;
  padding: 20px 20px;
  border-radius: 6px;
}

.hero-title-overlay h1 {
  margin: 0;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Breadcrumb */
.breadcrumb-section {
  background: linear-gradient(to right, var(--white), var(--light-gray));
  padding: 15px 0;
  border-bottom: 1px solid rgba(228, 47, 44, 0.1);
}

.breadcrumb {
  margin: 0;
  background: transparent;
  padding: 0;
  margin-top: 0 !important;
  position: relative;
  z-index: 5;
}

.breadcrumb-item {
  font-size: 0.9rem;
}

.breadcrumb-item a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: var(--primary-color);
}

.breadcrumb-item.active {
  color: var(--text-color);
  font-weight: 600;
}

/* Container principal */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Sección La Historia */
.historia-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.historia-section.visible {
  opacity: 1;
  transform: translateY(0);
  margin: 80px 0;
}

.historia-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-color);
}

.historia-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: #555;
  text-align: justify;
}

.historia-image {
  position: static;
  margin-top: 80px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Sección El Premio */
.premio-section {
  display: flex;
  align-items: center; /* Centrado vertical */
  gap: 3rem; /* Espacio entre imagen y texto */
}

.premio-section.visible {
  opacity: 1;
  transform: translateY(0);
  margin: 80px 0;
}

/* Bloque imagen + link */
.premio-image {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centra imagen y link horizontalmente */
  text-align: center;
  max-width: 600px;
}

/* Link */
.premio-image a {
  margin-top: 1rem;
}

/* Texto */
.premio-content {
  flex: 1;
}

.premio-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-color);
}

.premio-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: #555;
  text-align: justify;
}

.premio-image-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.premio-image-container img {
  max-width: 600px;
  /* clip-path: polygon(5% 0%, 95% 3%, 100% 90%, 90% 100%, 10% 97%, 0% 10%); */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.premio-image-container::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 150px;
  height: 150px;
  border: 4px solid var(--primary-red);
  z-index: 2;
  opacity: 0.8;
}

.premio-image-container::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 150px;
  height: 150px;
  border: 4px solid var(--primary-blue);
  z-index: 2;
  opacity: 0.8;
}

.premio-image-container-image-border-accent {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 1;
  transition: all 0.5s ease;
}

.premio-image-container-image-border-accent {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 1;
  transition: all 0.5s ease;
}

.premio-image-container:hover .premio-image-container-image-border-accent {
  top: 30px;
  left: 30px;
  right: 30px;
  bottom: 30px;
  border-color: var(--primary-red);
}

.premio-image .arrow-link {
  color: #000;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

/* Flecha */
.premio-image .arrow-link::after {
  content: "→";
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

/* Hover */
.premio-image .arrow-link:hover {
  color: #000;
  transform: translateX(2px);
}

.premio-image .arrow-link:hover::after {
  transform: translateX(4px);
}

/* Carrusel de celulares apilados */
.phone-carousel-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

/* Estilos base para todos los celulares */
.phone-stack {
  width: 300px;
  height: 620px;
  background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
  border-radius: 42px;
  padding: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
  position: absolute;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-stack-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 30px;
  background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
  border-radius: 0 0 20px 20px;
  z-index: 10;
}

.phone-stack-screen {
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
}

.screen-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Posiciones iniciales de los celulares */
.phone-back-left {
  transform: translateX(-80px) translateZ(-150px) rotateY(25deg) scale(0.85);
  opacity: 0.6;
  z-index: 1;
  filter: blur(1px);
}

.phone-back-right {
  transform: translateX(80px) translateZ(-150px) rotateY(-25deg) scale(0.85);
  opacity: 0.6;
  z-index: 1;
  filter: blur(1px);
}

.phone-front {
  transform: translateZ(0) rotateY(0deg) scale(1);
  opacity: 1;
  z-index: 10;
  animation: phoneFrontFloat 3s ease-in-out infinite;
}

#prevebsaNavbar {
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb(0,0,0)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  border: solid 1px rgba(200, 200, 200);
}

#prevebsaNavbarItem {
  color: #252525 !important;
}

#languageTogglePrevebsa {
  border: solid 1px rgba(200, 200, 200);
  color: #252525 !important;
}

@keyframes phoneFrontFloat {
  0%,
  100% {
    transform: translateZ(0) rotateY(0deg) scale(1) translateY(0px);
  }
  50% {
    transform: translateZ(0) rotateY(0deg) scale(1) translateY(-15px);
  }
}

/* Overlay del celular frontal */
.phone-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  padding: 30px 20px;
  opacity: 0;
  animation: overlayFadeIn 1s ease 0.5s forwards;
}

@keyframes overlayFadeIn {
  to {
    opacity: 1;
  }
}

.overlay-content {
  text-align: center;
  color: white;
}

.overlay-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 24px;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(228, 47, 44, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(228, 47, 44, 0);
  }
}

.overlay-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.overlay-subtitle {
  font-size: 13px;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Indicadores del carrusel */
.carousel-indicators {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}

.indicator {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.indicator.active {
  background: var(--primary-color);
  width: 30px;
  border-radius: 5px;
}

/* Elementos flotantes decorativos */
.float-element {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(228, 47, 44, 0.1);
  border: 2px solid rgba(228, 47, 44, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 24px;
  animation: floatAround 6s ease-in-out infinite;
}

.float-1 {
  top: 10%;
  left: -5%;
  animation-delay: 0s;
}

.float-2 {
  top: 40%;
  right: -5%;
  animation-delay: 2s;
}

.float-3 {
  bottom: 15%;
  left: -5%;
  animation-delay: 4s;
}

@keyframes floatAround {
  0%,
  100% {
    transform: translateY(0px) translateX(0px);
  }
  33% {
    transform: translateY(-20px) translateX(10px);
  }
  66% {
    transform: translateY(10px) translateX(-10px);
  }
}

/* Sección El Resultado */
.resultado-section {
  background: #e9e9e9;
  margin: 0 -100vw 0;
  padding: 80px calc((100vw - 1200px) / 2 + 20px);
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.resultado-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.resultado-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
  align-items: center;
  padding: 0px 20px;
}

.resultado-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-color);
}

.resultado-content p {
  text-align: justify;
}

.resultado-list {
  list-style: none;
  padding: 0;
  margin-bottom: 30px;
}

.resultado-list li {
  padding: 12px 0;
  padding-left: 30px;
  position: relative;
  color: #555;
  line-height: 1.6;
  text-align: justify;
}

.resultado-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
}

.resultado-text {
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  font-style: italic;
  color: #666;
  text-align: justify;
}

/* Galería de imágenes - diseño personalizado */
.resultado-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 180px);
  gap: 15px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  /* transition: transform 0.3s ease, box-shadow 0.3s ease; */
}

/* .gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
} */

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Layout específico para cada imagen */
.gallery-item:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.gallery-item:nth-child(2) {
  grid-column: 2;
  grid-row: 1 / 3;
}

.gallery-item:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

.gallery-item:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
}

.gallery-item:nth-child(5) {
  grid-column: 3;
  grid-row: 2;
}

.gallery-item:nth-child(6) {
  grid-column: 1 / 3;
  grid-row: 3;
}

.gallery-item:nth-child(7) {
  grid-column: 3;
  grid-row: 3;
}

.force-reduce-width img {
  width: 300px;
}

/* Modal para galería */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  position: relative;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
}

/* Animaciones de scroll */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */

@media (max-width: 1230px) {
  .resultado-wrapper {
    padding: 0px 40px;
  }

  .reduce-size img {
    width: 100% !important;
    height: 62% !important;
  }
}

@media (max-width: 1024px) {
  .force-reduce-width img {
    width: 150px;
  }
}

@media (max-width: 992px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-image-wrapper {
    height: 350px;
  }

  .phone-carousel-container {
    height: 600px;
    max-width: 350px;
  }

  .phone-stack {
    width: 260px;
    height: 540px;
  }

  .phone-back-left {
    transform: translateX(-70px) translateZ(-130px) rotateY(25deg) scale(0.85);
  }

  .phone-back-right {
    transform: translateX(70px) translateZ(-130px) rotateY(-25deg) scale(0.85);
  }

  .float-element {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .historia-section,
  .resultado-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .historia-image {
    position: static;
    margin-top: 40px;
  }

  .historia-content h2 {
    margin-top: 40px;
  }

  .premio-section {
    flex-direction: column;
    text-align: center;
  }

  .premio-content {
    text-align: left;
  }

  .premio-content h2 {
    margin-top: 40px;
  }

  .resultado-gallery {
    /* grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 160px); */
  }

  .gallery-item:nth-child(6) {
    grid-column: 1 !important;
    grid-row: 3;
  }

  .reduce-size-item {
    width: 70%;
    height: 70%;
  }

  .move-left {
    right: 20px;
  }

  .move-right {
    left: 100px;
  }

  .gallery-item:nth-child(2) {
    grid-row: 1 / 3;
  }

  .gallery-item:nth-child(6) {
    grid-column: 1 / 3;
  }

  #prevebsaNavbarItem {
    color: #fff !important;
  }

  .navbar {
    padding-top: 25px;
  }

  .reduce-size img {
    width: 100% !important;
    height: 90% !important;
  }

  #languageTogglePrevebsa {
    border: solid 1px rgba(200, 200, 200);
    color: #fff !important;
  }

  #languageTogglePrevebsa:hover {
    border: solid 1px rgba(200, 200, 200);
    color: #000000 !important;
  }
}

@media (max-width: 768px) {
  .hide {
    display: none;
  }

  .content-wrapper,
  .container {
    padding: 0 40px;
  }

  .hero-project {
    padding: 40px 0 30px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-image-container {
    padding: 20px 20px;
  }

  .hero-image-wrapper {
    height: 300px;
  }

  .phone-carousel-container {
    height: 500px;
    max-width: 300px;
  }

  .phone-stack {
    width: 220px;
    height: 460px;
    border-radius: 36px;
    padding: 10px;
  }

  .phone-stack-screen {
    border-radius: 30px;
  }

  .phone-stack-notch {
    width: 130px;
    height: 26px;
  }

  .phone-back-left {
    transform: translateX(-60px) translateZ(-110px) rotateY(20deg) scale(0.85);
  }

  .phone-back-right {
    transform: translateX(60px) translateZ(-110px) rotateY(-20deg) scale(0.85);
  }

  .overlay-icon {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  .overlay-title {
    font-size: 16px;
  }

  .overlay-subtitle {
    font-size: 12px;
  }

  .float-element {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .floating-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .hero-title-overlay h1 {
    font-size: 1.8rem;
  }

  .hero-title-overlay {
    padding: 14px 24px;
  }

  .breadcrumb-section {
    padding: 15px 0;
  }

  .breadcrumb-item {
    font-size: 0.8rem;
  }

  .resultado-section {
    padding: 60px 20px;
  }

  .resultado-wrapper {
    gap: 50px;
    padding: 0px 20px;
  }

  .resultado-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .gallery-item {
    height: 220px;
  }

  .gallery-item:nth-child(2),
  .gallery-item:nth-child(6) {
    grid-column: span 1;
    grid-row: auto;
  }
}

@media (max-width: 576px) {
  .hero-image-wrapper {
    height: 250px;
  }

  .phone-carousel-container {
    height: 420px;
    max-width: 250px;
  }

  .phone-stack {
    width: 180px;
    height: 380px;
    border-radius: 30px;
    padding: 8px;
  }

  .phone-stack-screen {
    border-radius: 24px;
  }

  .phone-stack-notch {
    width: 110px;
    height: 22px;
  }

  .phone-back-left {
    transform: translateX(-50px) translateZ(-90px) rotateY(15deg) scale(0.85);
  }

  .phone-back-right {
    transform: translateX(50px) translateZ(-90px) rotateY(-15deg) scale(0.85);
  }

  .phone-overlay {
    padding: 20px 15px;
  }

  .overlay-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-bottom: 10px;
  }

  .overlay-title {
    font-size: 14px;
  }

  .overlay-subtitle {
    font-size: 11px;
  }

  .carousel-indicators {
    bottom: 20px;
  }

  .indicator {
    width: 8px;
    height: 8px;
  }

  .indicator.active {
    width: 24px;
  }

  .float-element {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .floating-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .hero-title-overlay h1 {
    font-size: 1.5rem;
  }

  .historia-content h2,
  .resultado-content h2 {
    font-size: 1.5rem;
    margin-top: 30px;
  }

  .historia-image {
    margin-top: 30px;
  }

  .historia-content p {
    font-size: 0.95rem;
  }

  .premio-content h2 {
    font-size: 1.5rem;
    margin-top: 30px;
  }

  .premio-image {
    margin-top: 30px;
  }

  .premio-content p {
    font-size: 0.95rem;
  }

  .resultado-list li {
    font-size: 0.95rem;
    padding: 10px 0;
    padding-left: 25px;
  }

  .resultado-text {
    font-size: 0.9rem;
    padding: 15px;
  }

  .gallery-item {
    height: 200px;
  }
}
