:root {
    --mg-blue: #1769d5;
    --mg-blue-dark: #0f3f8f;
    --mg-ink: #102a4c;
    --mg-muted: #526b88;
    --mg-line: #d5e1ef;
}

html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body { margin: 0; font-family: IRANSansX, IRANSans, Vazirmatn, Tahoma, Arial, sans-serif !important; color: var(--mg-ink); }
body * { min-width: 0; }
img, svg, video, iframe { max-width: 100%; }

.mg-public-header-inner { width: min(1240px, calc(100% - 36px)); min-height: 82px; gap: 20px; }
.mg-public-nav a { color: #405c7c; font-size: 13px; font-weight: 750; }
.mg-header-search { min-width: 210px; }
.mg-header-search input { font-family: inherit !important; font-size: 12px !important; }
.mg-public-auth { min-height: 44px; font-size: 12px; }

.mg-public-footer {
    position: relative;
    overflow: hidden;
    margin-top: 0;
    padding: 0 max(24px, calc((100% - 1240px) / 2));
    background: #0c3260;
    color: #d9e9fb;
    font-family: IRANSansX, IRANSans, Vazirmatn, Tahoma, Arial, sans-serif !important;
    font-size: 15px;
    line-height: 2;
}

.mg-public-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 10% 15%, rgba(70, 133, 230, .25), transparent 29%), radial-gradient(circle at 92% 86%, rgba(26, 172, 180, .14), transparent 25%);
}

.mg-footer-benefits,
.mg-public-footer-grid,
.mg-trust-section,
.mg-public-footer-bottom { position: relative; z-index: 1; }

.mg-footer-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    transform: translateY(-26px);
    overflow: hidden;
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 18px 46px rgba(3, 26, 54, .22);
}

.mg-footer-benefits > div {
    min-height: 104px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #164d8c;
}

.mg-footer-benefits > div > b {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .12);
    color: #73e1d2;
    font-size: 20px;
}

.mg-footer-benefits span, .mg-footer-benefits strong, .mg-footer-benefits small { display: block; }
.mg-footer-benefits strong { color: #fff; font-size: 16px; font-weight: 850; }
.mg-footer-benefits small { margin-top: 2px; color: #c2d8ef; font-size: 12px; line-height: 1.8; }

.mg-public-footer-grid {
    display: grid;
    grid-template-columns: 1.35fr repeat(3, minmax(160px, .75fr));
    gap: 46px;
    padding: 42px 0 38px;
}

.mg-public-footer .mg-public-brand { color: #fff; }
.mg-public-footer .mg-public-brand strong { color: #fff; font-size: 21px; }
.mg-public-footer .mg-public-brand small { color: #9bbbe0; font-size: 8px; }
.mg-public-footer-brand p { max-width: 390px; margin: 20px 0 0; color: #c5d9ee; font-size: 14.5px; line-height: 2.1; }
.mg-footer-column h3 { margin: 0 0 15px; color: #fff; font-size: 18px; font-weight: 900; }
.mg-footer-column a, .mg-footer-column > span { display: block; width: fit-content; margin: 7px 0; color: #d7e7f8; font-size: 14px; line-height: 1.9; text-decoration: none; }
.mg-footer-column a:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.mg-footer-contact a { direction: ltr; }

.mg-trust-section {
    margin: 3px 0 38px;
    padding: 25px;
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr);
    align-items: center;
    gap: 28px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .07);
}

.mg-trust-copy > span { color: #78e1d4; font-size: 12px; font-weight: 850; }
.mg-trust-copy h3 { margin: 5px 0; color: #fff; font-size: 19px; }
.mg-trust-copy p { margin: 0; color: #bcd2e9; font-size: 13px; }
.mg-trust-logos { display: flex; align-items: stretch; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.mg-trust-card { width: 132px; min-height: 140px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; background: #fff; color: var(--mg-ink); text-align: center; }
.mg-trust-card img { display: block; max-width: 88px !important; max-height: 88px !important; width: auto !important; height: auto !important; object-fit: contain; }
.mg-trust-card a { display: grid; place-items: center; max-width: 100%; }
.mg-trust-card small { display: block; color: #455e7a; font-size: 10px; line-height: 1.6; }

.mg-public-footer-bottom {
    min-height: 72px;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    color: #c8dcef;
    font-size: 13px;
}

/* Public catalog safety net for desktop and mobile. */
.public-wrap, .catalog-layout, .catalog-main, .catalog-grid, .catalog-card, .catalog-sidebar { min-width: 0; max-width: 100%; }
.catalog-layout { width: min(1240px, calc(100% - 36px)); margin-inline: auto; grid-template-columns: minmax(0, 1fr) 290px; }
.catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1080px) {
    .mg-public-header-inner { gap: 12px; }
    .mg-public-nav { gap: 13px; }
    .mg-header-search { width: 215px; flex-basis: 215px; }
    .mg-public-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .mg-public-header-inner { width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr) auto auto; }
    .mg-public-brand strong { font-size: 17px; }
    .mg-public-nav { width: 100%; max-width: 100%; }
    .mg-header-search { width: 100%; }
    .mg-footer-benefits { grid-template-columns: 1fr; }
    .mg-footer-benefits > div { min-height: 86px; }
    .mg-trust-section { grid-template-columns: 1fr; }
    .mg-trust-logos { justify-content: flex-start; }
    .catalog-layout { width: calc(100% - 24px); grid-template-columns: 1fr; }
    .catalog-main { order: 1; }
    .catalog-sidebar { position: static !important; order: 2; width: 100%; }
}

@media (max-width: 560px) {
    .mg-public-header-inner { grid-template-columns: minmax(0, 1fr) 42px; padding: 9px 0; }
    .mg-public-brand span:last-child { overflow: hidden; }
    .mg-public-brand strong { font-size: 16px; }
    .mg-menu-toggle { grid-column: 2; }
    .mg-public-auth { grid-column: 1 / -1; width: 100%; }
    .mg-public-nav { gap: 16px; padding-bottom: 6px; }
    .mg-public-nav a { flex: 0 0 auto; font-size: 12px; }
    .mg-public-footer { padding-inline: 16px; }
    .mg-footer-benefits { transform: translateY(-18px); }
    .mg-public-footer-grid { grid-template-columns: 1fr; gap: 27px; padding-top: 23px; }
    .mg-public-footer-brand p { font-size: 14px; }
    .mg-footer-column h3 { font-size: 17px; }
    .mg-footer-column a, .mg-footer-column > span { font-size: 14px; }
    .mg-trust-section { padding: 18px; }
    .mg-trust-logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mg-trust-card { width: 100%; }
    .mg-public-footer-bottom { display: grid; justify-content: center; text-align: center; font-size: 12px; }
    .catalog-grid { grid-template-columns: 1fr; }
}
