/* ==============================================================
   CURVAS PLAN - SLIDER PRINCIPAL (FULL WIDTH & 100VH FULLSCREEN)
   Diseño de slider dinámico interactivo desarrollado para
   Curvas Plan: Señalética Arquitectónica, Corpóreos & Acrílicos.
   ============================================================== */

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

:root {
  --primary-color: #facc15;
  --primary-glow: rgba(250, 204, 21, 0.4);
  --dark-bg: #0b0c10;
  --card-shadow: 0 30px 60px rgba(0, 0, 0, 0.65);
}

html, body {
  width: 100% !important;
  width: 100vw !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: fixed !important;
  inset: 0 !important;
  background: #0b0c10 !important;
  color: #f3f4f6;
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Fondo decorativo con textura sutil */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* ==============================================================
   CONTENEDOR PRINCIPAL - 100% PANTALLA COMPLETA & 100% WIDTH
   ============================================================== */
.container,
div.container {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 100vw !important;
  min-width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: 100% !important;
  min-height: 100vh !important;
  transform: none !important;
  background: #0b0c10 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10;
}

.container .slide,
div.container .slide,
.slide {
  border-radius: 0 !important;
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 100vw !important;
  min-width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: 100% !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ==============================================================
   ITEMS / FOTOS DEL SLIDER
   ============================================================== */

/* Tarjetas de previsualización (ítems 3 en adelante) */
.container .slide .item {
  width: 180px;
  height: 250px;
  position: absolute;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.18);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  display: inline-block;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  overflow: hidden;
  z-index: 20;
}

/* Hover en tarjetas de vista previa */
.container .slide .item:nth-child(n + 3):hover {
  transform: translateY(calc(-50% - 8px)) scale(1.03);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.9), 0 0 24px var(--primary-glow), 0 0 0 2px var(--primary-color);
}

/* Overlay para contraste en tarjetas de vista previa */
.container .slide .item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* ==============================================================
   SLIDE ACTIVO (ITEMS 1 Y 2) - FONDO A PANTALLA COMPLETA 100% WIDTH
   ============================================================== */
.slide .item:nth-child(1),
.slide .item:nth-child(2) {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: translate(0, 0) !important;
  border-radius: 0 !important;
  width: 100vw !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 100vw !important;
  min-width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: 100% !important;
  min-height: 100vh !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: default;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1;
}

/* Gradiente equilibrado: sombra suave a la izquierda para el texto,
   dejando la foto cristalina, luminosa y visible al 100% de la pantalla */
.slide .item:nth-child(1)::before,
.slide .item:nth-child(2)::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(7, 9, 13, 0.82) 0%,
      rgba(7, 9, 13, 0.52) 30%,
      rgba(7, 9, 13, 0.12) 58%,
      transparent 80%
    ),
    linear-gradient(
      180deg,
      rgba(7, 9, 13, 0.55) 0%,
      transparent 18%,
      transparent 70%,
      rgba(7, 9, 13, 0.75) 100%
    );
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Posición horizontal de las miniaturas de vista previa */
.slide .item:nth-child(3) {
  left: 50%;
}

.slide .item:nth-child(4) {
  left: calc(50% + 200px);
}

.slide .item:nth-child(5) {
  left: calc(50% + 400px);
}

.slide .item:nth-child(n + 6) {
  left: calc(50% + 600px);
  opacity: 0;
  pointer-events: none;
}

/* ==============================================================
   CONTENIDO DE TEXTO Y ACCIONES DEL PROYECTO ACTIVO
   ============================================================== */
.item .content {
  position: absolute;
  top: 48%;
  left: 6vw;
  width: min(540px, 86vw);
  text-align: left;
  color: #fff;
  transform: translate(0, -50%);
  display: none;
  z-index: 25;
}

/* Solo se despliega el contenido en el ítem activo (2) */
.slide .item:nth-child(2) .content {
  display: block;
}

/* Badge de categoría / número */
.content .category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #facc15;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 9999px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  animation: animate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s 1 forwards;
}

.content .category-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #facc15;
  box-shadow: 0 0 8px #facc15;
}

/* Título principal del proyecto */
.content .name {
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.95);
  opacity: 0;
  animation: animate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s 1 forwards;
}

/* Descripción detallada */
.content .des {
  margin-top: 14px;
  margin-bottom: 24px;
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.65;
  color: #e2e8f0;
  font-weight: 400;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  opacity: 0;
  animation: animate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.45s 1 forwards;
}

