/* Desktop: Add subtle background so centered container stands out. Through the palette, not a
   literal: MudBlazor paints body from --mud-palette-background, and a hard colour here wins over
   it — which framed a dark experience in light grey. */
@media (min-width: 501px) {
    body {
        background-color: var(--mud-palette-background, #f5f5f5);
    }
}

/* Desktop: Center the mobile experience with a max-width for better viewing */
.mobile-experience-container {
    padding: 0;
    margin: 0 auto;
    max-width: var(--bm-page-column);
    /* clip, not hidden: hidden computes overflow-y to auto, which makes this never-scrolling div the
       scroll container of the RecallScanGate's sticky strip inside it, so the strip never pins. hidden
       stays first for a browser without clip, which keeps the clipping and loses only the pin. */
    overflow-x: hidden;
    overflow-x: clip;
    /* Ensure container fills parent height for proper ActionSheet positioning in preview mode */
    min-height: 100vh;
    /* The page's own wrapper carries this class as well as the renderer's container, and only the
       renderer's gets a background of its own (the designed page colour, or the dark palette's).
       So this is what shows wherever the canvas does not reach — beside a short page, and behind
       anything appended after it — and as a literal white it stayed white under a dark canvas.
       --mud-palette-surface is white in the light palette, so the common case is unchanged. */
    background-color: var(--mud-palette-surface, #fff);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
}

/* Code mode: the renderer's container asks for min-height: 100%, which resolves to nothing against this wrapper's
   auto height, so a full-screen custom block's frame stopped at its own floor and left a band below it on a tall
   phone. As a flex column the wrapper hands its height on. */
.mobile-experience-container:has(> .mobile-experience-container--code) {
    display: flex;
    flex-direction: column;
}

.mobile-experience-container > .mobile-experience-container--code {
    flex: 1 1 auto;
}

/* The RecallScanGate's strip is stuck over the top of the page, so a control focused by keyboard
   must scroll into view below it, not under it (WCAG 2.4.11). Here, not in the gate's scoped CSS,
   which can't reach html. Two lines of text and a button keep the strip about 60px tall. */
html:has(.recall-strip) {
    scroll-padding-top: 80px;
}

/* Mobile: Full width on actual mobile devices */
@media (max-width: 500px) {
    .mobile-experience-container {
        max-width: 100%;
        box-shadow: none;
    }
}

.mobile-experience-container .detail-component {
    margin-bottom: var(--bm-spacing-lg);
}

.mobile-experience-container .paragraph-component {
    padding: var(--bm-spacing-lg);
    font-size: 1rem;
    line-height: 1.6;
}

.mobile-experience-container .warranty-registration-component {
    margin: var(--bm-spacing-lg) 0;
}

/* Hide desktop-only elements just in case they are rendered and not hidden by @if */
.mobile-experience-container .assistant-mode-badge,
.mobile-experience-container .troubleshooting-fab {
    display: none !important;
}

/* Fix MudBlazor button icon alignment */
.mud-button-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* iOS Safari: disable MudBlazor ripple effect which expands beyond button bounds
   on touch due to overflow:hidden not clipping transformed children properly. */
.mud-ripple-effect {
    display: none !important;
}

/* Suppress native iOS touch highlight on all interactive elements */
button,
.mud-button-root,
.mud-fab,
.mud-chip,
[type='button'],
[type='submit'] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ─── Spares/accessories product-detail sheet (ProductDetailDialog) ──────────
   Moved to the Experience RCL static asset
   _content/BrandedMark.Components.Experience.Runtime/css/product-detail-sheet.css so
   BOTH hosts get it — the admin designer preview also reaches that dialog
   (SparesAccessoriesRuntime → OpenDetail) and this host CSS never loaded there. */


/* The experience's loading arm, which is the whole of what a prerender pass can emit.
   ExperienceRenderer nests a second .mobile-experience-container inside the page's own, and its
   inline `min-height: 100%` resolves against a parent with no definite height — so with only a
   spinner inside it the container collapsed to 56px. Holding the arm open here
   makes the prerendered loading screen and the one the browser shows on boot the same screen
   (BRA-566 Stage 6 bite 9c-iv). Runtime only: the designer preview does not load this stylesheet. */
/* A page's width is its own setting, unknown until it has loaded, so a loading screen draws no column: the spinner
   sat in a phone's column and a wide page replaced it. */
.mobile-experience-container:has(.experience-loading) {
    max-width: none;
    box-shadow: none;
}

.mobile-experience-container .experience-loading {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
