/* ==========================================================================
   componentes.css — piezas reutilizables en todas las páginas
   ========================================================================== */

.ico { width: 24px; height: 24px; flex: none; }

/* ---------- Posicionado de escritorio ----------
   En escritorio (≥1200) los elementos .dx se colocan como en Framer:
   --x = distancia al centro de la página, --y = distancia al borde superior de su sección,
   --w = ancho. Todo en "unidades de diseño" de 1440 px (var(--u)). */
@media (min-width: 1200px) {
  .sec { position: relative; height: calc(var(--h) * var(--u)); }
  .dx {
    position: absolute;
    left: calc(50% + var(--x) * var(--u));
    top: calc(var(--y) * var(--u));
    width: calc(var(--w, auto) * var(--u));
  }
}

/* ======================= Menú de escritorio ======================= */
.nav-d { display: none; }
@media (min-width: 1200px) {
  .nav-d {
    position: absolute; z-index: var(--z-nav);
    top: calc(46 * var(--u)); left: 50%;
    width: calc(467 * var(--u)); height: calc(93 * var(--u));
    margin-left: calc(-233.5 * var(--u));
    display: flex; align-items: center;
    padding-left: calc(17 * var(--u));
    border-radius: calc(47 * var(--u));
    background: var(--nav-fondo);
    -webkit-backdrop-filter: blur(64px); backdrop-filter: blur(64px);
    box-shadow: var(--sombra-nav);
    overflow: hidden;
    opacity: 0; transform: translateY(-85px);
  }
  .nav-d::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(0, 0, 0, .08); }
  .nav-d__logo { display: block; width: calc(69 * var(--u)); height: calc(69 * var(--u)); border-radius: 50%; overflow: hidden; flex: none; }
  .nav-d__logo img { width: 100%; height: 100%; object-fit: cover; }
  .nav-d__links { display: flex; align-items: center; gap: calc(8 * var(--u)); margin-left: calc(27 * var(--u)); }
  .nav-d__links a {
    position: relative; display: block; padding: 0 4px;
    font-weight: 500; font-size: 14px; line-height: 16.8px; text-transform: uppercase; color: var(--blanco);
  }
  .nav-d__links a::before {
    content: ""; position: absolute; inset: -6px -8px; border-radius: var(--r-pastilla);
    background: rgba(255, 255, 255, .12);
    opacity: 0; transform: scale(.8);
    transition: opacity .3s, transform .4s cubic-bezier(.34, 1.4, .64, 1);
  }
  .nav-d__links a:hover::before, .nav-d__links a:focus-visible::before { opacity: 1; transform: scale(1); }
}

/* ======================= Pastilla inferior (móvil / tableta) ======================= */
.pastilla {
  position: fixed; z-index: var(--z-nav);
  left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  display: flex; align-items: center; gap: 4px;
  height: 56px; padding: 4px 6px 4px 4px;
  border-radius: var(--r-nav);
  background: rgba(26, 26, 26, .72);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: var(--sombra-nav);
  color: var(--blanco);
}
.pastilla__logo { display: block; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex: none; }
.pastilla__logo img { width: 100%; height: 100%; object-fit: cover; }
.pastilla__links { display: none; }
.pastilla__links a, .pastilla__menu {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px;
  border-radius: var(--r-pastilla);
  font-weight: 500; font-size: 14px; text-transform: uppercase; letter-spacing: .02em;
  transition: background-color .2s;
}
.pastilla__menu { padding: 0 18px 0 14px; }
.pastilla__links a:active, .pastilla__menu:active { background: rgba(255, 255, 255, .12); }
@media (min-width: 768px) {
  .pastilla__links { display: flex; }
  .pastilla__menu { display: none; }
}
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  .pastilla { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .pastilla { height: 48px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .pastilla__logo { width: 40px; height: 40px; }
  .pastilla__links a, .pastilla__menu { height: 40px; }
}

/* ======================= Hoja del menú ======================= */
.hoja { position: fixed; inset: 0; z-index: var(--z-hoja); }
.hoja[hidden] { display: none; }
.hoja__fondo { position: absolute; inset: 0; background: rgba(0, 0, 0, .24); opacity: 0; transition: opacity .3s; }
.hoja.abierta .hoja__fondo { opacity: 1; }
.hoja__panel {
  position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto; max-height: calc(100dvh - 16px); overflow-y: auto;
  padding: 24px 24px 20px;
  border-radius: var(--r-grande);
  background: var(--blanco); color: var(--gris-texto);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .15);
  transform: translateY(110%);
}
.hoja__cerrar {
  position: absolute; top: 12px; right: 12px; width: 48px; height: 48px;
  display: grid; place-items: center; border-radius: 50%; background: var(--fondo);
}
.hoja__links { padding-top: 8px; }
.hoja__links a {
  display: flex; align-items: center; min-height: 52px;
  font-size: 24px; line-height: 1.2; color: var(--gris-texto);
}
.hoja__redes { display: flex; gap: 12px; margin-top: 20px; }
.hoja__redes a {
  display: grid; place-items: center; width: 88px; height: 48px;
  border: 1px solid var(--gris-texto); border-radius: var(--r-pastilla); color: var(--gris-texto);
}
@media (orientation: landscape) and (max-height: 500px) {
  .hoja__links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .hoja__links a { font-size: 20px; min-height: 44px; }
}