/* Enlace contenedor del botón */
.content .seeMore {
  text-decoration: none;
  display: inline-block;
}

/* Botón interactivo "Ver Proyecto" */
.content button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  border: none;
  cursor: pointer;
  opacity: 0;
  border-radius: 12px;
  background: #facc15;
  color: #0b0c10;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 10px 25px rgba(250, 204, 21, 0.35);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: animate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.65s 1 forwards;
}

.content button:hover {
  background-color: #ffffff;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(255, 255, 255, 0.35);
}

.content button:active {
  transform: translateY(0);
}

/* Animación de entrada de textos */
@keyframes animate {
  from {
    opacity: 0;
    transform: translate(0, 40px);
    filter: blur(20px);
  }

  to {
    opacity: 1;
    transform: translate(0);
    filter: blur(0);
  }
}

/* ==============================================================
   BOTONES DE NAVEGACIÓN (PREV / NEXT)
   ============================================================== */
.button {
  display: flex;
  flex-direction: row;
  gap: 14px;
  position: absolute;
  bottom: 55px;
  left: 6vw;
  z-index: 30;
}

.button button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  margin: 0;
  background: rgba(18, 20, 26, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  font-size: 18px;
  font-family: system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.button button:hover {
  background: #facc15;
  border-color: #facc15;
  color: #0b0c10;
  transform: scale(1.12);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.button button:focus {
  outline: none;
  border-color: #facc15;
}

.button button:active {
  transform: scale(0.96);
}

.next {
  padding: 0 0 0 3px;
}

.prev {
  padding: 0 3px 0 0;
}

/* Indicador de mini-progreso dentro del slider */
.slide-counter-badge {
  position: absolute;
  top: 85px;
  right: 4vw;
  background: rgba(15, 17, 23, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 7px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #e2e8f0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
}

.slide-counter-badge .current {
  color: #facc15;
  font-size: 15px;
}

/* Etiqueta de miniatura en el item de vista previa */
.item-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  padding: 5px 8px;
  border-radius: 8px;
  color: #f3f4f6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.slide .item:nth-child(1) .item-tag,
.slide .item:nth-child(2) .item-tag {
  display: none;
}


/* ==============================================================
   MODO FOTO LIMPIA / FULL SCREEN 100VH SIN OBSTÁCULOS
   ============================================================== */
body.pure-photo-mode header,
body.pure-photo-mode footer,
body.pure-photo-mode .item .content,
body.pure-photo-mode .container .slide .item:nth-child(n + 3),
body.pure-photo-mode .slide-counter-badge,
body.pure-photo-mode .button,
body.pure-photo-mode #floatingContactActions {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease;
}

body.pure-photo-mode .slide .item:nth-child(1)::before,
body.pure-photo-mode .slide .item:nth-child(2)::before {
  opacity: 0 !important;
  transition: opacity 0.5s ease;
}

/* Botón flotante para salir del modo foto limpia */
#exitPhotoModeBtn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  background: rgba(11, 12, 16, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #facc15;
  padding: 9px 18px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#exitPhotoModeBtn:hover {
  background: #facc15;
  color: #0b0c10;
  transform: scale(1.06);
  box-shadow: 0 12px 35px var(--primary-glow);
}

body.pure-photo-mode #exitPhotoModeBtn {
  display: inline-flex !important;
}

/* ==============================================================
   BOTONES FLOTANTES LATERALES (DERECHA CENTRO)
   ============================================================== */
#floatingContactActions {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.fab-button-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.fab-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  text-decoration: none;
  outline: none;
  user-select: none;
}

.fab-button:active {
  transform: scale(0.94);
}

.fab-button-contact {
  background: rgba(18, 20, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.45);
}

.fab-button-contact:hover,
.fab-button-contact.is-active {
  background: #facc15;
  color: #0b0c10;
  border-color: #facc15;
  transform: scale(1.1);
  box-shadow: 0 12px 35px var(--primary-glow);
}

.fab-button-whatsapp {
  background: #25D366;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45);
}

.fab-button-whatsapp:hover {
  background: #20ba59;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 14px 38px rgba(37, 211, 102, 0.6);
}

