:root {
      --footer-height: 92px;
      /* Espacio para que grids / textos no queden bajo .step-nav (sticky) */
      --step-nav-clearance: 6.5rem;
      /* Paleta UX (sincronizada con Tailwind / index) */
      --bg-light: #F5F0EB;
      /* Crema base */
      --bg-card: #FFFFFF;
      /* Blanco limpio para los componentes */
      --bg-card-hover: #FCFAF8;
      --border-soft: rgba(0, 0, 0, 0.08);
      --border-active: #8B6F47;
      /* Acento artesanal (cuero) */
      --text-main: #1C1C1A;
      /* Carbón/Negro suave */
      --text-dim: #7A7268;
      /* Gris cálido */
      --text-light: #FFFFFF;
      --accent-pop: #E8195A;
      /* Fucsia Pilgrim (para detalles/validación) */
      --accent-leather: #8B6F47;

      --radius-lg: 16px;
      --radius-md: 12px;
      --radius-sm: 8px;

      /* Sombras sutiles y elegantes */
      --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.03);
      --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.08);
      --transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
      --site-header-h: 80px;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    /* Navbar (misma línea visual que index / shop) */
    #navbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      padding: 20px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      background: rgba(245, 240, 235, 0.92);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      box-shadow: 0 1px 0 rgba(28, 28, 26, 0.08);
    }

    @media (min-width: 768px) {
      #navbar {
        padding: 20px 48px;
      }
    }

    /* LAYOUT */
    .pilgrim-configurator-site-footer-spacer {
      height: var(--footer-height);
      width: 100%;
      flex-shrink: 0;
    }

    .configurator-wrapper {
      display: flex;
      margin-top: var(--site-header-h);
      min-height: calc(100vh - var(--site-header-h) - var(--footer-height));
      position: relative;
    }

    /* PANELS */
    .steps-panel {
      flex: 1;
      position: relative;
    }

    .preview-panel {
      width: 50%;
      position: sticky;
      top: var(--site-header-h);
      height: calc(100vh - var(--site-header-h) - var(--footer-height));
      display: flex;
      align-items: stretch;
      border-left: 1px solid var(--border-soft);
      /* Fondo tipo packshot, cercano al blanco de las fotos del bolso */
      background: #F4F4F2;
      overflow: hidden;
    }

    /* STEP VIEWS */
    .step-view {
      display: none;
      animation: fadeIn 0.5s ease forwards;
      max-width: 800px;
      margin: 0 auto;
    }

    .step-view.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(15px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* GRIDS */
    .grid-2 {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
    }

    .grid-3 {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
    }

    .grid-4 {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }

    /* CARDS */
    .option-card {
      background: var(--bg-card);
      border: 1px solid var(--border-soft);
      border-radius: var(--radius-md);
      overflow: hidden;
      cursor: pointer;
      transition: var(--transition);
      box-shadow: var(--shadow-subtle);
      position: relative;
    }

    .option-card:hover {
      border-color: var(--text-main);
      transform: translateY(-4px);
      box-shadow: var(--shadow-float);
    }

    .option-card.selected {
      border-color: var(--accent-leather);
      border-width: 2px;
      transform: translateY(-4px);
      box-shadow: var(--shadow-float);
    }

    .option-card .img-wrap--empty {
      min-height: 120px;
      background: rgba(0, 0, 0, 0.04);
    }

    .option-card .img-wrap {
      aspect-ratio: 1/1;
      width: 100%;
      overflow: hidden;
      display: block;
      position: relative;
      background: #EDE8E2;
    }

    .option-card.wide .img-wrap {
      aspect-ratio: 4/3;
    }

    .option-card .img-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      display: block;
      transition: transform 0.8s ease;
      mix-blend-mode: normal;
    }

    .option-card:hover .img-wrap img {
      transform: scale(1.05);
    }

    .option-card .label {
      padding: 10px 12px;
      text-align: center;
      font-weight: 500;
      font-size: 0.875rem;
      color: var(--text-main);
      border-top: 1px solid var(--border-soft);
      background: #FFFFFF;
    }

    .cord-card .label-main {
      display: block;
      font-weight: 600;
    }

    .cord-card .label-ref {
      display: block;
      font-size: 0.7rem;
      color: var(--text-dim);
      font-weight: 400;
      margin-top: 2px;
    }

    .option-card.selected .label {
      color: var(--accent-leather);
      font-weight: 600;
    }

    /* SPECIFIC GRID CARDS — mismo relleno al 100%; cordones más bajos en grid denso */
    .color-card .img-wrap {
      aspect-ratio: 1/1;
    }

    .cord-card .img-wrap {
      aspect-ratio: 1/1;
      min-height: 0;
    }

    /* NAV BUTTONS — sticky por encima del footer fijo */
    .step-nav {
      display: flex;
      gap: 12px;
      margin-top: 1.25rem;
      border-top: 1px solid var(--border-soft);
      padding-top: 12px;
      padding-bottom: 8px;
      position: sticky;
      bottom: var(--footer-height);
      z-index: 60;
      background: rgba(245, 240, 235, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 -12px 24px rgba(245, 240, 235, 0.95);
    }

    /* Hueco de scroll entre contenido y barra sticky (evita que cards / copy queden tapados) */
    .step-view:not(.result-screen) .step-header + .grid-2,
    .step-view:not(.result-screen) .step-header + .grid-3,
    .step-view:not(.result-screen) .step-header + .grid-4 {
      margin-bottom: var(--step-nav-clearance);
    }

    /* ANNOTATED MINI PREVIEW — bolso a máximo tamaño; fondo acorde al packshot */
    .preview-container {
      position: relative;
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      min-height: 0;
      flex: 1;
      box-sizing: border-box;
      padding: clamp(10px, 2vw, 24px);
      /* Etiquetas de burbuja con max-width en cqw (ancho real del panel bolso) */
      container-type: inline-size;
      container-name: bag-preview;
    }

    .base-bag {
      flex: 1 1 0;
      min-height: 0;
      width: 100%;
      height: auto;
      object-fit: contain;
      object-position: center;
      position: relative;
      z-index: 1;
      filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.08));
      transition: opacity 0.35s ease, filter 0.35s ease;
    }

    /* ANNOTATION SVG LINES */
    .annotation-lines {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 5;
      pointer-events: none;
      overflow: visible;
    }

    .annotation-lines line {
      stroke: var(--text-dim);
      stroke-width: 1.25px;
      stroke-dasharray: 4;
      opacity: 0.15;
      transition: var(--transition);
      vector-effect: non-scaling-stroke;
    }

    .annotation-lines line.active {
      stroke: var(--text-main);
      stroke-width: 1.75px;
      opacity: 0.5;
    }

    .annotation-lines line.filled {
      stroke: var(--border-active);
      stroke-dasharray: 0;
      opacity: 1;
    }

    /* BUBBLES — sin transición en top/left para que al redimensionar coincidan al instante con las líneas */
    .bubble-group {
      position: absolute;
      display: flex;
      align-items: center;
      gap: 12px;
      transform: translate(-50%, -50%);
      transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
      z-index: 10;
      /* El bloque círculo+etiqueta no puede ser más ancho que el panel (el texto hace wrap dentro) */
      max-width: calc(100% - 12px);
      box-sizing: border-box;
    }

    .bubble {
      width: 48px;
      height: 48px;
      flex-shrink: 0;
      border-radius: 50%;
      background: #FFFFFF;
      border: 1px solid var(--border-soft);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-dim);
      font-size: 1.2rem;
      position: relative;
      cursor: pointer;
      transition: var(--transition);
      overflow: hidden;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    }

    .bubble-group.active .bubble {
      border: 1.5px solid var(--text-main);
      color: var(--text-main);
      transform: scale(1.15);
      box-shadow: 0 0 0 4px rgba(28, 28, 26, 0.05);
    }

    .bubble-group.filled .bubble {
      border-style: solid;
      border-color: var(--border-soft);
    }

    .bubble img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      /* Para que asas y logotipos se vean completos */
      padding: 4px;
      /* Espacio para que respire la preview */
      mix-blend-mode: multiply;
      /* Elimina fondos blancos */
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;
      transition: opacity 0.3s;
    }

    .bubble-group.filled .bubble img {
      opacity: 1;
    }

    .bubble-label {
      background: #FFFFFF;
      border: 1px solid var(--border-soft);
      padding: 8px 14px;
      border-radius: 30px;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-dim);
      min-width: 0;
      flex: 0 1 auto;
      max-width: min(11.5rem, 36vw);
      line-height: 1.3;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
      hyphens: auto;
      text-align: left;
      opacity: 0;
      transition: var(--transition);
      pointer-events: none;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    }

    /* Texto a la izquierda del círculo: alinea al borde interior de la pastilla */
    .bubble-group[style*="row-reverse"] .bubble-label {
      text-align: right;
    }

    .bubble-group.active .bubble-label,
    .bubble-group.filled .bubble-label {
      opacity: 1;
    }

    .bubble-group.active .bubble-label {
      color: var(--text-main);
      border-color: var(--text-main);
    }

    .bubble-value {
      color: var(--accent-leather);
      font-weight: 600;
      display: none;
      margin: 0;
      overflow-wrap: anywhere;
      word-break: break-word;
      text-transform: capitalize;
    }

    .bubble-group.filled .bubble-value {
      display: block;
      margin-top: 0.2em;
      padding-top: 0.15em;
      border-top: 1px solid var(--border-soft);
    }

    /* Posición de burbujas: rules_json + JS (applyBubblePositionsFromSchema); left/top/flex-direction inline */

    @supports (width: 1cqw) {
      .bubble-label {
        max-width: min(11.5rem, calc(100cqw - 4.5rem));
      }
    }

    /* Barra fija de pasos (no usar <footer> para no chocar con el pie global de la tienda) */
    .pilgrim-configurator-step-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      height: var(--footer-height);
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-top: 1px solid var(--border-soft);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px 0 16px;
      /* Por encima del pie en flujo y del #navbar (shop-shell z-index 100); por debajo de mini-cart (160) y cookie bar (190) */
      z-index: 150;
      gap: 12px;
    }

    /* Pie global tras la barra fija: sin capa que la tape (mismo z-index 100 que el nav rompía el orden de pintura) */
    footer.pilgrim-site-footer {
      position: relative;
      z-index: 0;
    }

    /* Por encima de la barra de pasos (z-index 150) */
    #pilgrim-config-price {
      z-index: 155;
    }

    .progress-dots {
      display: flex;
      gap: 8px;
      align-items: center;
      flex: 1;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 6px 4px;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }

    .dot-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      flex-shrink: 0;
    }

    .progress-dot {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--bg-light);
      border: 2px solid #D6D0C8;
      transition: var(--transition);
      position: relative;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    .progress-thumb-ph {
      font-size: 1.1rem;
      font-weight: 300;
      color: var(--text-dim);
      line-height: 1;
      transition: opacity 0.25s ease;
    }

    .progress-thumb-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      padding: 4px;
      opacity: 0;
      transition: opacity 0.3s ease;
      mix-blend-mode: multiply;
    }

    .progress-dot.filled .progress-thumb-img {
      opacity: 1;
    }

    .progress-dot.filled .progress-thumb-ph {
      opacity: 0;
      pointer-events: none;
    }

    .dot-wrapper:hover .progress-dot:not(.active) {
      border-color: var(--text-dim);
    }

    .progress-dot.active {
      border-color: #E8195A;
      box-shadow: 0 0 0 3px rgba(232, 25, 90, 0.18);
      transform: scale(1.05);
    }

    .progress-dot.filled:not(.active) {
      border-color: var(--accent-leather);
    }

    .progress-label {
      font-size: 0.65rem;
      font-weight: 600;
      color: #9E9890;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      transition: var(--transition);
      max-width: 56px;
      text-align: center;
      line-height: 1.15;
    }

    .progress-dot.active~.progress-label {
      color: var(--text-main);
    }

    .dot-wrapper.filled .progress-label {
      color: var(--accent-leather);
    }

    .dot-wrapper.filled .progress-dot.active~.progress-label {
      color: var(--text-main);
    }

    /* Paso que falta para poder ver resumen (tras intentarlo) */
    @keyframes cf-dot-needs-pulse {
      0%, 100% {
        box-shadow: 0 0 0 0 rgba(232, 25, 90, 0.45), 0 2px 10px rgba(0, 0, 0, 0.05);
      }
      50% {
        box-shadow: 0 0 0 8px rgba(232, 25, 90, 0.12), 0 2px 14px rgba(232, 25, 90, 0.15);
      }
    }

    .dot-wrapper.cf-dot-needs-step .progress-dot.cf-dot-needs-attention {
      border-color: var(--accent-pop);
      animation: cf-dot-needs-pulse 1.25s ease-in-out infinite;
      transform: scale(1.08);
    }

    .dot-wrapper.cf-dot-needs-step .progress-label {
      color: var(--accent-pop);
      font-weight: 700;
    }

    .progress-line {
      width: 16px;
      height: 1px;
      background: #D6D0C8;
      flex-shrink: 0;
      align-self: center;
      margin-bottom: 18px;
    }

    .btn-finish {
      background: #EDE5DB;
      color: #9E9890;
      padding: 10px 22px;
      border-radius: 9999px;
      font-family: inherit;
      font-size: 0.875rem;
      font-weight: 600;
      cursor: not-allowed;
      border: none;
      transition: var(--transition);
      flex-shrink: 0;
    }

    .btn-finish.ready {
      background: #1C1C1A;
      color: #fff;
      cursor: pointer;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .btn-finish.ready:hover {
      transform: translateY(-2px);
      background: #000;
    }

    /* RESULT SCREEN */
    .result-screen {
      text-align: center;
      padding: 12px 0 24px;
    }

    .result-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
      margin-bottom: 24px;
      text-align: left;
    }

    .result-item {
      background: #FFFFFF;
      padding: 20px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border-soft);
      display: flex;
      align-items: center;
      gap: 18px;
      box-shadow: var(--shadow-subtle);
    }

    .res-icon {
      width: 60px;
      height: 60px;
      flex-shrink: 0;
      border-radius: var(--radius-sm);
      overflow: hidden;
      background: #EDE8E2;
      border: 1px solid var(--border-soft);
    }

    .res-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      display: block;
    }

    .res-info .res-label {
      font-size: 0.85rem;
      color: var(--text-dim);
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .res-info .res-value {
      font-size: 1.15rem;
      font-weight: 600;
      color: var(--text-main);
      text-transform: capitalize;
      font-family: 'Playfair Display', Georgia, serif;
    }

    @media (max-width: 1024px) {
      .configurator-wrapper {
        flex-direction: column;
      }

      .preview-panel {
        width: 100%;
        height: min(42vh, 440px);
        min-height: 280px;
        border-left: none;
        border-bottom: 1px solid var(--border-soft);
        position: relative;
        top: 0;
        background: #F4F4F2;
      }

      /* Burbujas más hacia dentro; sin etiquetas anchas que desborden */
      .bubble {
        width: 42px;
        height: 42px;
        font-size: 1.05rem;
      }

      .bubble-group .bubble-label {
        display: none;
      }

      .grid-4 {
        grid-template-columns: repeat(3, 1fr);
      }

      .pilgrim-configurator-step-bar {
        padding: 0 12px 0 8px;
      }

      .progress-label,
      .progress-line {
        display: none;
      }

      .progress-dots {
        gap: 6px;
      }
    }

    @media (max-width: 600px) {
      .preview-panel {
        height: min(36vh, 340px);
        min-height: 240px;
      }

      .bubble {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
      }

      .bubble-group.active .bubble {
        transform: scale(1.08);
      }

      .grid-2,
      .grid-3,
      .grid-4 {
        grid-template-columns: repeat(2, 1fr);
      }

      .result-grid {
        grid-template-columns: 1fr;
      }
    }