/* ==========================================================================
   Primible — «Imprime tu modelo de MakerWorld» (makerworld.php y su sección del home)
   ========================================================================== */

.mw { color: #fff; }
.mw-logo {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--s, 20px);
  height: var(--s, 20px);
  border-radius: 50%;
  background: #00ae42;
  color: #fff;
  font-size: calc(var(--s, 20px) * .38);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}

/* ---------- Pegar el enlace ---------- */
.mw-paste {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  padding: 6px;
  border: 1.5px solid rgba(214, 107, 255, .45);
  border-radius: 999px;
  background: rgba(177, 20, 255, .08);
  box-shadow: 0 20px 50px -24px rgba(177, 20, 255, .7);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.mw-paste:focus-within { border-color: #b114ff; box-shadow: 0 0 0 4px rgba(177, 20, 255, .2), 0 20px 50px -24px rgba(177, 20, 255, .8); }
.mw-paste__icon { display: grid; place-items: center; padding: 0 6px 0 8px; }
html .mw-paste input[type="url"] {
  flex: 1;
  min-width: 0;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 16px !important;
  outline: none !important;
}
.mw-paste input::placeholder { color: rgba(255, 255, 255, .45); }
html .mw-paste button {
  display: inline-flex !important;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8d0dcc, #b114ff 55%, #c547ff);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.mw-paste--sm { max-width: 520px; }
.mw-paste--sm input[type="url"], .mw-paste--sm button { height: 46px !important; }

/* ---------- Portada ---------- */
.mw-hero { position: relative; overflow: hidden; padding: clamp(36px, 6vw, 90px) 0 clamp(48px, 7vw, 100px); border-bottom: 1px solid rgba(255, 255, 255, .06); isolation: isolate; }
.mw-hero .inner-hero__extruder { top: clamp(40px, 5vw, 80px); left: max(150px, calc(50% - 560px)); width: clamp(250px, 19vw, 320px); opacity: .08 !important; }
.mw-hero .primible-hero-filament { z-index: 1; }
.mw-hero__inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
html .mw .mw-hero__title { margin: 14px 0 18px !important; color: #fff !important; font-size: clamp(34px, 4.2vw, 62px) !important; font-weight: 600 !important; line-height: 1.02 !important; letter-spacing: -.035em !important; text-wrap: balance; }
.mw .mw-hero__lead { max-width: 54ch; margin: 0 0 26px !important; color: rgba(255, 255, 255, .75); font-size: clamp(16px, 1.25vw, 18px); line-height: 1.6; }
.mw .mw-hero__alt { margin: 16px 0 0 !important; color: rgba(255, 255, 255, .6); font-size: 14.5px; }
.mw-hero__alt a { color: #3ccf91 !important; font-weight: 600; }
.mw-hero__copy > * { animation: blogUp .7s cubic-bezier(.2, .8, .2, 1) both; }
.mw-hero__copy > *:nth-child(2) { animation-delay: .06s; }
.mw-hero__copy > *:nth-child(3) { animation-delay: .12s; }
.mw-hero__copy > *:nth-child(4) { animation-delay: .18s; }
.mw-hero__copy > *:nth-child(5) { animation-delay: .24s; }

/* Animación: navegador de MakerWorld → enlace viaja → llega a Primible */
.mw-hero__visual { position: relative; height: clamp(340px, 32vw, 460px); }
.mw-browser {
  position: absolute;
  top: 0;
  left: 0;
  width: 82%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  background: #1e1e20;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
  animation: blogIn .9s cubic-bezier(.2, .8, .2, 1) both, blogFloat 8s ease-in-out infinite .9s;
}
.mw-browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: #262628; }
.mw-browser__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.mw-browser__bar i:first-child { background: #ff5f57; }
.mw-browser__bar i:nth-child(2) { background: #febc2e; }
.mw-browser__bar i:nth-child(3) { background: #28c840; }
.mw-browser__bar b { flex: 1; margin-left: 10px; padding: 5px 12px; overflow: hidden; border-radius: 999px; background: #1a1a1c; color: rgba(255, 255, 255, .6); font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; }
.mw-browser__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.mw-browser__tile { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 14px; background: #2a2a2d; animation: mwPick 6s ease-in-out infinite; animation-delay: calc(var(--i) * 1.5s); }
.mw-browser__tile img { width: 100% !important; height: 100% !important; object-fit: cover; }
@keyframes mwPick { 0%, 18%, 100% { box-shadow: 0 0 0 0 rgba(0, 174, 66, 0); } 6%, 12% { box-shadow: 0 0 0 3px #00ae42; } }
.mw-browser__cursor { position: absolute; top: 40%; left: 30%; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: rgba(255, 255, 255, .25); transform: rotate(-45deg); animation: mwCursor 6s ease-in-out infinite; }
@keyframes mwCursor { 0%, 100% { top: 34%; left: 26%; } 25% { top: 34%; left: 72%; } 50% { top: 76%; left: 26%; } 75% { top: 76%; left: 72%; } }

.mw-flow { position: absolute; right: 9%; bottom: 25%; width: 3px; height: 34%; border-radius: 3px; background: linear-gradient(180deg, rgba(0, 174, 66, .1), rgba(177, 20, 255, .7)); }
.mw-flow span { position: absolute; top: 0; left: 50%; padding: 5px 10px; border-radius: 999px; background: #00ae42; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; transform: translateX(-50%); animation: mwFlow 3s ease-in-out infinite; }
@keyframes mwFlow { 0% { top: -10%; opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; background: #b114ff; } 100% { top: 100%; opacity: 0; background: #b114ff; } }

.mw-arrive {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 12px;
  border: 1px solid rgba(214, 107, 255, .45);
  border-radius: 20px;
  background: rgba(36, 36, 38, .94);
  box-shadow: 0 24px 50px -20px rgba(177, 20, 255, .7);
  animation: blogIn .9s cubic-bezier(.2, .8, .2, 1) .3s both, blogFloat 7s ease-in-out infinite -2s;
}
.mw-arrive img { width: 48px; height: 48px; border-radius: 50%; }
.mw-arrive b { color: #fff; font-size: 14.5px; }

/* ---------- Pasos ---------- */
.mw-steps, .mw-featured { padding: clamp(56px, 7vw, 100px) 0; }
.mw-steps__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); margin: clamp(24px, 3vw, 40px) 0 0 !important; padding: 0 !important; list-style: none !important; counter-reset: none; }
.mw-step { position: relative; margin: 0 !important; padding: 28px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 24px; background: #2a2a2d; transition: border-color .3s ease, transform .3s ease; }
.mw-step:hover { border-color: rgba(214, 107, 255, .45); transform: translateY(-3px); }
.mw-step__icon { position: relative; display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 20px; background: radial-gradient(circle at 30% 25%, rgba(214, 107, 255, .35), transparent 65%), #2f2a36; color: #e3b3ff; animation: empFloat 5s ease-in-out infinite; animation-delay: calc(var(--i) * -1.4s); }
.mw-step__icon > span { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 26px; height: 26px; border: 3px solid #2a2a2d; border-radius: 50%; background: #b114ff; color: #fff; font-size: 11px; font-weight: 700; }
html .mw-step h3 { margin: 0 0 8px !important; color: #fff !important; font-size: 19px !important; font-weight: 600 !important; }
.mw-step p { margin: 0 !important; color: rgba(255, 255, 255, .65); line-height: 1.55; }

/* ---------- Modelos destacados ---------- */
.mw-featured__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(24px, 3vw, 40px); }
.mw-featured__head .sec-title { margin-bottom: 0 !important; }
.mw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 30px); }
html.primible-brand-ui article.mwcard, html article.mwcard { margin: 0 !important; padding: 0 !important; }
.mwcard { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); border-radius: 22px; background: #2a2a2d; transition: border-color .3s ease, transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease; }
.mwcard:hover { border-color: rgba(0, 174, 66, .5); box-shadow: 0 30px 60px -30px rgba(0, 174, 66, .45); transform: translateY(-4px); }
.mwcard__media { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #232325; }
.mwcard__media img { width: 100% !important; height: 100% !important; object-fit: cover; transition: transform 1s cubic-bezier(.2, .8, .2, 1); }
.mwcard:hover .mwcard__media img { transform: scale(1.07); }
.mwcard__ph { display: grid; place-items: center; height: 100%; }
.mwcard__tag { position: absolute; top: 12px; left: 12px; padding: 5px 11px; border-radius: 999px; background: #b114ff; color: #fff; font-size: 11.5px; font-weight: 700; }
.mwcard__src { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(20, 20, 22, .75); color: #fff; font-size: 11.5px; font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mwcard:hover .mwcard__src { opacity: 1; transform: none; }
.mwcard__body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 16px 18px 18px; }
html .mwcard__name { margin: 0 !important; color: #fff !important; font-size: 16px !important; font-weight: 600 !important; line-height: 1.3 !important; }
.mwcard__by { color: rgba(255, 255, 255, .55); font-size: 13px; }
.mwcard__cta { margin-top: auto; padding-top: 10px; color: #d66bff !important; font-size: 14px; font-weight: 600; text-decoration: none !important; }
.mwcard__cta:hover { color: #fff !important; }

/* ---------- Cierre ---------- */
.mw-close { padding: 0 0 clamp(56px, 7vw, 100px); }
.mw-close__card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; padding: clamp(28px, 4vw, 52px); border: 1px solid rgba(214, 107, 255, .3); border-radius: 30px; background: radial-gradient(80% 120% at 100% 0%, rgba(177, 20, 255, .3), transparent 60%), radial-gradient(60% 100% at 0% 100%, rgba(0, 174, 66, .14), transparent 60%), #2a2730; }
html .mw-close__card h2 { margin: 0 0 8px !important; color: #fff !important; font-size: clamp(24px, 2.6vw, 36px) !important; font-weight: 600 !important; line-height: 1.1 !important; }
.mw-close__card p { max-width: 52ch; margin: 0 !important; color: rgba(255, 255, 255, .72); }
.mw-close__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sección del home ---------- */
.mw-home { padding: clamp(48px, 7vw, 100px) 0; }
.mw-home__card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: center; padding: clamp(26px, 4vw, 56px); overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); border-radius: 32px; background: radial-gradient(70% 100% at 100% 0%, rgba(0, 174, 66, .12), transparent 60%), radial-gradient(70% 100% at 0% 100%, rgba(177, 20, 255, .2), transparent 60%), #262529; }
.mw-home__card.is-solo { grid-template-columns: 1fr; }
.mw-home__copy .sec-title { margin-bottom: 12px !important; }
.mw-home__copy p { max-width: 48ch; margin: 0 0 22px !important; color: rgba(255, 255, 255, .72); font-size: 16px; line-height: 1.6; }
.mw-home__explore { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; }
html .mw-home__btn { display: inline-flex; flex: none; align-items: center; gap: 10px; padding: 11px 20px 11px 12px; border: 1px solid rgba(60, 207, 145, .45); border-radius: 999px; background: rgba(0, 174, 66, .12); color: #fff !important; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none !important; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
html .mw-home__btn:hover { background: rgba(0, 174, 66, .24); border-color: #3ccf91; transform: translateY(-1px); }
.mw-home__btn-ico { display: inline-flex; }
.mw-home__hint { flex: 1 1 220px; max-width: 34ch; color: rgba(255, 255, 255, .6); font-size: 13.5px; line-height: 1.45; }
.mw-home__more { display: inline-block; margin-top: 18px; color: #d66bff !important; font-weight: 600; text-decoration: none !important; }
.mw-home__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mw-home__tile { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; background: #2a2a2d; color: #fff !important; text-decoration: none !important; animation: blogFloat 7s ease-in-out infinite; animation-delay: calc(var(--i) * -1.7s); }
.mw-home__tile:nth-child(even) { margin-top: 26px; }
.mw-home__tile img { width: 100% !important; height: 100% !important; object-fit: cover; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.mw-home__tile:hover img { transform: scale(1.08); }
.mw-home__tile-name { position: absolute; right: 0; bottom: 0; left: 0; display: grid; gap: 2px; padding: 30px 14px 12px; background: linear-gradient(0deg, rgba(18, 17, 20, .92), transparent); font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.mw-home__tile-name small { color: #3ccf91; font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.mw-home__tile:hover .mw-home__tile-name small { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .mw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mw-hero__inner, .mw-home__card { grid-template-columns: 1fr; }
  .mw-hero__visual { height: 320px; max-width: 480px; }
  .mw-steps__list { grid-template-columns: 1fr; }
  .mw-hero .inner-hero__extruder { left: 70%; width: 200px; opacity: .06 !important; }
}
@media (max-width: 560px) {
  .mw-paste { flex-wrap: wrap; border-radius: 22px; }
  html .mw-paste input[type="url"] { flex: 1 1 calc(100% - 50px); }
  html .mw-paste button { flex: 1 1 100%; justify-content: center; }
  .mw-close__ctas .about-btn { flex: 1 1 100%; }
  html .mw-home__btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .mw-browser, .mw-browser__tile, .mw-browser__cursor, .mw-flow span, .mw-arrive, .mw-step__icon, .mw-home__tile, .mw-hero__copy > * { animation: none; }
}

/* El filamento de la boquilla pasa por detrás de las secciones */
.mw > section:not(.mw-hero) { position: relative; z-index: 2; }

/* El estilo general de los campos del tema no aplica dentro de la cápsula */
html.primible-brand-ui .mw-paste input[type="url"],
html.dark-mode .mw-paste input[type="url"] { border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
/* Le gana a «html.dark-mode input:not(…):not(…):not(…)» del tema */
html.dark-mode .mw-paste input[type="url"][name="d"]:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html.primible-brand-ui .mw-paste input[type="url"][name="d"]:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]) {
  height: 50px !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ---------- Banner del home sin modelos: foto difuminada a la derecha ---------- */
.mw-home__card { position: relative; isolation: isolate; }
.mw-home__card.has-photo { min-height: clamp(320px, 30vw, 420px); }
.mw-home__card.has-photo .mw-home__copy { position: relative; z-index: 2; max-width: 560px; }
.mw-home__photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 66%;
  overflow: hidden;
  /* La foto se funde con el fondo de la tarjeta hacia la izquierda */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .25) 22%, rgba(0, 0, 0, .8) 48%, #000 70%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .25) 22%, rgba(0, 0, 0, .8) 48%, #000 70%);
}
.mw-home__photo img { width: 100% !important; height: 100% !important; object-fit: cover; transition: transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.mw-home__card.has-photo:hover .mw-home__photo img { transform: scale(1.05); }
/* Mismo degradado que las tarjetas de categorías: negro a la izquierda, foto a la derecha */
.mw-home__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .4) 100%);
  pointer-events: none;
}
@media (max-width: 900px) {
  .mw-home__photo { width: 100%; opacity: .35; -webkit-mask-image: none; mask-image: none; }
  .mw-home__scrim { background: linear-gradient(180deg, rgba(38, 37, 41, .7), #262529 85%); }
}

/* ---------- Cápsula de pegar enlace: los estilos generales de botón no aplican ---------- */
html.primible-brand-ui .mw-paste button[type="submit"],
html .mw-paste button[type="submit"] {
  display: inline-flex !important;
  flex: none;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 0 !important;
  height: 46px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #8d0dcc, #b114ff 55%, #c547ff) !important;
  box-shadow: 0 10px 24px -10px rgba(177, 20, 255, .9) !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap;
}
html.primible-brand-ui .mw-paste button[type="submit"]:hover { filter: brightness(1.1); transform: none !important; }
.mw-paste { align-items: center; padding: 5px 5px 5px 6px; }
@media (max-width: 560px) {
  html.primible-brand-ui .mw-paste button[type="submit"], html .mw-paste button[type="submit"] { width: 100% !important; }
}
