/* ═══════════════════════════════════════════════════════════════
   JF Constructor · Optimización compacta V3
   Ajustes para pasos 3, 5, 7, 8 y 9 en escritorio.
   Se carga después de compact-effects-v3.css.
   ═══════════════════════════════════════════════════════════════ */

/* Evita que la guía tape demasiado contenido en escritorio. */
@media (min-width: 901px) {
  #jfg-popup {
    width: min(310px, calc(100vw - 30px)) !important;
    right: 16px !important;
    bottom: 16px !important;
  }
}

/* ═══ ESCRITORIO ═══════════════════════════════════════════════ */
@media (min-width: 901px) {
  /* Cabeceras todavía más contenidas en los pasos densos. */
  #box-2.active > .jf-box-head,
  #box-zonas.active > .jf-box-head,
  #box-pack.active > .jf-box-head,
  #box-regalo.active > .jf-box-head,
  #box-9.active > .jf-box-head {
    max-width: none;
  }

  #box-2.active > .jf-box-head h2,
  #box-zonas.active > .jf-box-head h2,
  #box-pack.active > .jf-box-head h2,
  #box-regalo.active > .jf-box-head h2,
  #box-9.active > .jf-box-head h2 {
    font-size: clamp(1.7rem, 2.15vw, 2.35rem);
  }

  /* ── PASO 3: COLORES + TALLAS SIN SCROLL GENERAL ─────────── */
  #box-2.active {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    align-content: start;
    gap: 10px;
    overflow: hidden;
    padding: 14px 16px 16px;
  }

  #box-2.active > .jf-box-head,
  #box-2.active > #jf-colors-grid,
  #box-2.active > .jf-tallas-wrap {
    grid-column: 1 !important;
  }

  #box-2.active > .jf-box-head {
    margin-bottom: 0;
  }

  #box-2.active > .jf-box-head p {
    margin-bottom: 0;
  }

  #jf-colors-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    align-content: start;
  }

  #box-2 .color-choice {
    min-height: 48px;
    padding: 7px 9px;
    border-width: 1px;
    border-radius: 13px;
    gap: 8px;
  }

  #box-2 .color-choice .jf-color-dot {
    width: 25px;
    height: 25px;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(24,25,22,.10);
  }

  #box-2 .color-choice strong {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.16;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #box-2 .jf-tallas-wrap.visible {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    margin: 0;
    padding: 10px 12px;
    border-radius: 15px;
  }

  #box-2 .jf-tallas-head {
    min-width: 160px;
    margin: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  #box-2 .jf-tallas-head strong {
    font-size: 11px;
    line-height: 1.25;
  }

  #box-2 .jf-tallas-badge {
    padding: 3px 8px;
    font-size: 9px;
  }

  #box-2 .jf-tallas-grid {
    grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
    gap: 5px;
  }

  #box-2 .jf-talla-item {
    gap: 5px;
    padding: 5px 6px;
    border-radius: 10px;
  }

  #box-2 .jf-talla-label {
    font-size: 11px;
  }

  #box-2 .jf-talla-qty {
    width: 40px;
    min-height: 29px;
    padding: 4px;
    border-radius: 8px;
    font-size: 11px;
  }

  #box-2 .jf-tallas-total {
    min-width: 116px;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 11px;
    flex-direction: column;
    gap: 2px;
    color: #fff;
    background: var(--jf-black);
    font-size: 9px;
    line-height: 1.2;
  }

  #box-2 .jf-tallas-total span:last-child {
    color: var(--jf-olive-light);
    font-size: 13px;
  }

  /* ── PASO 5: DISEÑO CONTENIDO EN EL VIEWPORT ────────────── */
  #box-zonas.active {
    display: grid !important;
    grid-template-columns: minmax(320px, .78fr) minmax(540px, 1.22fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 9px 12px;
    overflow: hidden;
    padding: 13px 14px 14px;
  }

  #box-zonas.active > .jf-box-head {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0;
  }

  #box-zonas.active > .jf-box-head p {
    margin-bottom: 0;
  }

  #box-zonas.active > .jf-design-config-panel {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    min-height: 0;
    padding-right: 4px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,137,90,.40) transparent;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    align-content: start;
  }

  #box-zonas .jf-design-config-panel > .jf-zone-topbar,
  #box-zonas .jf-design-config-panel > #jfZoneConfigs,
  #box-zonas .jf-design-config-panel > .jf-zone-summary,
  #box-zonas .jf-design-config-panel > .jf-box-actions {
    grid-column: 1 / -1;
  }

  #box-zonas .jf-zone-topbar {
    min-height: 0;
    margin: 0;
  }

  #box-zonas .jf-zone-topbar-note {
    font-size: 10px;
  }

  #box-zonas .jf-zone-group {
    min-width: 0;
    margin: 0;
  }

  #box-zonas .jf-zone-group h3 {
    margin-bottom: 5px;
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  #box-zonas .jf-zone-grid {
    gap: 5px;
  }

  #box-zonas .jf-zone-card {
    min-height: 50px;
    padding: 7px 8px;
    border-radius: 11px;
  }

  #box-zonas .jf-zone-card strong {
    font-size: 11px;
  }

  #box-zonas .jf-zone-card small {
    margin-top: 2px;
    font-size: 9px;
  }

  #box-zonas #jfZoneConfigs {
    min-width: 0;
  }

  #box-zonas .jf-zone-configs {
    gap: 7px;
    margin-top: 3px;
  }

  #box-zonas .jf-zone-config {
    padding: 9px;
    border-radius: 12px;
  }

  #box-zonas .jf-zone-summary {
    margin: 0;
    padding: 9px 11px;
    border-radius: 11px;
    font-size: 10px;
    line-height: 1.35;
  }

  #box-zonas .jf-box-actions {
    margin: 0;
  }

  #box-zonas .jf-box-actions .jf-next-btn {
    min-height: 42px;
    padding-inline: 18px;
    font-size: 11px;
  }

  #box-zonas.active > .jf-mockup-final-block {
    grid-column: 2;
    grid-row: 2;
    position: static;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  #box-zonas .jf-mockup-box {
    height: 100%;
    min-height: 0;
    padding: 9px;
    border-width: 1px;
    border-radius: 17px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  #box-zonas .jf-mockup-box-head {
    margin: 0 0 6px;
  }

  #box-zonas .jf-mockup-box-head span {
    margin-bottom: 3px;
    font-size: 8px;
  }

  #box-zonas .jf-mockup-box-head h2 {
    margin-bottom: 2px;
    font-size: 17px;
  }

  #box-zonas .jf-mockup-box-head p {
    margin: 0;
    font-size: 9px;
    line-height: 1.3;
  }

  #box-zonas .jf-mockup-wrap {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 172px;
    gap: 7px;
    align-items: stretch;
  }

  #box-zonas .jf-mockup-main {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  #box-zonas .jf-mockup-toolbar {
    margin-bottom: 5px;
  }

  #box-zonas .jf-view-btn {
    min-height: 29px;
    padding-inline: 7px;
    font-size: 8px;
  }

  #box-zonas .jf-mockup-stage {
    height: 100%;
    min-height: 0;
    padding: 5px;
    border-width: 1px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
  }

  #box-zonas .jf-mockup-canvas {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
  }

  #box-zonas .jf-mockup-side-info {
    min-height: 0;
    gap: 5px;
    align-content: start;
  }

  #box-zonas .jf-mockup-editor-box {
    gap: 5px;
    padding: 7px;
    border-width: 1px;
    border-radius: 11px;
  }

  #box-zonas .jf-vdb-wrap {
    padding: 6px 7px;
    margin: 0 !important;
  }

  #box-zonas .jf-vdb-label {
    margin-bottom: 4px;
    font-size: 8px;
  }

  #box-zonas .jf-mockup-width-box,
  #box-zonas .jf-mockup-pad-box {
    padding: 6px;
  }

  #box-zonas .jf-mockup-added-list {
    max-height: 72px;
    padding: 7px;
    border-width: 1px;
    overflow: auto;
  }

  #box-zonas .jf-mockup-added-list strong {
    margin-bottom: 4px;
    font-size: 10px;
  }

  #box-zonas .jf-mockup-actions {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 0;
  }

  #box-zonas .jf-mockup-action-btn {
    min-height: 31px;
    padding: 0 6px;
    font-size: 8px;
  }

  #box-zonas .jf-download-note {
    display: none;
  }

  /* ── PASO 7: PACK COMPLETO SIN SCROLL GENERAL ────────────── */
  #box-pack.active {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 9px;
    overflow: hidden;
    padding: 14px 16px;
  }

  #box-pack.active > .jf-box-head {
    margin: 0;
  }

  #box-pack.active > .jf-box-head p {
    margin-bottom: 0;
  }

  #box-pack.active .jf-pack-grid {
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  #box-pack .jf-pack-item {
    min-width: 0;
    height: 100%;
    padding: 9px;
    gap: 6px;
    border-radius: 14px;
  }

  #box-pack .jf-pack-image {
    height: 96px;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 11px;
  }

  #box-pack .jf-pack-image img {
    padding: 6px;
  }

  #box-pack .jf-pack-top {
    gap: 7px;
  }

  #box-pack .jf-pack-top strong {
    font-size: 13px;
  }

  #box-pack .jf-pack-top span {
    font-size: 12px;
  }

  #box-pack .jf-pack-colors {
    gap: 4px;
    padding: 0;
  }

  #box-pack .jf-pack-color-btn {
    width: 17px;
    height: 17px;
  }

  #box-pack .jf-pack-controls {
    gap: 6px;
  }

  #box-pack .jf-pack-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  #box-pack .jf-pack-check,
  #box-pack .jf-pack-custom {
    min-height: 31px;
    padding: 0 8px;
    font-size: 10px;
  }

  #box-pack .jf-pack-qty-wrap {
    justify-content: space-between;
    gap: 5px;
  }

  #box-pack .jf-pack-qty-wrap span {
    font-size: 9px;
  }

  #box-pack .jf-pack-controls input[type="number"] {
    width: 62px;
    min-height: 31px;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 10px;
  }

  #box-pack .jf-pack-actions {
    margin: 0;
  }

  #box-pack .jf-pack-actions button {
    min-height: 42px;
    font-size: 10px;
  }

  /* ── PASO 8: REGALO REDISEÑADO ───────────────────────────── */
  #box-regalo.active {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    padding: 14px 16px 16px;
  }

  #box-regalo.active > .jf-box-head {
    margin: 0;
  }

  #box-regalo.active > .jf-box-head p {
    margin-bottom: 0;
  }

  .jf-gift-banner {
    margin: 0;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid rgba(124,137,90,.24);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--jf-black);
    background: linear-gradient(135deg, rgba(199,209,155,.86), rgba(231,238,199,.94));
    box-shadow: none;
    animation: none;
    text-align: left;
  }

  .jf-gift-banner > span {
    font-size: 17px;
  }

  .jf-gift-banner strong {
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .jf-gift-banner small {
    color: var(--jf-muted);
    font-size: 10px;
    font-weight: 700;
  }

  .jf-gift-card {
    width: min(100%, 920px);
    min-height: 0;
    margin: 0 auto;
    border: 1px solid var(--jf-border);
    border-radius: 21px;
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(360px, 1.22fr);
    overflow: hidden;
    background: rgba(255,255,255,.80);
    box-shadow: 0 18px 42px rgba(40,35,29,.08);
  }

  .jf-gift-visual {
    position: relative;
    min-height: 280px;
    padding: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f5f1e8, #eae3d8);
  }

  .jf-gift-visual img {
    width: 100%;
    height: 100%;
    max-height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 18px 20px rgba(40,35,29,.15));
    transition: transform .45s cubic-bezier(.2,.7,.2,1);
  }

  .jf-gift-card:hover .jf-gift-visual img {
    transform: scale(1.035) rotate(-1deg);
  }

  .jf-gift-free-badge {
    position: absolute;
    top: 13px;
    left: 13px;
    z-index: 2;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: var(--jf-fiesta);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
  }

  .jf-gift-content {
    min-width: 0;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 13px;
  }

  .jf-gift-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
  }

  .jf-gift-heading small {
    display: block;
    margin-bottom: 4px;
    color: var(--jf-fiesta);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .10em;
    text-transform: uppercase;
  }

  .jf-gift-heading h3 {
    margin: 0;
    color: var(--jf-black);
    font-size: clamp(1.6rem, 2.4vw, 2.25rem);
    line-height: 1;
    letter-spacing: -.04em;
  }

  .jf-gift-heading > strong {
    color: var(--jf-fiesta);
    font-size: 18px;
    white-space: nowrap;
  }

  .jf-gift-field-label {
    display: block;
    margin-bottom: 7px;
    color: var(--jf-muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .jf-gift-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .jf-gift-swatch {
    position: relative;
    width: 34px;
    height: 34px;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    background: var(--gift-color);
    box-shadow: 0 0 0 1px rgba(24,25,22,.14), 0 6px 12px rgba(40,35,29,.10);
    transition: transform .25s ease, box-shadow .25s ease;
  }

  .jf-gift-swatch:hover {
    transform: translateY(-3px) scale(1.06);
  }

  .jf-gift-swatch.active {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 0 0 3px var(--jf-olive), 0 10px 18px rgba(40,35,29,.16);
  }

  .jf-gift-swatch.active::after {
    content: "✓";
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--jf-olive);
    font-size: 8px;
    font-weight: 900;
  }

  .jf-gift-selected {
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid var(--jf-border);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    background: var(--jf-paper-light);
  }

  .jf-gift-selected-dot {
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--gift-selected);
    box-shadow: 0 0 0 1px rgba(24,25,22,.13);
  }

  .jf-gift-selected span:not(.jf-gift-selected-dot) {
    color: var(--jf-muted);
    font-size: 10px;
    font-weight: 700;
  }

  .jf-gift-selected strong {
    color: var(--jf-black);
    font-size: 12px;
  }

  .jf-gift-custom {
    min-height: 58px;
    padding: 9px 11px;
    border: 1px solid rgba(124,137,90,.24);
    border-radius: 14px;
    display: grid;
    grid-template-columns: 18px 30px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    cursor: pointer;
    background: rgba(199,209,155,.18);
    transition: transform .25s ease, background .25s ease;
  }

  .jf-gift-custom:hover {
    transform: translateY(-2px);
    background: rgba(199,209,155,.28);
  }

  .jf-gift-custom input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .jf-gift-custom-box {
    width: 27px;
    height: 27px;
    border: 1px solid rgba(124,137,90,.45);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: transparent;
    background: #fff;
    font-size: 12px;
    font-weight: 900;
    transition: color .2s ease, background .2s ease;
  }

  .jf-gift-custom input:checked + .jf-gift-custom-box {
    color: #fff;
    background: var(--jf-olive);
  }

  .jf-gift-custom strong,
  .jf-gift-custom small {
    display: block;
  }

  .jf-gift-custom strong {
    color: var(--jf-black);
    font-size: 11px;
  }

  .jf-gift-custom small {
    margin-top: 2px;
    color: var(--jf-muted);
    font-size: 9px;
  }

  .jf-gift-custom b {
    color: var(--jf-olive);
    font-size: 11px;
    white-space: nowrap;
  }

  .jf-gift-next {
    width: fit-content;
    min-height: 43px;
    margin-top: 1px;
    padding-inline: 18px;
    font-size: 10px;
  }

  /* ── PASO 9: RESUMEN Y ACCIONES EN PARALELO ─────────────── */
  #box-9.active {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 9px;
    overflow: hidden;
    padding: 14px 16px 16px;
  }

  #box-9.active > .jf-box-head {
    margin: 0;
  }

  #box-9.active > .jf-box-head p {
    margin-bottom: 0;
  }

  .jf-summary-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr);
    gap: 10px;
    align-items: stretch;
  }

  .jf-summary-panel,
  #box-9 .jf-final-block {
    min-height: 0;
  }

  #box-9 .jf-summary-mini-box {
    height: auto;
    padding: 12px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    border-radius: 17px;
    box-shadow: none;
  }

  #box-9 .jf-summary-mini-box > div {
    min-height: 29px;
    padding: 5px 0;
    gap: 10px;
    align-items: center;
    font-size: 11px;
  }

  #box-9 .jf-summary-mini-box > div > span {
    min-width: 0;
    font-size: 11px;
  }

  #box-9 .jf-summary-mini-box > div > strong {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #box-9 .jf-summary-highlight-row {
    min-height: 39px !important;
    padding: 8px 10px !important;
    border-radius: 10px;
  }

  #box-9 .jf-summary-highlight-row strong {
    font-size: 15px !important;
  }

  #box-9 .jf-summary-total-row {
    min-height: 45px !important;
    margin-top: 2px;
    padding: 8px 10px !important;
    border: 1px solid rgba(199,209,155,.28) !important;
    border-radius: 11px;
    background: rgba(199,209,155,.09);
  }

  #box-9 .jf-summary-total-row span {
    font-size: 12px !important;
  }

  #box-9 .jf-summary-total-row strong {
    font-size: 20px !important;
  }

  #box-9 .jf-sum-custom-detail {
    max-height: 74px;
    overflow: auto;
    padding: 7px 9px;
    font-size: 10px;
    line-height: 1.45;
  }

  #box-9 .jf-tallas-warning {
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 10px;
  }

  #box-9 .jf-orientativo-note {
    margin-top: 6px;
    padding: 7px 10px;
    font-size: 9px;
  }

  #box-9 .jf-final-block {
    height: 100%;
    margin: 0;
    padding: 13px;
    border: 1px solid var(--jf-border);
    border-radius: 17px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    background: rgba(255,255,255,.68);
  }

  #box-9 .jf-final-actions-row {
    gap: 7px;
  }

  #box-9 .jf-btn-dl-views,
  #box-9 .jf-btn-share {
    min-height: 43px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 10px;
  }

  #box-9 .jf-attach-hint {
    padding: 9px 10px;
    border-radius: 11px;
    gap: 7px;
    font-size: 10px;
    line-height: 1.4;
  }

  #box-9 .jf-attach-hint-icon {
    font-size: 14px;
  }

  #box-9 .jf-whatsapp-box {
    padding: 12px;
    border-radius: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #box-9 .jf-whatsapp-info strong {
    font-size: 14px;
  }

  #box-9 .jf-whatsapp-info small {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.35;
  }

  #box-9 .jf-whatsapp-btn {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 11px;
  }
}

