/* ==========================================================================
   Home · Proyectos profesionales — 2026-10-14 (mockup) · 2026-10-16 (v2: panel desplegable)
   Plantilla: themes/master_beta/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl
   Cabecera: patrón .mlsec__head (home-sections.css).
   Tarjeta «abierta» = la del ratón (si el ratón está sobre la fila), la seleccionada (.is-active,
   si el ratón no está sobre la fila) o la que tiene el foco de teclado.
   ========================================================================== */
.mlproj {
  --mlproj-h: 420px;
  --mlproj-ink: #1d2a55;
  padding: 32px 0 40px;
}
/* mismo borde que el resto de bloques (escritorio: 1860 + 16; móvil: 16) */
.mlproj__inner {
  max-width: var(--ml-max, 1860px);
  margin-inline: auto;
  padding-inline: var(--ml-gutter, 16px);
  box-sizing: border-box;
}

.mlproj__list {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  height: var(--mlproj-h);
  margin: 0;
  padding: 0;
  list-style: none;
}
.mlproj__item {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 12px;
  transition: transform .35s ease, box-shadow .35s ease, filter .35s ease, opacity .35s ease;
}
/* 10/11/2026: sin ancho variable. La del ratón se destaca un poco; el resto se apaga
   (también, sin ratón encima, las que no son la seleccionada mientras el panel está abierto) */
@media (hover: hover) and (min-width: 768px) {
  .mlproj__list:has(.mlproj__item:hover) .mlproj__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(12, 18, 28, .22);
  }
  .mlproj__list:has(.mlproj__item:hover) .mlproj__item:not(:hover),
  .mlproj__list:not(:hover).is-sel .mlproj__item:not(.is-active) {
    filter: saturate(.1) brightness(0.6) contrast(1.2);
    opacity: 1;
  }
}

.mlproj__card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #1a2332;
  color: #fff;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.mlproj__card:hover, .mlproj__card:focus { color: #fff; text-decoration: none; outline: none; }
.mlproj__card:focus-visible { outline: 2px solid var(--mlproj-ink); outline-offset: 3px; }
/* seleccionada: filete amarillo abajo, enlaza visualmente con el panel */
.mlproj__item.is-active .mlproj__card { box-shadow: inset 0 -4px 0 #ffdd00; }
.mlproj__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform .8s cubic-bezier(.22, .7, .2, 1);
}
.mlproj__item:hover .mlproj__bg,
.mlproj__item.is-active .mlproj__bg { transform: scale(1); }
/* Velo oscuro para el contraste del texto (más denso abajo) */
.mlproj__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 18, 28, .15) 0%, rgba(12, 18, 28, .35) 45%, rgba(12, 18, 28, .82) 100%);
  transition: background-color .4s ease;
}

.mlproj__num {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, .75);
}
.mlproj__body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 20px;
}
.mlproj__title {
  display: block;
  font-size: clamp(15px, 1.1vw, 18px);   /* 23/10: antes clamp(17px, 1.35vw, 22px) */
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.2px;
  text-wrap: balance;
}
/* Texto y CTA: solo en la tarjeta abierta */
.mlproj__text,
.mlproj__cta {
  display: block;
  max-width: 460px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s ease, max-height .45s ease, margin .45s ease;
}
.mlproj__text { color: rgba(255, 255, 255, .82); font-size: 14px; line-height: 1.6; }
.mlproj__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1a2332;
  font-size: 13px;
  font-weight: 500;
}
.mlproj__cta svg { width: 16px; height: 16px; flex: 0 0 auto; transition: transform .3s ease; }
.mlproj__item.is-active .mlproj__cta svg { transform: rotate(180deg); }

