/* ============================================================
   MAIN.CSS — Estilos de layout general del portfolio.
   Aquí van los estilos de la página, no de los componentes
   (cada Web Component encapsula los suyos).
   ============================================================ */

/* ---- Layout raíz ---- */
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 48px;
  background: var(--aerko-negro);
  color: var(--base-beige-hover);
  font-family: 'Geist', sans-serif;
}

/* ---- Visibilidad de navegación por plataforma ---- */
nav-desktop {
  display: flex;
  width: 100%;
  max-width: 1440px;
}

nav-mobile {
  display: none;
  width: 100%;
}

@media (max-width: 1024px) {
  nav-desktop {
    display: none;
  }

  nav-mobile {
    display: block;
  }
}

/* ---- Contenedor principal (max 1440px) ---- */
.page-wrapper {
  width: 100%;
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

@media (min-width: 1400px) {
  .page-wrapper {
    width: 1440px;
    flex-shrink: 0;
  }
}

/* ---- Frames principales (secciones con borde) ---- */
.section-frame {
  display: flex;
  width: 100%;
  padding: 64px 24px;
  flex-direction: column;
  align-items: flex-start;
  gap: 96px;
  border-radius: 8px;
  border: 2px solid var(--base-beige);
  background: var(--base-marron);
}

.section-frame--medium {
  gap: 64px;
}

.section-frame--small {
  gap: 48px;
}

/* ---- Frame contacto ---- */
.section-frame--contact {
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ---- Cortes ---- */
.section-cut {
  display: flex;
  width: 100%;
  padding: 64px 0;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--base-beige);
}


/* ============================================================
   SECCIÓN: Diseño con alma
   ============================================================ */

.titulo-section {
  display: flex;
  padding: 0 24px 48px 24px;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 48px;
  align-self: stretch;
  text-align: center;
}

.busqueda-proyectos {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 48px;
  align-self: stretch;
}

/* ---- Grid de cards (Scrol horizontal) ---- */
.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-self: stretch;
  width: 100%;
  position: relative; /* Para las flechas */
}

/* Botones de navegación */
.cards-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--base-beige-hover);
  background: rgba(47, 40, 38, 0.8); /* Base marron con transparencia */
  backdrop-filter: blur(8px);
  color: var(--base-beige-hover);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cards-nav-btn:hover {
  background: var(--base-beige-hover);
  color: var(--base-marron);
  transform: translateY(-50%) scale(1.1);
}

.cards-nav-btn--left {
  left: -32px;
}

.cards-nav-btn--right {
  right: -32px;
}

@media (max-width: 1439px) {
  .cards-nav-btn--left { left: 0; }
  .cards-nav-btn--right { right: 0; }
}

@media (max-width: 1024px) {
  .cards-nav-btn { display: none; } /* En móvil se usa el dedo */
}

.cards-row {
  display: flex;
  height: auto;
  justify-content: flex-start;
  align-items: stretch;
  gap: 48px;
  align-self: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 48px 24px; /* More padding to avoid cutting shadows/borders */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  transition: scrollbar-color 0.3s;
}

.cards-row:hover {
  scrollbar-color: var(--base-beige-hover) transparent;
}

/* Custom scrollbar for Webkit (elegant & hidden by default) */
.cards-row::-webkit-scrollbar {
  height: 6px;
}
.cards-row::-webkit-scrollbar-track {
  background: transparent;
}
.cards-row::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 10px;
  transition: background-color 0.3s;
}

.cards-row:hover::-webkit-scrollbar-thumb {
  background-color: var(--base-beige-hover);
}


/* ============================================================
   SECCIÓN: ¿Por qué trabajar conmigo?
   ============================================================ */

.texto-inicial {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  align-self: stretch;
}

.segundo-texto-datos {
  display: flex;
  justify-content: center;
  align-items: stretch; /* Change to stretch to match columns height */
  gap: 24px;
  align-self: stretch;
}

.texto-largo {
  flex: 1 0 0;
}