/* Pantallas de escritorio algo más estrechas: colores en 5 columnas. */
@media (min-width: 901px) and (max-width: 1320px) {
  #jf-colors-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #box-zonas.active {
    grid-template-columns: minmax(310px, .85fr) minmax(470px, 1.15fr);
  }

  .jf-summary-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(290px, .7fr);
  }
}

/* ═══ MÓVIL / TABLET ══════════════════════════════════════════ */
@media (max-width: 900px) {
  /* El regalo también recibe una composición propia en móvil. */
  #box-regalo.active {
    display: block !important;
  }

  .jf-gift-banner {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 13px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 9px;
    align-items: center;
    color: var(--jf-black);
    background: linear-gradient(135deg, rgba(199,209,155,.88), rgba(232,239,202,.96));
    animation: none;
    text-align: left;
  }

  .jf-gift-banner > span {
    grid-row: 1 / span 2;
    font-size: 20px;
  }

  .jf-gift-banner strong {
    font-size: 11px;
    text-transform: uppercase;
  }

  .jf-gift-banner small {
    color: var(--jf-muted);
    font-size: 9px;
  }

  .jf-gift-card {
    border: 1px solid var(--jf-border);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255,255,255,.82);
  }

  .jf-gift-visual {
    position: relative;
    height: 210px;
    padding: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f5f1e8, #eae3d8);
  }

  .jf-gift-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .jf-gift-free-badge {
    position: absolute;
    top: 11px;
    left: 11px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--jf-fiesta);
    font-size: 8px;
    font-weight: 900;
  }

  .jf-gift-content {
    padding: 16px;
    display: grid;
    gap: 12px;
  }

  .jf-gift-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
  }

  .jf-gift-heading small {
    display: block;
    margin-bottom: 3px;
    color: var(--jf-fiesta);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .jf-gift-heading h3 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1;
  }

  .jf-gift-heading > strong {
    color: var(--jf-fiesta);
    font-size: 16px;
  }

  .jf-gift-field-label {
    display: block;
    margin-bottom: 7px;
    color: var(--jf-muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .jf-gift-swatches {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
  }

  .jf-gift-swatch {
    position: relative;
    width: 100%;
    max-width: 38px;
    aspect-ratio: 1;
    margin: auto;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--gift-color);
    box-shadow: 0 0 0 1px rgba(24,25,22,.14);
  }

  .jf-gift-swatch.active {
    box-shadow: 0 0 0 3px var(--jf-olive);
  }

  .jf-gift-swatch.active::after {
    content: "✓";
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 15px;
    height: 15px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--jf-olive);
    font-size: 7px;
    font-weight: 900;
  }

  .jf-gift-selected {
    min-height: 43px;
    padding: 8px 10px;
    border: 1px solid var(--jf-border);
    border-radius: 11px;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 8px;
    align-items: center;
    background: var(--jf-paper-light);
  }

  .jf-gift-selected-dot {
    width: 21px;
    height: 21px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--gift-selected);
    box-shadow: 0 0 0 1px rgba(24,25,22,.13);
  }

  .jf-gift-selected span:not(.jf-gift-selected-dot) {
    color: var(--jf-muted);
    font-size: 9px;
  }

  .jf-gift-selected strong {
    font-size: 11px;
  }

  .jf-gift-custom {
    min-height: 59px;
    padding: 9px 10px;
    border: 1px solid rgba(124,137,90,.24);
    border-radius: 13px;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    background: rgba(199,209,155,.18);
  }

  .jf-gift-custom input {
    position: absolute;
    opacity: 0;
  }

  .jf-gift-custom-box {
    width: 27px;
    height: 27px;
    border: 1px solid rgba(124,137,90,.45);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: transparent;
    background: #fff;
    font-size: 12px;
    font-weight: 900;
  }

  .jf-gift-custom input:checked + .jf-gift-custom-box {
    color: #fff;
    background: var(--jf-olive);
  }

  .jf-gift-custom strong,
  .jf-gift-custom small {
    display: block;
  }

  .jf-gift-custom strong {
    font-size: 10px;
  }

  .jf-gift-custom small {
    margin-top: 2px;
    color: var(--jf-muted);
    font-size: 8px;
  }

  .jf-gift-custom b {
    color: var(--jf-olive);
    font-size: 10px;
  }

  .jf-gift-next {
    width: 100%;
    min-height: 48px;
  }

  /* El nuevo wrapper del resumen conserva el flujo móvil. */
  .jf-summary-layout {
    display: block;
  }

  #box-9 .jf-final-block {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jf-gift-visual img,
  .jf-gift-swatch,
  .jf-gift-custom {
    transition: none !important;
  }
}