.mlproj__list:hover .mlproj__item:hover .mlproj__text,
.mlproj__list:not(:hover) .mlproj__item.is-active .mlproj__text,
.mlproj__item:has(.mlproj__card:focus-visible) .mlproj__text { max-height: 7em; margin-top: 10px; opacity: 1; transition-delay: .18s; }
.mlproj__list:hover .mlproj__item:hover .mlproj__cta,
.mlproj__list:not(:hover) .mlproj__item.is-active .mlproj__cta,
.mlproj__item:has(.mlproj__card:focus-visible) .mlproj__cta {
  max-height: 44px;
  margin-top: 16px;
  padding: 11px 16px 11px 18px;
  border-radius: 999px;
  background: #fff;
  opacity: 1;
  transition-delay: .22s;
}
.mlproj__card:hover .mlproj__cta { background: #ffdd00; }

/* --------------------------------------------------------------------------
   Panel del sector (debajo de la fila; también en móvil, debajo del carrusel)
   -------------------------------------------------------------------------- */
.mlproj__panel {
  scroll-margin-top: 130px;
  margin-top: 12px;
  padding: 34px 38px 30px;
  border-radius: 12px;
  background: #f6f7f9;
  color: #1a2332;
  animation: mlproj-in .45s cubic-bezier(.22, .7, .2, 1);
}
.mlproj__panel[hidden] { display: none; }
@keyframes mlproj-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.mlproj__panel-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid #e3e6eb;
}
.mlproj__panel-num {
  padding-top: 7px;
  color: #8a93a3;
  font-size: 12px;
  letter-spacing: 1.5px;
}
.mlproj__panel-title {
  margin: 0 0 8px;
  color: var(--mlproj-ink);
  font-size: clamp(21px, 1.7vw, 28px);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -.3px;
  text-transform: none;
}
.mlproj__panel-text { max-width: 820px; margin: 0; color: #5b6575; font-size: 14px; line-height: 1.65; }
.mlproj__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #dfe3e9;
  border-radius: 50%;
  background: #fff;
  color: var(--mlproj-ink);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.mlproj__close:hover { border-color: var(--mlproj-ink); }
.mlproj__close svg { width: 18px; height: 18px; }

.mlproj__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 40px;
}
.mlproj__h {
  margin: 0 0 14px;
  color: #8a93a3;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.mlproj__dots, .mlproj__checks { margin: 0; padding: 0; list-style: none; }
.mlproj__dots li, .mlproj__checks li {
  position: relative;
  padding: 7px 0;
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid #eaedf1;
}
.mlproj__dots li:last-child, .mlproj__checks li:last-child { border-bottom: 0; }
.mlproj__dots li { padding-left: 16px; }
.mlproj__dots li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mlproj-ink);
}
.mlproj__checks li { display: flex; gap: 10px; align-items: flex-start; }
.mlproj__ck {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: #ffdd00;
  color: var(--mlproj-ink);
}
.mlproj__ck svg { width: 13px; height: 13px; }