/* ======================= Botón con marco blanco (Contáctame / Escríbeme) ======================= */
.boton-marco { display: inline-flex; padding: 8px; border-radius: 33px; background: var(--blanco); }
.boton-marco--ancho { display: flex; }
.boton-marco--ancho .boton { flex: 1; justify-content: center; }
.boton {
  display: inline-flex; align-items: center; gap: 8px;
  height: 51px; padding: 0 20px 0 24px;
  border-radius: 154px;
  font-weight: 700; font-size: 16px; line-height: 27.2px; color: var(--blanco);
  box-shadow: var(--sombra-boton);
  transition: transform .2s;
}
.boton--gris { background: var(--gris-texto); }
.boton--verde { background: var(--verde); }
.boton:active { transform: scale(.97); }
.boton__ico { position: relative; width: 20px; height: 20px; overflow: hidden; flex: none; }
.boton__ico svg { position: absolute; inset: 0; width: 20px; height: 20px; transition: transform .5s var(--ease-relevo); }
.boton__ico svg + svg { transform: translateX(-28px); }
.boton:hover .boton__ico svg:first-child, .boton.relevo .boton__ico svg:first-child { transform: translateX(28px); }
.boton:hover .boton__ico svg + svg, .boton.relevo .boton__ico svg + svg { transform: translateX(0); }

/* ======================= Chip de servicio ======================= */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 4px 20px 4px 4px;
  border-radius: 147px; background: var(--blanco);
  box-shadow: var(--sombra-chip);
  font-size: 16px; line-height: 27.2px; color: var(--gris-texto); white-space: nowrap;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.chip__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--verde); color: var(--blanco); flex: none; }
.chip__ico svg { width: 63%; height: 63%; }
@media (min-width: 1200px) {
  .chip { height: 40px; width: auto; }
  .chip__ico { width: 32px; height: 32px; }
}
@media (hover: hover) and (pointer: fine) { .chip { cursor: grab; } .chip:active { cursor: grabbing; } }

/* ======================= Redes (Instagram | TikTok) ======================= */
.redes { display: flex; align-items: center; justify-content: center; gap: 12px; }
.red {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px;
  font-family: var(--font-cond); font-weight: 500; font-size: 16px; line-height: 19.2px; color: var(--verde);
}
.red .ico { color: var(--verde); }
.redes__sep { width: 1px; height: 22px; background: var(--gris-texto); opacity: .6; }
.red--ig .red__txt { order: 1; }
.red--ig .ico { order: 0; }

/* ======================= Cursor personalizado (solo con ratón) ======================= */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: grid; place-items: center;
    position: fixed; left: 0; top: 0; z-index: var(--z-cursor);
    width: 16px; height: 16px; margin: -8px 0 0 -8px;
    border-radius: 259px; background: var(--blanco);
    box-shadow: 0 0 2px rgba(0, 0, 0, .25);
    mix-blend-mode: difference;
    pointer-events: none; opacity: 0; will-change: transform; contain: layout style;
    transition: width .35s cubic-bezier(.3, 1.3, .5, 1), height .35s cubic-bezier(.3, 1.3, .5, 1), margin .35s cubic-bezier(.3, 1.3, .5, 1), border-radius .35s;
  }
  .cursor__ver {
    font-family: var(--font-cond); font-weight: 500; font-size: 16px; line-height: 1; color: var(--gris-texto);
    opacity: 0; transition: opacity .2s;
  }
  .cursor.ver { width: 50px; height: 24px; margin: -12px 0 0 -25px; mix-blend-mode: normal; }
  .cursor.ver .cursor__ver { opacity: 1; }
  .cursor.ver.pulsado { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .cursor.ver.pulsado .cursor__ver { opacity: 0; }
  html.con-cursor, html.con-cursor a, html.con-cursor button { cursor: none; }
}

/* ======================= Cinta infinita ======================= */
.cinta { display: flex; width: max-content; will-change: transform; }
.cinta > * { flex: none; }

/* ======================= Shader con imagen de respaldo ======================= */
.shader { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.shader.listo { opacity: 1; }
[data-fallback] { background: linear-gradient(135deg, #2B7651 0%, #43A373 45%, #2B7651 70%, #7B35BD 100%); }

/* ======================= Tarjeta de proyecto (casos y otros proyectos) ======================= */
.caso {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--r-tarjeta); box-shadow: var(--sombra-tarjeta); background: #d4d4d4;
  transition: transform .15s;
}
.caso--rrss { box-shadow: 0 0 20px rgba(0, 0, 0, .25); }
.caso picture { position: absolute; inset: 0; }
.caso__img { width: 100%; height: 100%; object-fit: cover; }
.caso__img--zoom {
  position: absolute; left: 50%; top: 50%; width: var(--zoom); max-width: none; height: auto;
  transform: translate(-50%, -50%);
}
.caso::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgb(0, 0, 0) 100%);
  opacity: 0; transition: opacity .35s;
}
.caso__info {
  position: absolute; left: 20px; right: 20px; bottom: 16px; z-index: 2;
  display: flex; flex-direction: column; gap: 6px;
}
.caso__t { font-family: var(--font-cond); font-weight: 800; font-size: 28px; line-height: 1; color: var(--blanco); }
.caso__tags { font-family: var(--font-cond); font-weight: 400; font-size: 15px; line-height: 1.2; color: rgba(255, 255, 255, .82); }
/* Móvil, tableta y táctil: el título está siempre visible sobre un degradado suave
   que solo oscurece la parte baja, donde va el texto */
