/* WillberHosting V0.21.1 — global client-area mobile hardening */

:root {
    --wh-global-touch: 42px;
    --wh-mobile-bottom-nav-h: 64px;
}

.wh-client-body :is(.btn, .form-control, .custom-select) {
    min-height: 38px;
}

.wh-client-body :is(.wh-page-hero, .wh-dashboard-hero, .wh-services-hero, .wh-finance-hero, .wh-support-hero, .wh-domain-hero, .wh-auth-hero) {
    margin-bottom: 14px;
}

.wh-client-body .wh-section-shell {
    margin-bottom: 12px;
}

.wh-mobile-bottom-nav {
    display: none;
}

@media (max-width: 1199.98px) {
    .wh-navbar-container {
        gap: 10px;
    }

    .wh-mobile-panel-inner {
        padding-top: 8px;
        padding-bottom: 10px;
    }

    .wh-mobile-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .wh-mobile-nav > a {
        display: flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
        min-height: 44px;
        padding: 9px 11px;
        border: 1px solid var(--wh-border);
        border-radius: 11px;
        background: var(--wh-surface-2);
    }

    .wh-mobile-nav > a > i {
        width: 18px;
        flex: 0 0 18px;
        text-align: center;
    }

    .wh-mobile-nav > a > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wh-mobile-nav .wh-mobile-logout {
        grid-column: 1 / -1;
    }

    .wh-mobile-auth-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
}