.datos-destacados {
  display: flex;
  padding: 0 24px;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex: 1 0 0;
  align-self: stretch;
  gap: 16px; /* Minimum gap between items */
}


/* ============================================================
   SECCIÓN: Servicios
   ============================================================ */

/* .fases-row is obsolete, replaced by <servicios-navigator> */

#seccion-servicios {
  padding-bottom: 48px;
}


/* ============================================================
   SECCIÓN: Contacto
   ============================================================ */

#email-display {
  word-break: break-all;
}

.email-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 200ms ease;
}

.email-link:hover {
  opacity: 0.8;
}


/* ============================================================
   TRANSICIONES del router SPA
   ============================================================ */
.page-fade-out {
  opacity: 0;
  transition: opacity 333ms ease-out;
}

.page-fade-in {
  opacity: 1;
  transition: opacity 333ms ease-in;
}



/* ============================================================
   RESPONSIVE: PC Reducido (1399px → 1025px)
   ============================================================ */
@media (max-width: 1439px) and (min-width: 1025px) {
  /* Cards: Una sola fila horizontal */
  .cards-grid {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 24px;
    align-self: stretch;
  }

  .cards-row {
    flex-direction: row;
    height: auto;
    gap: 48px;
    align-self: stretch;
  }

  /* "¿Por qué?": Ocultar datos destacados y estirar texto */
  .segundo-texto-datos .datos-destacados {
    display: none;
  }

  .segundo-texto-datos .texto-largo {
    flex: 1 1 100%;
    align-self: stretch;
  }

  /* .fases-row is obsolete */

  /* Servicios: Ocultar carousel 3D (se gestiona en el componente) */
  #info-carousel {
    display: block;
    width: 100%;
  }
}

/* ============================================================
   RESPONSIVE: Tablet (1024px → 481px)
   ============================================================ */
@media (max-width: 1024px) {
  body {
    gap: 24px;
  }

  .section-frame {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 2px solid var(--base-beige);
    border-bottom: 2px solid var(--base-beige);
  }

  .section-frame--contact {
    border-bottom: none;
    border-radius: 0;
  }

  /* Cards: fila horizontal con scroll */
  .cards-grid {
    flex-direction: column;
    gap: 48px;
  }

  .cards-row {
    height: auto;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    flex-wrap: nowrap;
    gap: 24px;
  }

  .cards-row::-webkit-scrollbar {
    display: none;
  }

  /* "¿Por qué?" — todo horizontal con flex */
  .segundo-texto-datos {
    flex-direction: row;
  }

  /* Fases en columna - obsolete */

  /* Cortes: H2 en vez de H1 */
  .section-cut h2 {
    font-size: 32px;
  }

  .section-frame--contact #email-display {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
  }
}


/* ============================================================
   RESPONSIVE: Móvil (480px → 320px)
   ============================================================ */
@media (max-width: 480px) {
  .section-frame {
    gap: 48px;
  }

  .titulo-section {
    padding: 0 0 24px 0;
    gap: 24px;
  }

  /* Texto + datos: vertical */
  .segundo-texto-datos {
    flex-direction: column;
  }

  .datos-destacados {
    padding: 0;
  }

  /* Cards: scroll horizontal */
  .cards-row {
    gap: 24px;
  }

  /* Fases: horizontal scroll - obsolete */

  .fases-row::-webkit-scrollbar {
    display: none;
  }

  /* Contacto: email en H3 */
  .section-frame--contact #email-display {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
  }
}
/* ============================================================
   ABOUT RESPONSIVE (TEXT TOGGLE & DATA HIDE)
   ============================================================ */

.texto-corto {
  display: none;
}

@media (max-width: 1024px) {
  .intro-p-larga {
    display: none !important;
  }
  .texto-largo {
    display: none !important;
  }
  .texto-corto {
    display: block !important;
  }
  .datos-destacados {
    display: none !important;
  }

  .texto-inicial {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
  }

  .segundo-texto-datos {
    display: block !important;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .texto-inicial {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px;
  }

  #comparativo, 
  comparativo-panel {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
}