/* Pulso animado sutil en WhatsApp */
.whatsapp-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: wa-wave 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes wa-wave {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Tooltips laterales */
.fab-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: rgba(11, 12, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.fab-button-wrapper:hover .fab-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Backdrop Flotante de Contacto */
#contactPopoverBackdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#contactPopoverBackdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Popover Flotante de Contacto */
#contactPopover {
  position: fixed;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo 1: Activado desde el botón flotante lateral */
#contactPopover.from-floating {
  right: 86px;
  top: 50%;
  transform: translateY(-50%) scale(0.95) translateX(12px);
  transform-origin: right center;
}

#contactPopover.from-floating.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1) translateX(0);
}

#contactPopover.from-floating .popover-arrow {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: #14161b;
  border-top: 1px solid rgba(250, 204, 21, 0.4);
  border-right: 1px solid rgba(250, 204, 21, 0.4);
  pointer-events: none;
  z-index: 2;
}

/* Modo 2: Activado desde el botón de la barra superior / header */
#contactPopover.from-header {
  right: 24px;
  top: 72px;
  transform: scale(0.95) translateY(-8px);
  transform-origin: top right;
}

#contactPopover.from-header.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

#contactPopover.from-header .popover-arrow {
  position: absolute;
  top: -7px;
  right: 50px;
  transform: rotate(45deg);
  width: 14px;
  height: 14px;
  background: #14161b;
  border-top: 1px solid rgba(250, 204, 21, 0.4);
  border-left: 1px solid rgba(250, 204, 21, 0.4);
  pointer-events: none;
  z-index: 2;
}

.popover-card-inner {
  position: relative;
  z-index: 1;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 204, 21, 0.4) transparent;
}

/* ==============================================================
   RESPONSIVIDAD Y MEDIA QUERIES (100VH Y FULL-WIDTH ADAPTATIVO)
   ============================================================== */

@media (max-width: 1120px) {
  .slide .item:nth-child(3) {
    left: 50%;
    width: 160px;
    height: 230px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .slide .item:nth-child(4) {
    left: calc(50% + 180px);
    width: 160px;
    height: 230px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .slide .item:nth-child(5) {
    left: calc(50% + 360px);
    width: 160px;
    height: 230px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .slide .item:nth-child(n + 6) {
    left: calc(50% + 540px);
    opacity: 0;
  }
  .item .content {
    left: 5vw;
    width: min(440px, 88vw);
  }
  .button {
    left: 5vw;
    bottom: 50px;
  }
}

@media (max-width: 860px) {
  .slide .item:nth-child(3) {
    left: 52%;
    width: 140px;
    height: 200px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .slide .item:nth-child(4) {
    left: calc(52% + 155px);
    width: 140px;
    height: 200px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
  .slide .item:nth-child(n + 5) {
    opacity: 0;
    pointer-events: none;
  }
  .item .content {
    left: 5vw;
    width: min(340px, 90vw);
    top: 50%;
  }
  .button {
    left: 5vw;
    bottom: 50px;
  }
  .slide-counter-badge {
    top: 75px;
    right: 5vw;
  }
}

@media (max-width: 640px) {
  .slide .item:nth-child(3) {
    left: auto;
    right: 16px;
    top: auto;
    bottom: 54px;
    transform: none;
    width: 105px;
    height: 145px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.25);
  }
  .slide .item:nth-child(n + 4) {
    display: none;
  }
  .item .content {
    left: 18px;
    right: 18px;
    width: calc(100% - 36px);
    top: 38%;
    transform: translate(0, -38%);
  }
  .button {
    left: 18px;
    bottom: 54px;
  }
  .button button {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  .content button {
    padding: 12px 22px;
    font-size: 13px;
  }
  .slide-counter-badge {
    top: 70px;
    right: 16px;
    font-size: 11px;
    padding: 4px 12px;
  }

  /* Adaptación de botones flotantes y popover en móviles */
  #floatingContactActions {
    right: 12px;
    gap: 10px;
  }
  .fab-button {
    width: 46px;
    height: 46px;
  }
  .fab-tooltip {
    display: none !important;
  }
  #contactPopover.from-floating,
  #contactPopover.from-header,
  #contactPopover {
    position: fixed !important;
    right: auto !important;
    left: 50% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) scale(0.95) !important;
    transform-origin: center center !important;
    max-width: 390px !important;
    width: calc(100vw - 28px) !important;
  }
  #contactPopover.show {
    transform: translate(-50%, -50%) scale(1) !important;
  }
  .popover-arrow {
    display: none !important;
  }
  .popover-card-inner {
    max-height: 84vh;
    overflow-y: auto;
    width: 100% !important;
  }
}