@media (max-width: 767.98px) {
    body.wh-client-body {
        padding-bottom: calc(var(--wh-mobile-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    }

    .wh-shell-header .wh-navbar-container {
        min-height: 58px;
        padding-inline: 11px;
    }

    .wh-brand {
        min-width: 0;
    }

    .wh-logo-img {
        max-width: min(150px, 44vw);
        max-height: 34px;
    }

    .wh-header-actions {
        gap: 5px;
    }

    .wh-icon-btn,
    .wh-mobile-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    #main-body.wh-main-body {
        padding-top: 12px;
    }

    #main-body > .container,
    .wh-main-body > .container {
        width: 100%;
        max-width: none;
        padding-left: 11px;
        padding-right: 11px;
    }

    .wh-primary-content {
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Neutralize legacy Bootstrap row gutters that can widen 320px client pages. */
    .wh-primary-content .row {
        margin-left: 0;
        margin-right: 0;
    }

    .wh-primary-content .row > [class*="col-"] {
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .wh-client-body :is(
        .wh-page-hero,
        .wh-dashboard-hero,
        .wh-services-hero,
        .wh-finance-hero,
        .wh-support-hero,
        .wh-domain-hero,
        .wh-auth-hero
    ) {
        margin-bottom: 10px;
        padding: 15px !important;
        border-radius: 14px !important;
    }

    .wh-client-body :is(
        .wh-page-hero h1,
        .wh-dashboard-hero h1,
        .wh-services-hero h1,
        .wh-finance-hero h1,
        .wh-support-hero h1,
        .wh-domain-hero h1,
        .wh-auth-hero h1
    ) {
        margin-bottom: 5px;
        font-size: clamp(1.28rem, 6vw, 1.62rem);
        line-height: 1.15;
    }

    .wh-client-body :is(
        .wh-page-hero p,
        .wh-dashboard-hero p,
        .wh-services-hero p,
        .wh-finance-hero p,
        .wh-support-hero p,
        .wh-domain-hero p,
        .wh-auth-hero p
    ) {
        margin-bottom: 0;
        font-size: .82rem;
        line-height: 1.45;
    }

    .wh-client-body :is(
        .wh-page-hero-actions,
        .wh-dashboard-hero-actions,
        .wh-auth-hero-actions
    ) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 7px;
        margin-top: 11px;
    }

    .wh-client-body :is(.btn, .form-control, .custom-select) {
        min-height: var(--wh-global-touch);
    }

    .wh-client-body .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 11px;
        white-space: normal;
        text-align: center;
    }

    .wh-section-shell,
    .wh-finance-card,
    .wh-auth-card,
    .wh-account-form {
        margin-bottom: 10px;
        padding: 12px !important;
        border-radius: 13px !important;
    }

    .wh-section-head,
    .wh-section-head-inline,
    .wh-finance-card-head {
        gap: 8px;
        margin-bottom: 10px;
    }

    .wh-section-head h2,
    .wh-finance-card-head h2 {
        font-size: 1rem;
    }

    .wh-service-toolbar,
    .wh-finance-tools,
    .wh-section-head-inline {
        align-items: stretch !important;
        flex-direction: column;
    }

    .wh-service-search,
    .wh-finance-search,
    .wh-support-search {
        width: 100%;
        min-width: 0;
    }

    .wh-service-filters,
    .wh-finance-filter,
    #whInvoiceFilters {
        display: flex;
        width: 100%;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }

    .wh-service-filters::-webkit-scrollbar,
    .wh-finance-filter::-webkit-scrollbar,
    #whInvoiceFilters::-webkit-scrollbar {
        display: none;
    }

    .wh-service-filters button,
    .wh-finance-filter button,
    #whInvoiceFilters button {
        flex: 0 0 auto;
        min-height: 38px;
    }

    .wh-stat-grid,
    .wh-finance-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .wh-finance-stat {
        min-width: 0;
        padding: 10px !important;
    }

    .wh-service-grid,
    .wh-domain-grid,
    .wh-support-ticket-grid {
        grid-template-columns: 1fr !important;
        gap: 9px !important;
    }

    .wh-service-card,
    .wh-dashboard-service-card,
    .wh-domain-card,
    .wh-support-ticket-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .wh-support-shortcuts {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .wh-support-shortcut {
        min-width: 0;
        padding: 10px !important;
    }

    .wh-support-shortcut small {
        display: none;
    }

    .wh-support-form-grid,
    .wh-account-form-grid,
    .wh-preference-grid {
        grid-template-columns: 1fr !important;
        gap: 9px !important;
    }

    .wh-account-form-full,
    .wh-support-form-full {
        grid-column: 1 !important;
    }

    .wh-account-savebar,
    .wh-support-form-footer {
        align-items: stretch !important;
        flex-direction: column;
        gap: 8px;
    }

    .wh-account-savebar > div,
    .wh-support-form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .wh-finance-table-wrap {
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
    }

    .wh-finance-table,
    .wh-finance-table tbody,
    .wh-finance-table tr,
    .wh-finance-table td {
        display: block;
        width: 100%;
    }

    .wh-finance-table thead {
        display: none;
    }

    .wh-finance-table tbody {
        display: grid;
        gap: 8px;
    }

    .wh-finance-table tbody tr {
        padding: 10px 11px;
        border: 1px solid var(--wh-border) !important;
        border-radius: 11px;
        background: var(--wh-surface-2);
    }

    .wh-finance-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 34px;
        padding: 5px 0 !important;
        border: 0 !important;
        text-align: right !important;
    }

    .wh-finance-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--wh-text-muted);
        font-size: .72rem;
        font-weight: 800;
        text-align: left;
    }

    .wh-finance-table tbody td:first-child {
        padding-top: 0 !important;
    }

    .wh-finance-table tbody td:last-child {
        padding-bottom: 0 !important;
    }

    .wh-finance-view-btn {
        width: 100%;
    }

    .wh-footer {
        margin-bottom: 0;
    }

    .wh-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px 10px !important;
    }

    .wh-toast-region {
        bottom: calc(var(--wh-mobile-bottom-nav-h) + 10px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .wh-mobile-bottom-nav {
        position: fixed;
        z-index: 19980;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: calc(var(--wh-mobile-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        padding: 5px 7px max(5px, env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--wh-border);
        background: color-mix(in srgb, var(--wh-surface) 94%, transparent);
        box-shadow: 0 -10px 30px rgba(0,0,0,.16);
        backdrop-filter: blur(16px) saturate(140%);
    }

    .wh-mobile-bottom-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
        border-radius: 9px;
        color: var(--wh-text-muted);
        font-size: 9px;
        font-weight: 800;
        text-align: center;
        text-decoration: none;
    }

    .wh-mobile-bottom-nav a i {
        font-size: 15px;
    }

    .wh-mobile-bottom-nav a.is-active,
    body.wh-template-clientareahome .wh-mobile-bottom-nav [data-wh-bottom-nav="home"],
    body.wh-template-clientareaproducts .wh-mobile-bottom-nav [data-wh-bottom-nav="services"],
    body.wh-template-clientareaproductdetails .wh-mobile-bottom-nav [data-wh-bottom-nav="services"],
    body.wh-template-clientareainvoices .wh-mobile-bottom-nav [data-wh-bottom-nav="invoices"],
    body.wh-template-supportticketslist .wh-mobile-bottom-nav [data-wh-bottom-nav="tickets"],
    body.wh-template-supportticketsubmit-stepone .wh-mobile-bottom-nav [data-wh-bottom-nav="tickets"],
    body.wh-template-supportticketsubmit-steptwo .wh-mobile-bottom-nav [data-wh-bottom-nav="tickets"],
    body.wh-template-supportticketsubmit-confirm .wh-mobile-bottom-nav [data-wh-bottom-nav="tickets"],
    body.wh-template-viewticket .wh-mobile-bottom-nav [data-wh-bottom-nav="tickets"],
    body.wh-template-clientareadetails .wh-mobile-bottom-nav [data-wh-bottom-nav="account"],
    body.wh-template-clientareasecurity .wh-mobile-bottom-nav [data-wh-bottom-nav="account"],
    body.wh-template-user-security .wh-mobile-bottom-nav [data-wh-bottom-nav="account"] {
        background: var(--wh-brand-soft);
        color: var(--wh-text);
    }
}

@media (max-width: 420px) {
    .wh-client-body :is(
        .wh-page-hero-actions,
        .wh-dashboard-hero-actions,
        .wh-auth-hero-actions
    ) {
        grid-template-columns: 1fr;
    }

    .wh-support-shortcuts,
    .wh-footer-grid {
        grid-template-columns: 1fr !important;
    }

    .wh-mobile-nav {
        grid-template-columns: 1fr;
    }

    .wh-mobile-auth-actions,
    .wh-account-savebar > div,
    .wh-support-form-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 340px) {
    #main-body > .container,
    .wh-main-body > .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .wh-client-body :is(
        .wh-page-hero,
        .wh-dashboard-hero,
        .wh-services-hero,
        .wh-finance-hero,
        .wh-support-hero,
        .wh-domain-hero,
        .wh-auth-hero
    ) {
        padding: 12px !important;
    }

    .wh-stat-grid,
    .wh-finance-stats {
        grid-template-columns: 1fr !important;
    }

    .wh-mobile-bottom-nav {
        padding-inline: 3px;
    }

    .wh-mobile-bottom-nav a {
        font-size: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wh-mobile-bottom-nav,
    .wh-mobile-bottom-nav * {
        transition: none !important;
    }
}
