/* control_standard UI v4.2.0
   Responsive cleanup for the public site header and the product-list filter bar.
   No pricing, cart, or domain-logic changes. */

/* ---------- Product-group filters (category + currency) ---------- */
#order-verticalsteps .cld-catalog-filters,
#main-content.cart .cld-catalog-filters {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 18px;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 0 6px;
}
#order-verticalsteps .cld-catalog-filters .cld-catalog-filter,
#main-content.cart .cld-catalog-filters .cld-catalog-filter {
    float: none !important;
    min-width: 0;
    margin: 0 !important;
}
#order-verticalsteps .cld-catalog-filters .cld-catalog-filter-category,
#main-content.cart .cld-catalog-filters .cld-catalog-filter-category {
    flex: 1 1 420px;
}
#order-verticalsteps .cld-catalog-filters .cld-catalog-filter-currency,
#main-content.cart .cld-catalog-filters .cld-catalog-filter-currency {
    flex: 0 0 128px;
}
#order-verticalsteps .cld-catalog-filters .cld-filter-form,
#main-content.cart .cld-catalog-filters .cld-filter-form {
    display: block;
    width: 100%;
}
#order-verticalsteps .cld-catalog-filters .cld-filter-label,
#main-content.cart .cld-catalog-filters .cld-filter-label {
    display: block;
    margin: 0 0 7px;
    color: #24364b;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
}
#order-verticalsteps .cld-catalog-filters .cld-filter-label-currency,
#main-content.cart .cld-catalog-filters .cld-filter-label-currency {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
#order-verticalsteps .cld-catalog-filters .cld-filter-select,
#main-content.cart .cld-catalog-filters .cld-filter-select {
    width: 100% !important;
    min-width: 0;
    height: 42px;
    min-height: 42px;
}

/* ---------- Mobile header normalization on cart/order pages ---------- */
@media (max-width: 767px) {
    /* Common wrappers used by many WHMCS client themes */
    body #header,
    body .header,
    body .main-header,
    body .navbar-main,
    body .navbar.navbar-main,
    body .header-lined,
    body .top-nav {
        position: relative;
    }

    /* Keep the logo centered and prevent oversized brand blocks */
    body #header .logo,
    body .header .logo,
    body .main-header .logo,
    body .navbar-main .logo,
    body .navbar-main .navbar-brand,
    body .header-lined .logo,
    body .header-lined .navbar-brand {
        display: flex !important;
        align-items: center;
        justify-content: center;
        float: none !important;
        width: 100%;
        min-height: 64px;
        padding: 10px 52px 8px;
        margin: 0 auto;
        text-align: center;
        overflow: hidden;
    }
    body #header .logo img,
    body .header .logo img,
    body .main-header .logo img,
    body .navbar-main .logo img,
    body .navbar-main .navbar-brand img,
    body .header-lined .logo img,
    body .header-lined .navbar-brand img {
        max-width: 180px;
        max-height: 44px;
        width: auto;
        height: auto;
        object-fit: contain;
        margin: 0 auto;
    }

    /* Hamburger / toggle on the left */
    body #header .navbar-toggle,
    body .header .navbar-toggle,
    body .main-header .navbar-toggle,
    body .navbar-main .navbar-toggle,
    body .header-lined .navbar-toggle,
    body #header .menu-toggle,
    body .header .menu-toggle,
    body .navbar-main .menu-toggle {
        position: absolute !important;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 8;
        margin: 0 !important;
    }

    /* Compact the icon group on the right without covering the logo */
    body #header .toolbar,
    body .header .toolbar,
    body .main-header .toolbar,
    body .navbar-main .toolbar,
    body .header-lined .toolbar,
    body #header .secondary-nav,
    body .header .secondary-nav,
    body .navbar-main .secondary-nav,
    body #header .nav-icons,
    body .header .nav-icons,
    body .navbar-main .nav-icons {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        max-width: 96px;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 8;
    }
    body #header .toolbar > li,
    body .header .toolbar > li,
    body .navbar-main .toolbar > li,
    body #header .secondary-nav > li,
    body .header .secondary-nav > li,
    body .navbar-main .secondary-nav > li {
        float: none !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Small numeric badges / cart counts */
    body #header .badge,
    body .header .badge,
    body .navbar-main .badge,
    body #header .label,
    body .header .label,
    body .navbar-main .label,
    body #header .item-added-status,
    body .header .item-added-status,
    body .navbar-main .item-added-status,
    body #header .cart-count,
    body .header .cart-count,
    body .navbar-main .cart-count {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        font-size: 11px;
        line-height: 18px;
        text-align: center;
        border-radius: 999px;
    }

    /* Filters on product overview: stack cleanly and never overlap */
    #order-verticalsteps .cld-catalog-filters,
    #main-content.cart .cld-catalog-filters {
        align-items: stretch;
        gap: 10px;
    }
    #order-verticalsteps .cld-catalog-filters .cld-catalog-filter-category,
    #main-content.cart .cld-catalog-filters .cld-catalog-filter-category,
    #order-verticalsteps .cld-catalog-filters .cld-catalog-filter-currency,
    #main-content.cart .cld-catalog-filters .cld-catalog-filter-currency {
        flex: 1 1 100%;
        width: 100%;
    }
    #order-verticalsteps .cld-catalog-filters .cld-filter-label,
    #main-content.cart .cld-catalog-filters .cld-filter-label {
        margin-bottom: 6px;
    }
}

/* Extra-small phones */
@media (max-width: 420px) {
    body #header .logo,
    body .header .logo,
    body .main-header .logo,
    body .navbar-main .logo,
    body .navbar-main .navbar-brand,
    body .header-lined .logo,
    body .header-lined .navbar-brand {
        min-height: 60px;
        padding-left: 44px;
        padding-right: 44px;
    }
    body #header .logo img,
    body .header .logo img,
    body .main-header .logo img,
    body .navbar-main .logo img,
    body .navbar-main .navbar-brand img,
    body .header-lined .logo img,
    body .header-lined .navbar-brand img {
        max-width: 160px;
        max-height: 38px;
    }
}
