/*
 * LiuGong Armenia responsive UI refinements
 * Added 2026-09-17
 * Scope: header/nav alignment, mobile language switcher, slide-out menu,
 *        responsive logos, product-card media, and small mobile rhythm fixes.
 */

/* ---------- Logo rendering ---------- */
.ms-header .ms-title img,
.ms-navbar .navbar-brand img {
    object-fit: contain;
    object-position: center;
}

@media (min-width: 768px) {
    .ms-header .ms-title {
        margin-top: 0 !important;
        min-height: 100px;
        display: inline-flex;
        align-items: center;
    }

    .ms-header .ms-title > a {
        display: inline-flex;
        align-items: center;
        min-height: 100px;
    }

    .ms-header .ms-title img {
        width: auto;
        max-width: 290px !important;
        height: auto;
        max-height: 46px;
        margin: 0 22px 0 0 !important;
        padding: 0 !important;
    }

    /* Logo shown when the desktop nav enters its compact/shrink state. */
    .ms-navbar .navbar-brand img {
        width: auto;
        max-width: 180px !important;
        max-height: 30px !important;
        margin: 0 !important;
    }
}

/* ---------- Mobile navigation: logo | languages | hamburger ---------- */
@media (max-width: 767px) {
    .ms-navbar,
    .ms-navbar.navbar-static-top {
        height: 56px;
        min-height: 56px;
        margin-bottom: 0;
    }

    .ms-navbar > .container.container-full {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, auto) minmax(76px, 1fr) 46px;
        align-items: center;
        gap: 4px;
        width: 100%;
        height: 56px;
        min-height: 56px;
        padding: 0 8px !important;
    }

    .ms-navbar .container .navbar-header {
        grid-column: 1;
        display: block !important;
        float: none !important;
        min-width: 0;
        margin: 0 !important;
    }

    .ms-navbar .container .navbar-header .navbar-brand {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        width: auto;
        height: 56px !important;
        min-height: 56px;
        margin: 0 !important;
        padding: 0 !important;
        line-height: normal;
    }

    .ms-navbar .navbar-brand img {
        display: block;
        width: min(180px, 47vw);
        max-width: 100% !important;
        height: auto;
        max-height: 30px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Replaces old top:-10px positioning. */
    .ms-navbar .b-langs.g-clearfix.showOnMobile {
        grid-column: 2;
        justify-self: center;
        align-self: center;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: auto;
        min-width: 0;
        height: 56px;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        top: auto !important;
        right: auto !important;
        text-align: center !important;
        list-style: none;
    }

    .ms-navbar .b-langs.g-clearfix.showOnMobile .b-langs__item {
        display: flex !important;
        align-items: center;
        justify-content: center;
        float: none !important;
        margin: 0;
        padding: 0;
        line-height: 1;
    }

    .ms-navbar .b-langs.g-clearfix.showOnMobile .b-langs__link {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2px;
        border-radius: 3px;
        line-height: 1;
    }

    .ms-navbar .b-langs.g-clearfix.showOnMobile img {
        display: block;
        width: 23px !important;
        height: 23px !important;
        max-width: 23px;
        object-fit: cover;
        object-position: center;
        margin: 0 !important;
        padding: 0 !important;
    }

    .ms-navbar .container .btn-navbar-menu {
        grid-column: 3;
        justify-self: end;
        align-self: stretch;
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: static !important;
        top: auto !important;
        right: auto !important;
        width: 46px;
        height: 56px;
        min-height: 56px;
        line-height: 1;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 24px;
    }

    .ms-navbar .container .btn-navbar-menu i {
        display: block;
        margin: 0;
        line-height: 1;
    }

    .ms-navbar .container .navbar-collapse {
        display: none !important;
    }
}

@media (max-width: 360px) {
    .ms-navbar > .container.container-full {
        grid-template-columns: minmax(0, auto) minmax(66px, 1fr) 42px;
        gap: 2px;
        padding: 0 5px !important;
    }

    .ms-navbar .navbar-brand img {
        width: min(155px, 46vw);
    }

    .ms-navbar .b-langs.g-clearfix.showOnMobile {
        gap: 3px;
    }

    .ms-navbar .b-langs.g-clearfix.showOnMobile img {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px;
    }

    .ms-navbar .container .btn-navbar-menu {
        width: 42px;
        font-size: 23px;
    }
}

/* ---------- Slide-out navigation refinement ---------- */
.ms-slidebar {
    width: min(82vw, 320px);
}

.ms-slidebar .ms-slidebar-header {
    min-height: 116px;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: 300px auto !important;
    background-color: #f2f2f2 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.ms-slidebar .ms-slidebar-menu > li > a,
.ms-slidebar .ms-slidebar-menu > li > ul li > a {
    min-height: 46px;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* ---------- Product/category cards ---------- */
.product-category-card,
.product-list-card {
    overflow: hidden;
}

.product-category-image,
.product-list-image {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    object-position: center center;
}

@media (max-width: 767px) {
    /* Consistent mobile media frame: centered crop instead of left/top bias. */
    .product-category-card .card-body > a {
        display: block;
        overflow: hidden;
    }

    .product-category-image {
        width: 100% !important;
        height: 220px !important;
        object-fit: cover;
        object-position: center center;
    }

    .product-list-card .row > [class*="col-"]:first-child {
        overflow: hidden;
    }

    .product-list-card .row > [class*="col-"]:first-child > a {
        display: block;
        overflow: hidden;
    }

    .product-list-image {
        width: 100% !important;
        height: 245px !important;
        object-fit: cover;
        object-position: center center;
    }

    /* Keep product text/card spacing balanced after the full-width image. */
    .product-list-card .card-block {
        padding-left: 18px;
        padding-right: 18px;
    }

    .category .ms-component-section,
    .ms-paper-content .ms-component-section {
        overflow: hidden;
    }

    .category h1.ms-site-title,
    .ms-paper-content h1.ms-site-title {
        padding-left: 16px;
        padding-right: 16px;
        line-height: 1.2;
    }
}

/* ---------- General responsive image hygiene inside product detail/content ---------- */
.card-fullpage img,
.ms-paper-content img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 767px) {
    .card-fullpage img {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}



@media (min-width: 992px) {
    .ms-header > .container.container-full {
        display: flex;
        align-items: center;
        min-height: 100px;
    }

    .ms-header .ms-title {
        position: static !important;
        display: flex !important;
        align-items: center;
        margin: 0 !important;
    }

    .ms-header .header-l {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        margin-left: 24px !important;
    }

    .ms-header .infobox {
        order: 1;
        flex: 1;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 14px;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .ms-header .top-menu {
        order: 2;
        float: none !important;
        display: flex;
        align-items: center;
        margin: 0 !important;
    }
}
