.pisell-sku-detail--immersive {
  // The shared floating layer owns viewport compensation and modal behavior.
  .sku-detail-immersive {
    --detail-footer-height: 104px;
    --detail-side: 24px;
    --detail-control-height: 52px;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    color: var(--pisell-color-text);
    background: var(--sku-detail-background);
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    box-sizing: border-box;

    *, *::before, *::after { box-sizing: border-box; }
    button { cursor: pointer; touch-action: manipulation; }
    button:disabled { cursor: default; }
    button:focus-visible { outline: 2px solid var(--pisell-color-primary); outline-offset: 3px; }

    &[data-pending] .sku-detail-appearance__scroller { pointer-events: none; }
  }

  .sku-detail-immersive__image {
    position: absolute;
    inset: 0 0 auto;
    height: 0;
    padding-top: 100%;
    overflow: hidden;
    background: var(--pisell-color-primary-bg);

    img, .sku-detail-immersive__image-fallback {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
  .sku-detail-immersive__image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--pisell-color-primary);
  }
  .sku-detail-immersive__close, .sku-detail-immersive__back {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    z-index: 3;
    min-width: 44px;
    height: 44px;
    border: 1px solid var(--pisell-color-border);
    border-radius: 100px;
    background: var(--sku-detail-background);
    color: var(--pisell-color-text);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sku-detail-immersive__close { right: max(16px, env(safe-area-inset-right)); }
  .sku-detail-immersive__back { left: 16px; padding: 0 16px; gap: 8px; font-size: 14px; }

  .sku-detail-appearance__scroller {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scroll-padding-top: 76px;
    scroll-padding-bottom: calc(var(--detail-footer-height) + 16px);
    -webkit-overflow-scrolling: touch;
  }
  .sku-detail-immersive__image-space { padding-top: 100%; pointer-events: none; }
  .sku-detail-immersive__content {
    position: relative;
    margin-top: -120px;
    padding: 66px var(--detail-side) calc(var(--detail-footer-height) + 32px);
    background: linear-gradient(to bottom, transparent, var(--sku-detail-background) 120px);
  }
  .sku-detail-immersive__heading {
    margin-bottom: 32px;
    h1 { margin: 0; font-size: 30px; font-weight: 650; line-height: 1.2; color: inherit; }
    p { margin: 12px 0; color: color-mix(in srgb, var(--pisell-color-text) 65%, transparent); }
  }
  .sku-detail-immersive__unit-price { margin-top: 16px; font-size: 21px; font-weight: 600; }

  // The appearance owns the single scrollport; existing Flow/SKU logic stays mounted.
  .sku-detail-right-content, .sku-detail-selection-flow-scroll-shell {
    display: block;
    height: auto;
    overflow: visible;
    margin: 0;
    padding: 0;
    scrollbar-gutter: auto;
    &::after { display: none; }
  }
  .sku-detail-immersive__description {
    --detail-description-toggle-height: 44px;
    position: relative;
    margin-bottom: 16px;
    color: color-mix(in srgb, var(--pisell-color-text) 75%, transparent);
    img, video, iframe { max-width: 100%; }
    .sku-detail-right-content-detail-description {
      padding: 0;
      margin: 0;
      color: inherit;
      font-size: inherit;
      line-height: inherit;
      a { color: var(--pisell-color-primary); }
    }
    .sku-detail-right-content-detail-description-html {
      // Pasted rich text can carry inline white-space: pre/nowrap, which disables wrapping.
      // Override those declarations while preserving authored spaces and line breaks.
      pre, [style*='white-space' i] {
        white-space: pre-wrap !important;
      }
    }
  }
  .sku-detail-immersive__description-viewport[data-collapsed] {
    max-height: 150px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom,
      #000 calc(100% - var(--detail-description-toggle-height) - 24px),
      transparent calc(100% - var(--detail-description-toggle-height) + 8px));
    mask-image: linear-gradient(to bottom,
      #000 calc(100% - var(--detail-description-toggle-height) - 24px),
      transparent calc(100% - var(--detail-description-toggle-height) + 8px));
  }
  .sku-detail-immersive__description-content {
    display: flow-root;
  }
  .sku-detail-immersive__description-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--detail-description-toggle-height);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pisell-color-primary);
    font-size: 24px;

    // Keep the expand target inside the preview; collapse stays after the full text.
    &[aria-expanded='false'] {
      position: absolute;
      inset: auto 0 0;
    }
  }
  .sku-detail-appearance__note,
  .sku-detail-appearance__remove {
    margin-top: 24px;
    padding: 12px 0;
    border: 0;
    background: transparent;
    color: var(--pisell-color-primary);
    text-align: start;
    font: inherit;
  }
  .sku-detail-appearance__remove {
    display: block;
    color: var(--sku-detail-danger);
    &:disabled { opacity: .5; }
  }
  .sku-detail-immersive__footer {
    position: absolute;
    z-index: 2;
    inset: auto 0 0;
    padding: 24px var(--detail-side) max(16px, env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, transparent, var(--sku-detail-background) 16px);
  }
  .sku-detail-immersive__summary {
    margin: 0 0 12px;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: color-mix(in srgb, var(--pisell-color-text) 65%, transparent);
  }
  .sku-detail-immersive__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    .numeric-stepper-capsule {
      flex-shrink: 0;
      height: var(--detail-control-height);
      background: var(--sku-detail-background);
      border-color: var(--pisell-color-border);
    }
    .numeric-stepper-button { color: var(--pisell-color-primary); }
    .numeric-stepper-display { color: var(--pisell-color-text); }
  }
  .sku-detail-immersive__confirm {
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    height: auto;
    min-height: var(--detail-control-height);
    padding: 14px 20px;
    border: 0;
    border-radius: 100px;
    background: var(--pisell-color-primary);
    color: var(--pisell-color-text-on-primary);
    white-space: normal;
    font-size: 14px;
    font-weight: 600;
    strong { font-size: 16px; font-variant-numeric: tabular-nums; }
    &:disabled { opacity: .5; background: var(--pisell-color-primary); color: var(--pisell-color-text-on-primary); }
    &:not(:disabled):hover { background: var(--pisell-color-primary-hover); color: var(--pisell-color-text-on-primary); }
  }

  .sku-detail-immersive--desktop {
    --detail-side: 32px;
    .sku-detail-immersive__image { width: 45%; height: 100%; padding: 0; }
    .sku-detail-immersive__image-space { display: none; }
    .sku-detail-appearance__scroller, .sku-detail-immersive__footer { left: 45%; }
    .sku-detail-immersive__content { margin: 0; padding-top: 76px; background: none; }
  }

  .sku-detail-immersive--kiosk {
    // Prototype Kiosk dimensions (rem converted with its 16px root font).
    // The 80px close button is the customer-requested exception.
    --detail-side: 48px;
    --detail-control-height: 80px;
    font-size: 24px;
    .sku-detail-immersive__close {
      width: 80px;
      height: 80px;
      top: 24px;
      right: 24px;
      font-size: 36px;
    }
    .sku-detail-appearance__scroller { scroll-padding-top: 104px; }
    .sku-detail-immersive__content {
      margin-top: -33.333%;
      padding-top: 11.111%;
      padding-bottom: calc(var(--detail-footer-height) + 40px);
      background: linear-gradient(to bottom, transparent, var(--sku-detail-background) 220px);
    }
    .sku-detail-immersive__heading {
      h1 { font-size: 52px; font-weight: 750; line-height: 1.1; letter-spacing: -.045em; }
      p { margin: 10px 0 0; font-size: 22px; }
    }
    .sku-detail-immersive__unit-price { margin-top: 14px; font-size: 36px; font-weight: 700; letter-spacing: -.025em; }
    .sku-detail-immersive__description { --detail-description-toggle-height: 64px; }
    .sku-detail-immersive__description-toggle { font-size: 32px; }
    .sku-detail-immersive__summary { margin-bottom: 10px; font-size: 18px; }
    .sku-detail-immersive__footer { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
    .sku-detail-immersive__confirm {
      flex-basis: 160px;
      flex-wrap: wrap;
      gap: 6px 12px;
      font-size: 24px;
      line-height: 1.5;
      padding: 22px 32px;
      strong { font-size: 30px; }
    }
    .sku-detail-immersive__actions { gap: 20px; }
    .numeric-stepper.numeric-stepper-capsule {
      height: 80px;
      gap: 0;
      border: 0;
      box-shadow: inset 0 0 0 1px var(--pisell-color-border);
      .numeric-stepper-button {
        width: 72px;
        height: 80px;
        svg { width: 26px; height: 26px; }
      }
      .numeric-stepper-display-wrapper { padding: 0; }
      .numeric-stepper-display {
        // Keep the prototype's minimum width while allowing larger quantities.
        width: auto;
        min-width: 48px;
        height: auto;
        padding: 0;
        border: 0;
        font-size: 28px;
        font-weight: 400;
        line-height: 1.5;
      }
    }
    .pisell-flat-sku-selection {
      --sku-options-title-size: 24px;
      --sku-options-price-size: 20px;
      --sku-options-card-min-height: 88px;
      --sku-options-card-padding: 20px;

      .pisell-batch-selector__content { gap: 40px; }
      .pisell-sku-options-selection-option-item,
      .pisell-sku-options-selection-variant-item { gap: 20px; }
      .pisell-sku-options-selection-variant-item {
        // The variant button sits inside the card's two border edges.
        min-height: calc(var(--sku-options-card-min-height) - 2 * var(--sku-options-card-border-width, 1px));
      }
      .pisell-sku-options-selection-option-item[data-quantity='true'] {
        --sku-options-card-min-height: 112px;
        --sku-options-card-padding: 12px 0;
      }
      .pisell-flat-sku-selection__control {
        --sku-options-indicator-size: 28px;
        &[data-mode='multiple'][data-selected='true']::after {
          width: 6px;
          height: 11px;
          border-width: 0 3px 3px 0;
        }
      }
      .pisell-flat-sku-selection__actions { gap: 24px; }
      .numeric-stepper.numeric-stepper-capsule {
        --flat-sku-stepper-height: 80px;
        --flat-sku-stepper-button: 72px;
        --flat-sku-stepper-value: 48px;
      }
      .pisell-pro-selector_header-content-title { font-size: 26px; }
      .pisell-flat-sku-selection__badge { padding: 5px 10px; font-size: 16px; }
      .pisell-flat-sku-selection__instructions,
      .pisell-flat-sku-selection__error,
      .pisell-flat-sku-selection__subtitle { font-size: 18px; }
      .pisell-flat-sku-selection__sold-out { font-size: 16px; }
    }
  }
}
