/*
 * sv: layout-neutral rules only. Nothing visual here; visual styling uses the existing classes in Styles/ (UX-owned).
 */

/* A custom element that only wraps server markup and must not affect layout (flex/grid children etc.). */
[data-sv-contents] {
    display: contents;
}

/* `hidden` must win over component classes that set `display` (UA [hidden] loses to any class rule). */
[hidden]:not([hidden="until-found"]) {
    display: none !important;
}

/* Umbraco Forms (Svedea theme, BLZ-19): umbracoforms.js hides fields/fieldsets hidden by a condition with this class;
   the default Forms stylesheet that defines it isn't loaded. Also hides the honeypot and the conditions config. */
.umbraco-forms-hidden {
    display: none !important;
}

/* sv-modal: the <dialog> is only a top-layer host; drop its UA box so the existing .modal-overlay looks as before. */
sv-modal > dialog {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    overflow: visible;

    &::backdrop {
        background: transparent;
    }
}

/* Controls that only work with their element's JS (not defined yet, or JS off): invisible but keep their space. */
:not(:defined) [data-needs-js] {
    visibility: hidden;
}

/* Product start (BLZ-20). Collapsed (Blazor SmallStart): fields after the first wait for focus; sv-product-start removes
   [data-ps-more]. Without JS everything shows, and a multi-page start lists its pages one below the other (the "next"
   buttons submit, "Tillbaka" is hidden). */
@media (scripting: enabled) {
    [data-ps-more] {
        display: none !important;
    }
}

@media (scripting: none) {
    .carousel-track-inner:has(> .product-start-page) {
        flex-wrap: wrap;
        transform: none !important;
    }

    [data-ps-nav] {
        display: none !important;
    }
}