.mlproj__panel-foot { display: flex; justify-content: flex-end; margin-top: 26px; }
.mlproj__advice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--mlproj-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .2s ease;
}
.mlproj__advice:hover, .mlproj__advice:focus { background: #3750a3; color: #fff; text-decoration: none; }
.mlproj__advice svg { width: 16px; height: 16px; }

@media (max-width: 1199px) {
  .mlproj__panel { padding: 28px 26px 24px; }
  .mlproj__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mlproj__col--ben { grid-column: 1 / -1; }
}

/* Por debajo de 1500 px: una sola tira horizontal como «Proyectos a medida», con la navegación existente.
   El recorte del scroll horizontal de la página (section#wrapper overflow-x: clip) lo pone home-medida.css. */
@media (max-width: 1499px) {
  .mlproj__list {
    height: auto; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-right: calc(50% - 50vw);        /* asoma hasta el borde derecho de la ventana */
    padding: 4px var(--ml-gutter, 16px) 4px 0;
  }
  .mlproj__list::-webkit-scrollbar { display: none; }
  .mlproj__item { flex: 0 0 min(78vw, 320px); scroll-snap-align: start; }
  .mlproj__card { height: auto; aspect-ratio: 4 / 5; }
  .mlproj__text { max-height: none; opacity: 1; margin-top: 6px; font-size: 13px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .mlproj__cta,
  .mlproj__list:hover .mlproj__item:hover .mlproj__cta,
  .mlproj__list:not(:hover) .mlproj__item.is-active .mlproj__cta { max-height: none; opacity: 1; margin-top: 10px; color: #fff; padding: 0; background: none; }
  .mlproj__card:hover .mlproj__cta { background: none; }
  .mlproj__list:hover .mlproj__item:hover .mlproj__text,
  .mlproj__list:not(:hover) .mlproj__item.is-active .mlproj__text { max-height: none; margin-top: 6px; }
}

@media (max-width: 767px) {
  .mlproj { padding: 24px 0 28px; }
  .mlproj__num { top: 14px; left: 16px; }
  .mlproj__body { padding: 16px; }
  .mlproj__panel { margin-top: 8px; padding: 22px 18px 20px; scroll-margin-top: 90px; }
  .mlproj__panel-head { grid-template-columns: 1fr auto; gap: 12px; padding-bottom: 18px; margin-bottom: 18px; }
  .mlproj__panel-num { display: none; }
  .mlproj__cols { grid-template-columns: 1fr; gap: 22px; }
  .mlproj__panel-foot { justify-content: stretch; }
  .mlproj__advice { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .mlproj__item, .mlproj__bg, .mlproj__text, .mlproj__cta, .mlproj__cta svg { transition: none; }
  .mlproj__panel { animation: none; }
}

/* 23/10: enlace a la página CMS del sector (categoría CMS «Proyectos profesionales»), junto a «Solicitar asesoramiento» */
.mlproj__panel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.mlproj .mlproj__more { color: var(--mlproj-ink); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mlproj .mlproj__more:hover { color: #3750a3; }

/* 19/11/2026: el texto de la tarjeta abierta sale entero (el tope de 7em lo cortaba incluso a 1920 px). */
@media (min-width: 768px) {
  .mlproj__list:hover .mlproj__item:hover .mlproj__text,
  .mlproj__list:not(:hover) .mlproj__item.is-active .mlproj__text,
  .mlproj__item:has(.mlproj__card:focus-visible) .mlproj__text { max-height: 20em; }
}

/* 19/11/2026: «Ver el proyecto completo» en píldora azul (el del botón «Añadir al carrito»), texto blanco */
.mlproj .mlproj__more {
  display: inline-flex; align-items: center; padding: 9px 12px; border-radius: 100vw;
  background: #1d2a55; color: #fff !important; font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: 0;
  text-decoration: none !important; white-space: nowrap; transition: background-color .2s ease;
}
.mlproj .mlproj__more:hover, .mlproj .mlproj__more:focus { background: #3750a3; color: #fff !important; }
/* Móvil: el desplegable llega hasta el separador (cabecera del sector); las columnas se ocultan */
@media (max-width: 767px) {
  .mlproj .mlproj__cols { display: none; }
  .mlproj .mlproj__panel-head { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
}

/* 23/11/2026: al abrir un sector la página baja hasta la tarjeta, 12 px por debajo de la cabecera fija (--ml-header-bottom) */
.mlproj__item { scroll-margin-top: calc(var(--ml-header-bottom, 60px) + 12px); }

/* Título y servicios conservados del diseño aprobado el 25/11/2026. */
.mlsolutions-heading {
  max-width: var(--ml-max, 1860px);
  margin: 32px auto 20px;
  padding-inline: var(--ml-gutter, 16px);
  box-sizing: border-box;
}
.mlsolutions-heading h2 {
  margin: 0;
  color: #333;
  font-size: clamp(28px, 2.1vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
.mlproj.mlproj--flip { padding-top: 0; }
.mlproj--flip .mlproj__layout {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(0, 1.8fr);
  gap: 24px;
  align-items: center;
}
.mlproj--flip .mlproj__intro {
  position: relative;
  align-self: stretch;
  min-width: 0;
  padding: 8px 0 16px;
  background: #fff;
}
.mlproj--flip .mlproj__intro .mlsec__head { display: block; margin-bottom: 20px; }
.mlproj--flip .mlproj__intro .mlsec__intro { max-width: 52ch; }
.mlproj--flip .mlproj__services {
  counter-reset: mlproj-service;
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
}
.mlproj--flip .mlproj__services li {
  counter-increment: mlproj-service;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  color: #3c4149;
  font-size: 15px;
  line-height: 1.5;
}
.mlproj--flip .mlproj__services li::before {
  content: counter(mlproj-service, decimal-leading-zero);
  color: #9298a1;
  font-variant-numeric: tabular-nums;
}
/* 26/11/2026: coverflow 3D solicitado; el detalle sigue al sector frontal. */
.mlproj--flip .mlproj__layout { grid-template-columns: minmax(250px,.72fr) minmax(0,1.9fr); }
.mlproj--flip .mlproj__stage {
  --flip-width: min(64%, 600px);
  --flip-height: clamp(240px, 18vw, 310px);
  position: relative;
  min-width: 0;
  height: calc(var(--flip-height) + 52px);
  overflow: hidden;
  perspective: 1100px;
  isolation: isolate;
}
.mlproj--flip .mlproj__list {
  display: flex;
  gap: 16px;
  margin: 0 !important;
  padding: 0 12px !important;
  height: var(--flip-height);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.mlproj--flip .mlproj__item {
  flex: 0 0 var(--flip-width);
  width: var(--flip-width);
  min-width: 0;
  height: var(--flip-height);
  border-radius: 12px;
  filter: none !important;
  box-shadow: none !important; /* taste-skill-ignore: neutraliza la sombra heredada. */
  scroll-snap-align: center;
}
.mlproj--flip .mlproj__card {
  width: 100%; height: 100%; aspect-ratio: auto;
  border-radius: var(--mlproj-card-radius,12px);
  backface-visibility: hidden;
  box-shadow: none; /* taste-skill-ignore: neutraliza la sombra heredada. */
}
.mlproj--flip .mlproj__bg { transform: none; object-fit: cover; }
.mlproj--flip.is-flip-ready .mlproj__item:not(.is-current) { --mlproj-card-radius: 18px; }
.mlproj--flip.is-flip-ready .mlproj__item.is-distant { --mlproj-card-radius: 22px; }
.mlproj--flip .mlproj__bg, .mlproj--flip .mlproj__card::after { border-radius: var(--mlproj-card-radius,12px); clip-path: inset(0 round var(--mlproj-card-radius,12px)); }
.mlproj--flip .mlproj__body { inset: auto 0 0; width: auto; padding: 22px; align-items: flex-start; text-align: left; }
.mlproj--flip .mlproj__title { font-size: clamp(18px, 1.5vw, 24px); font-weight: 500; line-height: 1.18; }
.mlproj--flip .mlproj__text {
  display: block; max-width: none; max-height: none !important;
  margin-top: 8px !important; overflow: visible; opacity: 1;
  -webkit-line-clamp: unset; color: #fff; font-size: 13px; line-height: 1.45;
}
.mlproj--flip .mlproj__cta, .mlproj--flip .mlproj__num { display: none !important; }
.mlproj--flip.is-flip-ready .mlproj__item:not(.is-current) .mlproj__text { display: none; }
.mlproj--flip.is-flip-ready .mlproj__item.is-distant .mlproj__body { visibility: hidden; }
.mlproj--flip.is-flip-ready .mlproj__list {
  display: block; position: relative; padding: 0 !important;
  overflow: visible; scroll-snap-type: none;
  transform-style: preserve-3d;
}
.mlproj--flip.is-flip-ready .mlproj__item {
  position: absolute; top: 50%; left: 50%;
  transition: transform 750ms cubic-bezier(.65,0,.35,1), opacity 400ms ease;
}
.mlproj--flip .mlproj__carousel-controls {
  position: absolute; bottom: 0; left: 50%; z-index: 10;
  display: flex; align-items: center; gap: 8px; transform: translateX(-50%);
}
.mlproj--flip .mlproj__carousel-controls[hidden], .mlproj--flip .mlproj__toggle[hidden] { display: none; }
.mlproj--flip .mlproj__carousel-controls .mlsec__btn { width: 40px; height: 40px; }
.mlproj--flip .mlproj__carousel-count { font-size: 13px; min-width: 38px; text-align: center; color: #6b7280; font-variant-numeric: tabular-nums; }
.mlproj--flip .mlproj__toggle .mlproj__play { display: none; }
.mlproj--flip .mlproj__toggle[aria-pressed=true] .mlproj__play { display: block; }
.mlproj--flip .mlproj__toggle[aria-pressed=true] .mlproj__pause { display: none; }
.mlproj--flip .mlproj__panels { margin-top: 16px; }
.mlproj--flip .mlproj__panel { margin-top: 0; padding: 20px 24px; animation: none; }
.mlproj--flip .mlproj__panel-head { display: block; padding-bottom: 0; margin-bottom: 18px; border-bottom: 0; }
.mlproj--flip .mlproj__panel-title { margin: 0; font-size: 19px; line-height: 1.3; }
.mlproj--flip .mlproj__more { font-size: 13px; }
.mlproj--flip .mlproj__panel-num, .mlproj--flip .mlproj__close, .mlproj--flip .mlproj__panel-text { display: none; }
.mlproj--flip .mlproj__cols { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.mlproj--flip .mlproj__col--ben { grid-column: auto; }
.mlproj--flip .mlproj__h { margin-bottom: 8px; font-size: 13px; color: #515b6d; text-transform: none; letter-spacing: 0; }
.mlproj--flip .mlproj__dots li, .mlproj--flip .mlproj__checks li { padding-block: 4px; font-size: 13px; line-height: 1.45; }
.mlproj--flip .mlproj__dots li::before { top: 11px; }
.mlproj--flip .mlproj__panel-foot { margin-top: 14px; }
/* Todos conservan su altura en escritorio: al rotar no salta el contenido posterior. */
@media (min-width: 1101px) {
  .mlproj--flip.is-flip-ready .mlproj__panels { display: grid; }
  .mlproj--flip.is-flip-ready .mlproj__panel { grid-area: 1 / 1; }
  .mlproj--flip.is-flip-ready .mlproj__panel[hidden] { display: block !important; visibility: hidden; pointer-events: none; }
}
.mlproj--flip:not(.is-flip-ready) .mlproj__panel[hidden] { display: block !important; }
@media (min-width: 1101px) and (max-width: 1399px) {
  .mlsolutions-heading { margin-bottom: 16px; }
  .mlproj--flip .mlproj__intro { padding-bottom: 8px; }
  .mlproj--flip .mlproj__intro .mlsec__head { margin-bottom: 14px; }
  .mlproj--flip .mlproj__services { gap: 10px; }
  .mlproj--flip .mlproj__services li { font-size: 14px; line-height: 1.4; }
  .mlproj--flip .mlproj__panel { padding: 18px 22px; }
  .mlproj--flip .mlproj__panel-head { margin-bottom: 14px; }
}
@media (max-width: 1100px) {
  .mlproj--flip .mlproj__layout { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .mlproj--flip .mlproj__intro { padding-bottom: 0; background-image: none; }
  .mlproj--flip .mlproj__intro .mlsec__head { margin-bottom: 0; }
  .mlproj--flip .mlproj__services { display: none; }
  .mlproj--flip .mlproj__stage { --flip-width: min(68%,560px); --flip-height: 260px; }
  .mlproj--flip .mlproj__cols { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mlproj--flip .mlproj__col--ben { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .mlproj--flip .mlproj__panels { display: none !important; }
  .mlproj--flip .mlproj__stage { --flip-width: 82%; --flip-height: 250px; }
  .mlproj--flip .mlproj__body { padding: 16px; }
  .mlproj--flip .mlproj__title { font-size: 18px; }
  .mlproj--flip .mlproj__text { font-size: 13px; }
  .mlproj--flip .mlproj__carousel-controls .mlsec__btn { width: 44px; height: 44px; }
  .mlproj--flip .mlproj__panel { padding: 18px; }
  .mlproj--flip .mlproj__cols { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .mlproj--flip .mlproj__col--ben { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .mlproj--flip.is-flip-ready .mlproj__item { transition: none; }
}


