/* BiigHands customer and handyman portal responsive UX layer. */

.bh-handyman-page,
.bh-customer-portal {
    --bh-ux-ink: #14302c;
    --bh-ux-muted: #657673;
    --bh-ux-teal: #0b6a6b;
    --bh-ux-aqua: #1ac0c1;
    --bh-ux-line: #e3dccc;
    --bh-ux-soft: #f1ede3;
    --bh-ux-surface: #fff;
    -webkit-font-smoothing: antialiased;
}

.bh-handyman-page *,
.bh-customer-portal * {
    box-sizing: border-box;
}

.bh-handyman-page button:focus-visible,
.bh-handyman-page a:focus-visible,
.bh-handyman-page input:focus-visible,
.bh-handyman-page select:focus-visible,
.bh-handyman-page textarea:focus-visible,
.bh-customer-portal button:focus-visible,
.bh-customer-portal a:focus-visible,
.bh-customer-portal input:focus-visible,
.bh-customer-portal select:focus-visible,
.bh-customer-portal textarea:focus-visible {
    outline: 3px solid rgba(26, 192, 193, .3);
    outline-offset: 3px;
}

/* Handyman dashboard: compact command-centre layout. */
.bh-handyman-page .bh-handyman-shell,
.bh-handyman-page .bh-hm-detail-shell {
    margin-top: 24px;
    max-width: 1320px;
}

.bh-handyman-page .bh-handyman-main {
    min-width: 0;
    overflow: visible;
}

.bh-handyman-page .bh-handyman-sidebar {
    position: sticky;
    top: 88px;
}

.bh-handyman-page .bh-handyman-header {
    background:
        radial-gradient(circle at 100% 0, rgba(26, 192, 193, .17), transparent 16rem),
        linear-gradient(135deg, #fff, #f4fbfa);
    border: 1px solid rgba(11, 106, 107, .14);
    padding: clamp(18px, 2.5vw, 28px);
}

.bh-handyman-page .bh-handyman-header > div:first-child {
    min-width: 0;
}

.bh-handyman-page .bh-handyman-header h1 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    overflow-wrap: anywhere;
}

.bh-handyman-page .bh-handyman-header p {
    margin-bottom: 0;
    max-width: 52rem;
}

.bh-handyman-page .bh-hm-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bh-handyman-page .bh-hm-stat-card {
    min-width: 0;
    min-height: 118px;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bh-handyman-page .bh-hm-stat-card:hover {
    border-color: rgba(11, 106, 107, .28);
    box-shadow: 0 14px 30px -24px rgba(20, 48, 44, .65);
    transform: translateY(-2px);
}

.bh-handyman-page .bh-hm-stat-card strong {
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    overflow-wrap: anywhere;
}

.bh-handyman-page .bh-hm-dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.bh-handyman-page .bh-hm-section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.bh-handyman-page .bh-hm-section-heading .bh-btn {
    flex: 0 0 auto;
    margin-left: 12px;
}

.bh-handyman-page .bh-hm-empty-state--compact {
    margin: 10px 0;
}

.bh-handyman-page .bh-hm-schedule-section {
    min-width: 0;
}

.bh-handyman-page .bh-hm-timeline-item {
    min-width: 0;
}

.bh-handyman-page .bh-timeline-content {
    min-width: 0;
}

.bh-handyman-page .bh-timeline-content > strong,
.bh-handyman-page .bh-timeline-content > p {
    overflow-wrap: anywhere;
}

.bh-handyman-page .bh-handyman-job-card {
    border-color: rgba(11, 106, 107, .14);
    box-shadow: 0 8px 22px -20px rgba(20, 48, 44, .7);
}

.bh-handyman-page .bh-handyman-job-card:hover {
    border-color: rgba(11, 106, 107, .34);
}

.bh-handyman-page .bh-hm-job-left > div:last-child {
    overflow: hidden;
}

.bh-handyman-page .bh-hm-job-left strong,
.bh-handyman-page .bh-hm-job-left p,
.bh-handyman-page .bh-hm-job-left small {
    display: block;
    max-width: 100%;
}

.bh-handyman-page .bh-hm-booking-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bh-handyman-page .bh-hm-booking-meta form {
    margin: 0;
}

.bh-handyman-page .bh-hm-booking-meta .bh-btn {
    min-height: 42px;
}

.bh-handyman-page .bh-hm-jobs-filter-form {
    background: #fff;
    border: 1px solid var(--bh-ux-line);
    border-radius: 16px;
    padding: 14px;
}

.bh-handyman-page .bh-hm-jobs-filter-group {
    flex: 1 1 170px;
    min-width: 0;
}

.bh-handyman-page .bh-hm-jobs-filter-group input,
.bh-handyman-page .bh-hm-jobs-filter-form .bh-btn {
    min-height: 44px;
}

.bh-handyman-page .bh-hm-schedule-scroll {
    border-radius: 16px;
    scrollbar-color: #8bc9c5 #edf4f3;
    scrollbar-width: thin;
}

.bh-handyman-page .bh-hm-schedule-scroll::-webkit-scrollbar {
    height: 8px;
}

.bh-handyman-page .bh-hm-schedule-scroll::-webkit-scrollbar-thumb {
    background: #8bc9c5;
    border-radius: 99px;
}

.bh-handyman-page .bh-hm-detail-card img,
.bh-handyman-page .bh-hm-detail-card video {
    height: auto;
    max-width: 100%;
}

.bh-handyman-page .bh-hm-materials-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.bh-handyman-page .bh-hm-mobile-dock,
.bh-customer-portal .bh-cp-mobile-dock {
    display: none;
}

/* Customer portal: denser cards without sacrificing tap comfort. */
.bh-customer-portal .bh-dashboard-shell,
.bh-customer-portal .bh-detail-shell {
    max-width: 1320px;
}

.bh-customer-portal .bh-dashboard-main,
.bh-customer-portal .bh-detail-card,
.bh-customer-portal .bh-confirmation-card {
    min-width: 0;
}

.bh-customer-portal .bh-cp-page-head h1,
.bh-customer-portal .bh-dashboard-header h1 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    overflow-wrap: anywhere;
}

