  body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 24px;
    background: #fff;
    color: #333;
  }

  .demo-note {
    max-width: 1200px;
    margin: 0 auto 32px;
    font-size: 13px;
    color: #777;
  }

  /* ============================================================
   RECOMMENDED ITEMS
   ============================================================ */

  .rec-items {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 16px;
  }

  .rec-items__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e3e3e3;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  .rec-items__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #222;
  }

  /* --- Grid layout (recommended default) ------------------- */
  .rec-items__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  /* --- Card ------------------------------------------------ */
  .rec-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
  }

  .rec-card:hover,
  .rec-card:focus-visible {
    border-color: #c9c9c9;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
    transform: translateY(-2px);
  }

  .rec-card:focus-visible {
    outline: 2px solid #b8232f;
    outline-offset: 2px;
  }

  /* Fixed-ratio media box: THIS is what fixes the ragged rows.
   Every image gets the same square, centered, never distorted. */
  .rec-card__media {
    height: 200px;
    min-height: 0;   /* stop content from overriding the height */
    flex: 0 0 auto;  /* don't grow or shrink off the declared height */
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
  }

  .rec-card__media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
  }

  .rec-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    flex: 1 1 auto;
  }

  /* Product name: clamp to 2 lines so every card is the same height */
  .rec-card__name {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    color: #2f2f2f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
  }

  .rec-card:hover .rec-card__name {
    color: #b8232f;
  }

  .rec-card__sku {
    font-size: 11px;
    color: #8a8a8a;
    letter-spacing: .02em;
    /* long SKUs no longer push into the next card */
    overflow-wrap: anywhere;
  }

  .rec-card__price {
    margin-top: auto;
    padding-top: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
  }

  /* --- Optional: single-row scroll rail --------------------
   Swap .rec-items__grid for .rec-items__rail if you want to
   keep the one-line carousel look instead of a wrapping grid. */
  .rec-items__rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: 12px;
  }

  .rec-items__rail .rec-card {
    scroll-snap-align: start;
  }

  @media (max-width: 640px) {
    .rec-items__grid {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 12px;
    }

    .rec-items__title {
      font-size: 18px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .rec-card {
      transition: none;
    }

    .rec-card:hover {
      transform: none;
    }
  }

  /* ============================================================
   VERTICAL MODIFIER — the only new code
   ============================================================ */

  /* One column, tighter gap. Everything else inherits. */
  .rec-items--vertical .rec-items__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Shorter image box: a sidebar column doesn't need 200px squares */
  .rec-items--vertical .rec-card__media {
    height: 150px;
  }

  /* Keeps the rail beside the product while the user scrolls the
   description. Remove if your layout already handles this. */
  .rec-items--vertical {
    position: sticky;
    top: 16px;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Cap the height so 8 items can't outrun the main column */
  .rec-items--vertical .rec-items__grid {
    max-height: 550px;
    overflow-y: auto;
    padding-right: 12px;
    scrollbar-width: thin;
  }

  @media (max-width: 991px) {

    /* Drop out of the sidebar */
    .rec-items--vertical {
      position: static;
      margin-top: 24px;
      clear: both;
    }

    /* Vertical stack → horizontal rail */
    .rec-items--vertical .rec-items__grid {
      grid-auto-flow: column;
      grid-template-columns: none;
      grid-auto-columns: 150px;

      max-height: none;
      overflow-y: hidden;
      overflow-x: auto;

      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;

      padding-right: 0;
      padding-bottom: 10px;
      scrollbar-gutter: auto;
    }

    .rec-items--vertical .rec-card {
      scroll-snap-align: start;
    }

    .rec-items--vertical .rec-card__media {
      height: 130px;
      min-height: 0;
    }

    /* Hover lift is meaningless on touch and fights the scroll */
    .rec-items--vertical .rec-card:hover {
      transform: none;
    }
  }