/*
 * Moallem Pars 108 — compatibility/refactor layer.
 *
 * The legacy cascade remains the visual source of truth. These rules only
 * centralize safe layout contracts and compatibility behavior.
 */

:root {
    --mp-container-inline: 5%;
    --mp-container-max: var(--mp-container-width, 1200px);
}

/* Canonical container utility. Existing components may continue using their
 * legacy selectors; this utility is available to new/refactored template
 * parts without changing the current page geometry. */
.mp-container {
    width: 90%;
    max-width: var(--mp-container-max);
    margin-inline: auto;
}

/* Preserve the existing desktop header geometry while removing its historical
 * 200px side padding override. */
@media (min-width: 951px) {
    .mp-header-inner {
        width: 100%;
        max-width: var(--mp-container-max);
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }
}

/* Use the same safe container boundary for the main page wrapper where the
 * legacy stylesheet has already established the 120px desktop inner padding.
 * No spacing values are changed here; this is intentionally compatibility-only. */
.mp-site-container {
    width: 100%;
    max-width: var(--mp-container-max);
    margin-inline: auto;
}


/* =========================================================
 * نسخه 108 — تثبیت موقعیت باکس جستجو در سمت راست هدر
 * ========================================================= */
@media (min-width: 951px) {
    .mp-header .mp-search-panel {
        right: 0 !important;
        left: auto !important;
        width: min(800px, calc(100% - 20px)) !important;
        max-width: none !important;
        z-index: 120 !important;
    }

    .mp-header.search-open .mp-search-panel {
        right: 0 !important;
        left: auto !important;
    }
}
