/* ==========================================================================
   Nomad Studio Marketplace Styles
   - Hero: 2-Column Editorial Mosaic (Matching Library Hero Image 1)
   - Packs Section: Centered Head (Matching Image 3)
   - Cards: mp-card with Brand Theme Neon Interactions (#4D7CFE -> #8B5CF6 -> #C084FC)
   ========================================================================== */


/* ==========================================================================
   1. Marketplace Hero — Editorial Mosaic Layout (Image 1 Style)
   ========================================================================== */

.market-hero {
  padding: clamp(50px, 6.5vw, 100px) 0 clamp(40px, 5vw, 70px);
  background: radial-gradient(ellipse at 82% 25%, rgba(77, 124, 254, 0.12), transparent 62%);
  position: relative;
  overflow: clip;
}

.market-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: clamp(36px, 5vw, 80px);
  /* Keep text and mosaic close to the middle on wide screens. */
  max-width: 1240px;
  margin-inline: auto;
}

.market-hero-copy {
  padding-block: 20px;
}

.market-kicker {
  display: inline-block;
  color: #7AA0FF;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.market-hero-title {
  font-size: clamp(2.8rem, 4.6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: normal;
  font-weight: 750;
  margin: 0 0 22px;
  color: var(--txt);
}

.market-hero-title em {
  color: #c4a9ff;
  font-style: normal;
}

.market-hero-lead {
  font-size: clamp(1.05rem, 1.3vw, 1.18rem);
  line-height: 1.65;
  color: var(--txt-2);
  max-width: 560px;
  margin: 0 0 28px;
}

.market-hero-copy .btn-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.market-hero-note {
  font-size: 0.86rem;
  color: var(--txt-3);
  margin-top: 22px;
}

/* Mosaic 3-image layout */
.market-mosaic {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  grid-template-rows: 1fr 0.9fr;
  gap: 16px;
  height: clamp(430px, 39vw, 590px);
}

.market-mosaic > div {
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--ink-800);
}

.market-mosaic-tall {
  grid-row: 1 / 3;
  margin-top: 48px;
  margin-bottom: 24px;
}

.market-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.market-mosaic-tall img {
  object-position: 50% 35%;
}

@media (max-width: 1050px) {
  .market-hero-grid {
    gap: 32px;
  }
  .market-mosaic {
    height: 450px;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .market-hero {
    padding-top: 36px;
    padding-bottom: 42px;
  }
  .market-hero-grid {
    grid-template-columns: 1fr;
  }
  .market-hero-copy {
    max-width: 650px;
  }
  .market-mosaic {
    height: 430px;
  }
  .market-mosaic-tall {
    margin-top: 24px;
    margin-bottom: 12px;
  }
}

@media (max-width: 420px) {
  .market-mosaic {
    height: 340px;
    gap: 10px;
  }
  .market-mosaic > div {
    border-radius: 12px;
  }
}

/* ==========================================================================
   2. Packs Section & Centered Head (Image 3 Style)
   ========================================================================== */

.market-packs-sec {
  padding-top: clamp(20px, 3vw, 44px);
  padding-bottom: clamp(40px, 5vw, 80px);
}

.market-packs-sec .sec-head.is-center {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: 38px;
}

.market-packs-sec .sec-head .eyebrow {
  display: inline-block;
  color: #7AA0FF;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.market-packs-sec .sec-head .d2 {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 750;
  line-height: 1.12;
  color: var(--txt);
  margin: 0 0 16px;
}

.market-packs-sec .sec-head .lead {
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.62;
  color: var(--txt-2);
  margin-inline: auto;
  max-width: 640px;
}

/* ==========================================================================
   3. Marketplace Grid & Cards (mp-card Specification)
   ========================================================================== */

.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 28px 24px;
  margin-top: 24px;
}
.mp-grid .mp-card {
  max-width: none;
}