@media (max-width: 1199.98px), (hover: none), (pointer: coarse) {
  .caso::before {
    opacity: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .35) 62%, rgba(0, 0, 0, .78) 100%);
  }
  .caso__info { text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }
  .caso:active { transform: scale(.98); }
}
@media (min-width: 1200px) {
  .caso { background: transparent; will-change: transform; }
  .caso__img--zoom { width: calc(var(--zpx) * var(--u)); }
  .caso__info { left: calc(22 * var(--u)); right: calc(22 * var(--u)); bottom: calc(20 * var(--u)); gap: calc(6 * var(--u)); transform: translateY(30px); opacity: 0; transition: transform .45s cubic-bezier(.3, 1.25, .5, 1), opacity .3s; }
  .caso--der .caso__info { align-items: flex-end; text-align: right; }
  .caso__t { font-size: calc(36 * var(--u)); line-height: 1; }
  .caso__tags { font-size: 18px; color: var(--gris-texto); }
}
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  .caso:hover::before, .caso:focus-visible::before { opacity: 1; }
  .caso:hover .caso__info, .caso:focus-visible .caso__info { transform: none; opacity: 1; }
}
@media (min-width: 1200px) and ((hover: none) or (pointer: coarse)) {
  .caso__info { transform: none; opacity: 1; }
}


/* ======================= Pie (todas las páginas) ======================= */
.pie { position: relative; overflow: hidden; color: var(--blanco); padding: 56px var(--gutter) calc(96px + env(safe-area-inset-bottom)); }
.pie__fondo { position: absolute; inset: 0; }
.pie__in { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; }
.pie__arriba { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pie__t { font-weight: 500; font-size: clamp(2.25rem, 1.8rem + 2vw, 3rem); line-height: 1; }
.pie__logo { width: 64px; height: auto; }
.pie__links { display: flex; flex-direction: column; }
.pie__links a { display: flex; align-items: center; gap: 14px; min-height: 48px; font-size: 16px; line-height: 19.2px; overflow-wrap: anywhere; }
.pie__arriba-link { display: inline-flex; align-items: center; min-height: 48px; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
@media (min-width: 768px) {
  .pie__links { flex-direction: row; flex-wrap: wrap; column-gap: 28px; }
  .pie__in { gap: 32px; }
}
@media (min-width: 1200px) {
  .pie { height: calc(265 * var(--u)); padding: calc(80 * var(--u)) 40px 0; }
  .pie__fondo { top: calc(-92 * var(--u)); bottom: auto; height: calc(453 * var(--u)); }
  .pie__in { display: block; max-width: 1360px; margin: 0 auto; }
  .pie__arriba { height: 48px; }
  .pie__t { font-size: 48px; line-height: 48px; }
  .pie__logo { width: 48px; height: 48px; object-fit: contain; }
  .pie__links { position: absolute; left: 0; top: 88px; flex-wrap: nowrap; column-gap: 28px; }
  .pie__links a { min-height: 24px; gap: 14px; transform: scale(.9); transform-origin: left center; transition: transform .4s cubic-bezier(.3, 1.3, .5, 1); }
  .pie__links a:hover { transform: scale(.8); }
  .pie__arriba-link { position: absolute; right: 0; top: 88px; min-height: 0; text-decoration: none; transform: scale(.9); transform-origin: right center; transition: transform .4s cubic-bezier(.3, 1.3, .5, 1); }
  .pie__arriba-link:hover { transform: scale(.8); }
}

/* ======================= Carruseles deslizables (móvil y tableta) ======================= */
[data-carrusel] { touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
@media (hover: hover) and (pointer: fine) { [data-carrusel] { cursor: grab; } }
[data-carrusel].arrastrando { cursor: grabbing; scroll-snap-type: none; user-select: none; -webkit-user-select: none; }
[data-carrusel].arrastrando * { pointer-events: none; }
.puntos { display: flex; justify-content: center; gap: 0; margin-top: 4px; }
.puntos button { display: grid; place-items: center; width: 32px; height: 44px; }
.puntos button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gris-texto); opacity: .3; transition: opacity .2s, width .3s; }
.puntos button[aria-current="true"]::before { width: 22px; border-radius: 4px; opacity: .85; }
@media (min-width: 768px) { .otros .puntos { display: none; } }
@media (min-width: 1200px) { .testimonios .puntos { display: none; } }