.bh-customer-portal .bh-cp-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bh-customer-portal .bh-cp-card {
    min-width: 0;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bh-customer-portal .bh-cp-card:hover {
    border-color: rgba(11, 106, 107, .3);
    box-shadow: 0 14px 32px -26px rgba(20, 48, 44, .72);
    transform: translateY(-2px);
}

.bh-customer-portal .bh-cp-card__body,
.bh-customer-portal .bh-cp-card__title-row,
.bh-customer-portal .bh-cp-card__badges {
    min-width: 0;
}

.bh-customer-portal .bh-cp-card__ref,
.bh-customer-portal .bh-cp-card__service,
.bh-customer-portal .bh-cp-card__meta,
.bh-customer-portal .bh-cp-card__note {
    overflow-wrap: anywhere;
}

.bh-customer-portal .bh-cp-pcard,
.bh-customer-portal .bh-cp-filter-form,
.bh-customer-portal .bh-cp-card {
    box-shadow: 0 8px 22px -22px rgba(20, 48, 44, .65);
}

.bh-customer-portal .bh-cp-input,
.bh-customer-portal .bh-cp-select,
.bh-customer-portal .bh-cp-filter-form input,
.bh-customer-portal .bh-cp-filter-form select {
    min-height: 44px;
}

@media (max-width: 1100px) {
    .bh-handyman-page .bh-hm-stat-grid,
    .bh-customer-portal .bh-cp-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bh-handyman-page .bh-hm-dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .bh-handyman-page,
    #wrapwrap .bh-handyman-page {
        padding: 10px 12px calc(96px + env(safe-area-inset-bottom)) !important;
    }

    .bh-handyman-page .bh-handyman-shell,
    .bh-handyman-page .bh-hm-detail-shell {
        margin-top: 0;
        max-width: 760px;
    }

    .bh-hm-mobile-header {
        position: sticky;
        top: 8px;
    }

    .bh-handyman-page .bh-handyman-main {
        border-radius: 18px;
        padding: clamp(14px, 3vw, 22px);
    }

    .bh-handyman-page .bh-handyman-header {
        align-items: stretch;
        margin-bottom: 16px;
    }

    .bh-handyman-page .bh-hm-avail-toggle {
        min-height: 48px;
    }

    .bh-handyman-page .bh-hm-mobile-dock {
        align-items: stretch;
        background: rgba(255, 255, 255, .96);
        border: 1px solid rgba(11, 106, 107, .18);
        border-radius: 18px 18px 0 0;
        bottom: 0;
        box-shadow: 0 -12px 32px rgba(20, 48, 44, .13);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        left: 50%;
        max-width: 760px;
        padding: 7px max(7px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
        position: fixed;
        transform: translateX(-50%);
        width: 100%;
        z-index: 9995;
    }

    .bh-handyman-page .bh-hm-mobile-dock a {
        align-items: center;
        border-radius: 12px;
        color: #74817d;
        display: flex;
        flex-direction: column;
        font-size: 10px;
        font-weight: 700;
        gap: 3px;
        justify-content: center;
        min-height: 54px;
        min-width: 0;
        padding: 5px 2px;
        position: relative;
        text-decoration: none;
    }

    .bh-handyman-page .bh-hm-mobile-dock a i {
        font-size: 18px;
    }

    .bh-handyman-page .bh-hm-mobile-dock a.active {
        background: #e8f8f6;
        color: var(--bh-ux-teal);
    }

    .bh-handyman-page .bh-hm-mobile-dock a em {
        align-items: center;
        background: #e04949;
        border: 2px solid #fff;
        border-radius: 99px;
        color: #fff;
        display: flex;
        font-size: 9px;
        font-style: normal;
        height: 18px;
        justify-content: center;
        min-width: 18px;
        padding: 0 4px;
        position: absolute;
        right: calc(50% - 20px);
        top: 2px;
    }

    .bh-handyman-page .bh-hm-mobile-drawer,
    .bh-customer-portal .bh-customer-mobile-drawer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 760px) {
    .bh-customer-portal,
    #wrapwrap .bh-customer-portal {
        padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    }

    .bh-customer-portal .bh-customer-mobile-header {
        position: sticky;
        top: 8px;
    }

    .bh-customer-portal .bh-cp-mobile-dock {
        align-items: stretch;
        background: rgba(255, 255, 255, .96);
        border: 1px solid rgba(11, 106, 107, .18);
        border-radius: 18px 18px 0 0;
        bottom: 0;
        box-shadow: 0 -12px 32px rgba(20, 48, 44, .13);
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        left: 50%;
        max-width: 760px;
        padding: 7px max(7px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
        position: fixed;
        transform: translateX(-50%);
        width: 100%;
        z-index: 9995;
    }

    .bh-customer-portal .bh-cp-mobile-dock a {
        align-items: center;
        border-radius: 12px;
        color: #74817d;
        display: flex;
        flex-direction: column;
        font-size: 10px;
        font-weight: 700;
        gap: 3px;
        justify-content: center;
        min-height: 54px;
        min-width: 0;
        padding: 5px 2px;
        text-decoration: none;
    }

    .bh-customer-portal .bh-cp-mobile-dock a i {
        font-size: 18px;
    }

    .bh-customer-portal .bh-cp-mobile-dock a.active {
        background: #e8f8f6;
        color: var(--bh-ux-teal);
    }

    .bh-customer-portal .bh-cp-mobile-dock__new {
        background: var(--bh-ux-teal);
        color: #fff;
    }

    .bh-customer-portal .bh-cp-mobile-dock__new:hover {
        color: #fff;
    }

    .bh-customer-portal .bh-cp-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bh-customer-portal .bh-cp-card {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .bh-customer-portal .bh-cp-card__title-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bh-customer-portal .bh-cp-card__aside {
        align-items: stretch;
        border-left: 0;
        border-top: 1px solid var(--bh-ux-line);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding-left: 0;
        padding-top: 14px;
        width: 100%;
    }

    .bh-customer-portal .bh-cp-card__aside .bh-cp-btn,
    .bh-customer-portal .bh-cp-card__aside .bh-btn {
        flex: 1 1 150px;
        min-height: 46px;
    }

    .bh-customer-portal .bh-cp-pcard,
    .bh-customer-portal .bh-cp-filter-form {
        padding: 18px;
    }

    .bh-customer-portal .bh-cp-filter-grid,
    .bh-customer-portal .bh-cp-field-grid {
        grid-template-columns: 1fr;
    }

    .bh-customer-portal .bh-cp-span-2 {
        grid-column: auto;
    }

    .bh-customer-portal .bh-cp-filter-actions,
    .bh-customer-portal .bh-cp-form-actions {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .bh-customer-portal .bh-cp-filter-actions .bh-cp-btn,
    .bh-customer-portal .bh-cp-form-actions .bh-cp-btn,
    .bh-customer-portal .bh-cp-form-actions .bh-cp-btn--link {
        justify-content: center;
        min-height: 46px;
        text-align: center;
    }
}

@media (max-width: 620px) {
    .bh-handyman-page .bh-handyman-main {
        border-left: 1px solid rgba(11, 106, 107, .14);
        box-shadow: none;
        padding: 12px;
    }

    .bh-handyman-page .bh-handyman-header {
        padding: 16px;
    }

    .bh-handyman-page .bh-hm-stat-grid {
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bh-handyman-page .bh-hm-stat-card {
        min-height: 102px;
        padding: 14px;
    }

    .bh-handyman-page .bh-hm-stat-card span {
        font-size: .68rem;
    }

    .bh-handyman-page .bh-handyman-job-card {
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .bh-handyman-page .bh-hm-job-left {
        align-items: flex-start;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .bh-handyman-page .bh-hm-job-icon {
        height: 42px;
        width: 42px;
    }

    .bh-handyman-page .bh-hm-card-address {
        background: #f7faf9;
        border-radius: 10px;
        padding: 10px 12px;
    }

    .bh-handyman-page .bh-hm-booking-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .bh-handyman-page .bh-hm-booking-meta > strong,
    .bh-handyman-page .bh-hm-booking-meta > .bh-status {
        align-items: center;
        display: flex;
        justify-content: center;
        min-height: 34px;
    }

    .bh-handyman-page .bh-hm-booking-meta form,
    .bh-handyman-page .bh-hm-booking-meta .bh-btn {
        width: 100%;
    }

    .bh-handyman-page .bh-hm-booking-meta form .bh-btn {
        min-height: 48px;
    }

    .bh-handyman-page .bh-hm-section-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .bh-handyman-page .bh-hm-section-heading .bh-btn {
        min-height: 38px;
        white-space: nowrap;
    }

    .bh-handyman-page .bh-hm-jobs-filter-form {
        align-items: stretch !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .bh-handyman-page .bh-hm-jobs-filter-group,
    .bh-handyman-page .bh-hm-jobs-filter-form .bh-btn {
        width: 100%;
    }

    .bh-handyman-page .bh-hm-jobs-filter-form .bh-btn:last-child {
        grid-column: 1 / -1;
    }

    .bh-handyman-page .bh-hm-info-strip,
    .bh-handyman-page .bh-hm-reference-overview,
    .bh-handyman-page .bh-hm-profile-grid,
    .bh-handyman-page .bh-hm-guide-grid,
    .bh-handyman-page .bh-hm-guide-grid-wide,
    .bh-handyman-page .bh-hm-do-dont {
        grid-template-columns: 1fr;
    }

    .bh-handyman-page .bh-hm-status-btns,
    .bh-handyman-page .bh-hm-status-actions,
    .bh-handyman-page .bh-hm-quick-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .bh-handyman-page .bh-hm-status-btns .bh-btn,
    .bh-handyman-page .bh-hm-status-actions .bh-btn,
    .bh-handyman-page .bh-hm-quick-actions .bh-btn,
    .bh-handyman-page .bh-hm-quick-actions a {
        min-height: 48px;
        width: 100%;
    }

    .bh-handyman-page .bh-hm-detail-list {
        grid-template-columns: 1fr;
    }

    .bh-handyman-page .bh-hm-detail-list dt {
        padding-bottom: 0;
    }

    .bh-handyman-page .bh-hm-detail-list dd {
        padding-top: 0;
    }
}

@media (max-width: 430px) {
    .bh-handyman-page,
    #wrapwrap .bh-handyman-page,
    .bh-customer-portal,
    #wrapwrap .bh-customer-portal {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .bh-handyman-page .bh-hm-stat-grid,
    .bh-customer-portal .bh-cp-stats {
        grid-template-columns: 1fr 1fr;
    }

    .bh-handyman-page .bh-hm-booking-meta,
    .bh-handyman-page .bh-hm-jobs-filter-form,
    .bh-customer-portal .bh-cp-filter-actions,
    .bh-customer-portal .bh-cp-form-actions {
        grid-template-columns: 1fr;
    }

    .bh-handyman-page .bh-hm-jobs-filter-form .bh-btn:last-child {
        grid-column: auto;
    }

    .bh-customer-portal .bh-cp-pcard__head,
    .bh-customer-portal .bh-cp-addr__row {
        align-items: stretch;
        flex-direction: column;
    }

    .bh-customer-portal .bh-cp-addr__actions {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bh-handyman-page *,
    .bh-customer-portal * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