@media (max-width: 1040px) {
  .mp-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 680px) {
  .mp-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Card Tokens & Structure (Base HSL: S=51%, L=21% constantes) */
.mp-card {
  --card-h: 230; /* Default Indigo */
  --card-s: 51%;
  --card-l: 21%;
  --card-bg: hsl(var(--card-h), var(--card-s), var(--card-l));
  --grad-brand: linear-gradient(100deg, #4D7CFE 0%, #8B5CF6 55%, #C084FC 100%);
  --grad-brand-active: linear-gradient(100deg, #3B6EF8 0%, #7C45F4 55%, #D088FF 100%);
  --text-strong: #ffffff;
  --text-body: hsl(var(--card-h), 50%, 84%);
  --text-muted: hsl(var(--card-h), 34%, 62%);
  --text-link: hsl(var(--card-h), 42%, 72%);
  --btn-hover: #e6eaff;

  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 320px;
  padding: 20px 20px 18px;
  border-radius: 28px;
  background: var(--card-bg);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  border: none;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

/* ==========================================================================
   Orientaciones de Packs (S = 51%, L = 21% constantes, variación sutil de Hue 220° - 246°)
   ========================================================================== */
.mp-card[data-orientation="create"]         { --card-h: 230; } /* Azul Índigo Nomad base (Modelos, CivitAI) */
.mp-card[data-orientation="mix"]            { --card-h: 222; } /* Matiz azul acero sutil (Mix / Multi-referencia) */
.mp-card[data-orientation="portrait"]       { --card-h: 242; } /* Matiz violeta índigo sutil (Retrato, Piel, Skin Detailer) */
.mp-card[data-orientation="creator"]        { --card-h: 236; } /* Azul índigo noble (Creator Pack, Avatares) */
.mp-card[data-orientation="photo"]          { --card-h: 225; } /* Azul medianoche (Photo Editing, Cámara) */
.mp-card[data-orientation="cutout"]         { --card-h: 220; } /* Azul zafiro (Background Tools, Extract) */
.mp-card[data-orientation="styling"]        { --card-h: 246; } /* Índigo iris (Pixel art, Transferencia de estilo) */
.mp-card[data-orientation="presets"]        { --card-h: 234; } /* Azul cobalto profundo (Presets Core, Film & Shadow) */
.mp-card[data-orientation="presets-light"]  { --card-h: 226; } /* Azul etéreo (Open Air) */
.mp-card[data-orientation="styles"]         { --card-h: 240; } /* Índigo suave (Estilos básicos y Fan) */
.mp-card[data-orientation="styles-creative"]{ --card-h: 244; } /* Violeta índigo suave (Pro Creative & Genre) */
.mp-card[data-orientation="styles-photo"]   { --card-h: 228; } /* Azul de estudio (Pro Photography & Commercial) */

/* Hover: Neones del Theme Nomad (#4D7CFE ➔ #8B5CF6 ➔ #C084FC) sobre el fondo base */
.mp-card:hover {
  background:
    linear-gradient(135deg, rgba(77, 124, 254, 0.12) 0%, rgba(139, 92, 246, 0.15) 55%, rgba(192, 132, 252, 0.12) 100%),
    hsl(var(--card-h), var(--card-s), var(--card-l));
  border: none;
  box-shadow:
    0 18px 44px -10px rgba(0, 0, 0, 0.75),
    0 0 30px -4px rgba(139, 92, 246, 0.35);
  transform: translateY(-3px);
}

.mp-card:hover .mp-card__meta {
  color: #c4a9ff;
  transition: color 0.2s ease;
}

/* Click / Active: Neón más intenso todavía */
.mp-card:active {
  background:
    linear-gradient(135deg, rgba(77, 124, 254, 0.22) 0%, rgba(139, 92, 246, 0.28) 55%, rgba(192, 132, 252, 0.22) 100%),
    hsl(var(--card-h), var(--card-s), calc(var(--card-l) + 2%));
  border: none;
  box-shadow:
    0 12px 30px -6px rgba(0, 0, 0, 0.85),
    0 0 36px 4px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px) scale(0.995);
}

.mp-card:active .mp-card__meta {
  color: #e0c8ff;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.7);
}

.mp-card.mp-card--has-media,
.mp-card:has(.mp-card__media) {
  padding: 0;
  min-height: auto;
  height: auto;
  align-self: start;
}

.mp-card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  margin: 0;
  background: rgba(0, 0, 0, 0.35);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

.mp-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.mp-card:hover .mp-card__media img {
  transform: scale(1.03);
  filter: brightness(1.04);
}

.mp-card__media-overlay {
  position: absolute;
  bottom: 12px;
  left: 18px;
  max-width: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.mp-card__media-meta {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
  background: none;
  border: none;
  padding: 0;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.95),
    0 3px 10px rgba(0, 0, 0, 0.9),
    0 0 16px rgba(0, 0, 0, 0.85);
}

.mp-card__media-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: #e2e8f8;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.95),
    0 3px 12px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(0, 0, 0, 0.85);
  text-wrap: pretty;
}

.mp-card.mp-card--has-media .mp-card__body {
  padding: 8px 18px 10px;
  display: flex;
  flex-direction: column;
}

.mp-card.mp-card--has-media .mp-card__body .mp-card__actions {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mp-card.mp-card--has-media .mp-card__body .mp-card__btn {
  padding: 7px 18px;
  font-size: 13px;
}

.mp-card.mp-card--has-media .mp-card__body .mp-card__link {
  font-size: 12.5px;
}

.mp-card__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-card__meta {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--card-h), 55%, 72%);
  line-height: 1.2;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.mp-card__title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-strong);
}