/* Remates V3 tras la revisión visual. */
@media (min-width: 901px) {
  #box-pack.active {
    grid-template-rows: auto auto auto;
    align-content: start;
  }

  #box-pack.active .jf-pack-grid {
    align-items: start;
  }

  #box-pack .jf-pack-item {
    height: auto;
  }

  .jf-gift-custom {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  #box-9 .jf-final-block {
    height: fit-content;
    align-self: start;
    margin-top: 0;
  }
}

/* Optimización móvil adicional: menos scroll y más claridad. */
@media (max-width: 900px) {
  /* Colores en dos columnas compactas, no una lista interminable. */
  #box-2.active {
    padding-top: 13px;
  }

  #box-2 #jf-colors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
  }

  #box-2 .color-choice {
    min-height: 49px;
    padding: 7px 8px;
    gap: 7px;
    border-radius: 12px;
  }

  #box-2 .color-choice .jf-color-dot {
    width: 24px;
    height: 24px;
  }

  #box-2 .color-choice strong {
    margin: 0;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Complementos como carrusel horizontal: una decisión cada vez. */
  #box-pack .jf-pack-grid {
    display: flex !important;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 1px 14px 8px 1px;
  }

  #box-pack .jf-pack-grid::-webkit-scrollbar {
    display: none;
  }

  #box-pack .jf-pack-item {
    flex: 0 0 min(82vw, 330px);
    scroll-snap-align: start;
    padding: 12px;
    gap: 8px;
  }

  #box-pack .jf-pack-image {
    height: 128px;
    min-height: 0;
  }

  #box-pack .jf-pack-actions {
    position: sticky;
    bottom: 76px;
    z-index: 4;
    padding-top: 7px;
    background: linear-gradient(180deg, transparent, var(--jf-paper-light) 30%);
  }

  /* Resumen final en una rejilla compacta de dos columnas. */
  #box-9.active {
    padding: 13px 12px 88px;
  }

  #box-9 .jf-box-head {
    margin-bottom: 10px;
  }

  #box-9 .jf-box-head h2 {
    font-size: clamp(1.9rem, 9vw, 2.45rem);
  }

  #box-9 .jf-box-head p {
    font-size: 12px;
    line-height: 1.4;
  }

  #box-9 .jf-summary-mini-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
    border-radius: 17px;
  }

  #box-9 .jf-summary-mini-box > div {
    min-width: 0;
    min-height: 48px;
    padding: 7px 8px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    background: rgba(255,255,255,.025);
  }

  #box-9 .jf-summary-mini-box > div > span {
    color: rgba(255,255,255,.58);
    font-size: 9px;
    line-height: 1.2;
  }

  #box-9 .jf-summary-mini-box > div > strong {
    width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #box-9 .jf-summary-highlight-row,
  #box-9 .jf-summary-total-row,
  #box-9 .jf-sum-custom-detail,
  #box-9 .jf-tallas-warning {
    grid-column: 1 / -1;
  }

  #box-9 .jf-summary-highlight-row,
  #box-9 .jf-summary-total-row {
    min-height: 57px;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  #box-9 .jf-summary-highlight-row > span,
  #box-9 .jf-summary-total-row > span {
    max-width: 62%;
    color: #fff !important;
    font-size: 10px !important;
    font-weight: 900;
  }

  #box-9 .jf-summary-highlight-row > strong {
    width: auto;
    font-size: 16px !important;
  }

  #box-9 .jf-summary-total-row > strong {
    width: auto;
    font-size: 20px !important;
  }

  #box-9 .jf-sum-custom-detail {
    min-height: 0 !important;
    max-height: 92px;
    overflow: auto;
    font-size: 10px;
  }

  #box-9 .jf-tallas-warning {
    min-height: 0 !important;
    padding: 9px 10px;
    font-size: 10px;
    line-height: 1.35;
  }

  #box-9 .jf-orientativo-note {
    margin-top: 7px;
    padding: 7px 9px;
    font-size: 9px;
    line-height: 1.3;
  }

  #box-9 .jf-final-block {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--jf-border);
    border-radius: 15px;
    gap: 8px;
    background: rgba(255,255,255,.70);
  }

  #box-9 .jf-final-actions-row {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  #box-9 .jf-btn-dl-views,
  #box-9 .jf-btn-share {
    min-height: 43px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 10px;
    white-space: normal;
  }

  #box-9 .jf-attach-hint {
    padding: 8px 9px;
    border-radius: 10px;
    font-size: 9px;
    line-height: 1.35;
  }

  #box-9 .jf-whatsapp-box {
    padding: 11px;
    border-radius: 13px;
    gap: 8px;
  }

  #box-9 .jf-whatsapp-info strong {
    font-size: 13px;
  }

  #box-9 .jf-whatsapp-info small {
    font-size: 9px;
  }

  #box-9 .jf-whatsapp-btn {
    min-height: 45px;
    border-radius: 11px;
    font-size: 10px;
  }
}
@media (max-width: 900px) {
  #box-9.active .jf-summary-mini-box {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  #box-9.active .jf-summary-mini-box > * {
    grid-column: auto !important;
  }
  #box-9.active .jf-summary-highlight-row,
  #box-9.active .jf-summary-total-row,
  #box-9.active .jf-sum-custom-detail,
  #box-9.active .jf-tallas-warning {
    grid-column: 1 / -1 !important;
  }
}