.mp-card__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-body);
  text-wrap: pretty;
  min-height: 46px;
}

.mp-card__details {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
  min-height: 42px;
}

.mp-card__details li {
  margin: 0;
  padding: 0;
}

.mp-card__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: auto;
  padding-top: 14px;
  flex-wrap: wrap;
}

/* Botón con el degradado del theme en hover y click intenso */
.mp-card__btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 999px;
  background: var(--text-strong);
  color: hsl(var(--card-h), var(--card-s), var(--card-l));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease, transform 0.2s ease;
}

.mp-card__btn:hover,
.mp-card:hover .mp-card__btn {
  background: var(--grad-brand);
  color: #ffffff;
  box-shadow: 0 12px 30px -10px rgba(77, 124, 254, 0.85), 0 0 24px rgba(139, 92, 246, 0.6);
  filter: saturate(1.12);
  transform: translateY(-1px);
}

.mp-card__btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.18);
  box-shadow: 0 16px 36px -8px rgba(77, 124, 254, 0.95), 0 0 28px rgba(192, 132, 252, 0.7);
}

.mp-card__btn:active {
  background: var(--grad-brand-active);
  color: #ffffff;
  box-shadow: 0 20px 44px -6px rgba(77, 124, 254, 1), 0 0 38px rgba(192, 132, 252, 0.95);
  filter: saturate(1.35) brightness(1.12);
  transform: translateY(0) scale(0.97);
}

/* Pack que ya viene dentro de la app: etiqueta, no botón */
.mp-card__btn.mp-card__btn--included,
.mp-card:hover .mp-card__btn.mp-card__btn--included {
  cursor: default;
  background: transparent;
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--text-strong);
  filter: none;
  transform: none;
}

.mp-card__btn:focus-visible {
  outline: 2px solid var(--text-body);
  outline-offset: 2px;
}

.mp-card__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-link);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.mp-card__link:hover {
  color: #ffffff;
  text-shadow: 0 0 14px hsla(var(--card-h), 85%, 72%, 0.75);
}

.mp-card__link:active {
  color: #ffffff;
  text-shadow: 0 0 22px hsla(var(--card-h), 90%, 75%, 1);
}

.mp-card__link:focus-visible {
  outline: 2px solid var(--text-body);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Shared navigation */
@media (prefers-reduced-motion:reduce) { .mp-card, .mp-card__btn { transition:none; transform:none !important; } }