﻿/* ═══════════════════════════════════════════════════════════════
   SVCDispatch — Mobile.css
   Include AFTER Site.css in Site.Master <head>
   All rules here override desktop styles at mobile breakpoints
═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────
   1. MOBILE BOTTOM TAB BAR
   Role-aware — consumer tabs vs tech tabs
   Hidden by default, shown at ≤ 860px
────────────────────────────────────────────────── */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #E2E6F0;
    box-shadow: 0 -2px 12px rgba(10, 14, 26, 0.06);
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 200;
    /* iPhone home bar safe area */
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 860px) {
    .mobile-tab-bar {
        display: grid;
    }

    /* Push page content above the bar */
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
    /* Footer needs extra room too */
    .site-footer {
        margin-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* Individual tab item */
.mobile-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: none;
    padding: 6px 0 4px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
}

    .mobile-tab-item:active {
        transform: scale(0.92);
    }

    .mobile-tab-item .tab-icon {
        font-size: 1.15rem;
        line-height: 1;
        transition: transform 0.15s;
    }

    .mobile-tab-item .tab-label {
        font-family: 'Plus Jakarta Sans', sans-serif;
        font-size: 0.58rem;
        font-weight: 600;
        color: #8892AA;
        line-height: 1;
    }

    .mobile-tab-item.active .tab-icon {
        transform: scale(1.12);
    }

    .mobile-tab-item.active .tab-label {
        color: #2563EB;
        font-weight: 800;
    }

    /* Center "Book / New" button — larger + accent */
    .mobile-tab-item.tab-book .tab-icon-book {
        width: 44px;
        height: 44px;
        background: #2563EB;
        color: white;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        font-style: normal;
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
        margin-top: -12px;
    }

/* Badge on tab icon */
.tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    background: #2563EB;
    color: white;
    font-size: 0.55rem;
    font-weight: 800;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    padding: 0 3px;
}

    .tab-badge.tab-badge-red {
        background: #DC2626;
    }


/* ──────────────────────────────────────────────────
   2. NAV — hide/show on scroll + safe area
────────────────────────────────────────────────── */
.site-nav {
    transition: transform 0.25s ease;
    /* Account for iPhone notch */
    padding-top: env(safe-area-inset-top);
}

    .site-nav.nav-hidden {
        transform: translateY(calc(-100% - env(safe-area-inset-top)));
    }

@media (max-width: 860px) {
    .site-nav .nav-inner {
        padding: 0 1rem;
        height: 56px;
    }

    .desktop-only {
        display: none !important;
    }
}


/* ──────────────────────────────────────────────────
   3. STICKY BOOKING / PAYMENT CTA BAR
   Replaces the right-column summary on mobile
   Shown on: Booking.aspx, EstimateReview.aspx
────────────────────────────────────────────────── */
.mobile-pay-bar {
    display: none;
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #E2E6F0;
    box-shadow: 0 -4px 20px rgba(10, 14, 26, 0.1);
    padding: 0.75rem 1rem;
    z-index: 150;
}

.mobile-pay-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.mpb-price-label {
    font-size: 0.65rem;
    color: #8892AA;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.mpb-price {
    font-family: 'Fraunces', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0A0E1A;
    line-height: 1;
}

.mpb-escrow {
    font-size: 0.65rem;
    font-weight: 700;
    color: #059669;
    margin-top: 0.1rem;
}

.mpb-info {
    font-size: 0.68rem;
    color: #8892AA;
    text-align: right;
}

.mpb-btn {
    width: 100%;
    padding: 0.85rem;
    background: #2563EB;
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    border-radius: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .mpb-btn.green {
        background: #059669;
    }

    .mpb-btn.red {
        background: #DC2626;
    }

@media (max-width: 860px) {
    .mobile-pay-bar {
        display: block;
    }
    /* Hide desktop right column when pay bar is active */
    .booking-right-col,
    .estimate-right-col,
    .dispute-right-col {
        display: none;
    }
    /* Widen main column to fill */
    .booking-main,
    .estimate-main {
        grid-template-columns: 1fr !important;
    }
}


/* ──────────────────────────────────────────────────
   4. PROFILE PAGE — sticky book button on mobile
────────────────────────────────────────────────── */
.profile-mobile-cta {
    display: none;
}

@media (max-width: 600px) {
    /* Hide book buttons inside hero */
    .hero-action-col {
        display: none !important;
    }

    .profile-mobile-cta {
        display: flex;
        position: fixed;
        bottom: calc(60px + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        background: white;
        border-top: 1px solid #E2E6F0;
        box-shadow: 0 -4px 16px rgba(10, 14, 26, 0.08);
        gap: 0.5rem;
        z-index: 100;
    }

        .profile-mobile-cta .btn-book-mobile {
            flex: 1;
            padding: 0.8rem;
            background: #2563EB;
            color: white;
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 0.9rem;
            font-weight: 800;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
        }

        .profile-mobile-cta .btn-msg-mobile {
            padding: 0.8rem 1rem;
            background: white;
            color: #4A5270;
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 0.85rem;
            font-weight: 600;
            border: 1.5px solid #CDD3E5;
            border-radius: 12px;
            cursor: pointer;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
}


/* ──────────────────────────────────────────────────
   5. FILTER BOTTOM SHEET (Search.aspx)
   Dropdowns become bottom sheets on mobile
────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .filter-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: calc(60px + env(safe-area-inset-bottom)) !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 70vh;
        overflow-y: auto;
        padding-bottom: 1rem;
        /* Handle bar */
        padding-top: 0.5rem;
    }

        .filter-dropdown::before {
            content: '';
            display: block;
            width: 40px;
            height: 4px;
            background: #CDD3E5;
            border-radius: 2px;
            margin: 0 auto 0.75rem;
        }
}


/* ──────────────────────────────────────────────────
   6. ESTIMATE / LINE ITEMS TABLE
   Collapses on very small screens
────────────────────────────────────────────────── */
@media (max-width: 520px) {
    /* TechEstimate.aspx line item grid */
    .li-top {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto;
        gap: 0.4rem !important;
    }

    .li-total-cell {
        display: none !important;
    }

    .li-col-headers {
        display: none !important;
    }
}

@media (max-width: 580px) {
    /* EstimateReview.aspx table */
    .estimate-table thead {
        display: none;
    }

    .et-row {
        display: block !important;
        padding: 0.75rem !important;
        border-bottom: 1px solid #E2E6F0;
        border-radius: 0;
    }

        .et-row td {
            display: flex !important;
            justify-content: space-between;
            padding: 0.2rem 0 !important;
            font-size: 0.8rem !important;
            border: none !important;
        }

            .et-row td::before {
                content: attr(data-label);
                font-weight: 700;
                color: #8892AA;
                font-size: 0.7rem;
                text-transform: uppercase;
                letter-spacing: 0.07em;
                flex-shrink: 0;
                margin-right: 0.5rem;
            }

    .et-qty, .et-unit, .et-total {
        text-align: right !important;
    }
}


/* ──────────────────────────────────────────────────
   7. DISPUTE CENTER — surface right panel on mobile
────────────────────────────────────────────────── */
@media (max-width: 900px) {
    /* Right col cards become visible inline cards */
    .dispute-right-col {
        display: block !important;
        position: static !important;
    }
    /* Reorder: escrow card and deadline appear first */
    .escrow-lock-card,
    .deadline-pill,
    .dl-card {
        order: -1;
        margin-bottom: 1rem;
    }
    /* Slim down for mobile */
    .elc-body {
        padding: 1rem;
    }

    .ea-num {
        font-size: 1.6rem;
    }
}


/* ──────────────────────────────────────────────────
   8. DASHBOARD LAYOUT — KPI, Job cards
────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* KPI: 2 columns */
    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }

    .kc {
        padding: 0.9rem !important;
    }

    .kc-num {
        font-size: 1.4rem !important;
    }

    /* Job card: stack actions below info */
    .jc-body {
        grid-template-columns: 1fr !important;
    }

    .jc-right {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px solid #E2E6F0;
        padding-top: 0.75rem;
        margin-top: 0.25rem;
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

        .jc-right .amt-block {
            text-align: left;
        }

    /* Urgent alert banner — stack on mobile */
    .dispute-alert-banner,
    .dispute-urgent-banner,
    .new-job-banner {
        flex-direction: column !important;
        gap: 0.85rem !important;
    }

    .dab-actions,
    .dub-actions,
    .njb-actions {
        flex-direction: row !important;
        width: 100%;
    }

    .dab-btn-primary,
    .dub-btn-primary,
    .njb-accept {
        flex: 1;
    }
}


/* ──────────────────────────────────────────────────
   9. BOOKING PAGE — calendar + time slots
────────────────────────────────────────────────── */
@media (max-width: 540px) {
    /* Calendar days — smaller */
    .cal-day {
        font-size: 0.75rem !important;
        border-radius: 7px !important;
    }

    .cal-day-header {
        font-size: 0.6rem !important;
    }

    /* Time slot grid: 3 columns on mobile */
    .slots-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .slot {
        font-size: 0.72rem !important;
        padding: 0.45rem 0.2rem !important;
    }

    /* Form rows: single column */
    .form-row {
        grid-template-columns: 1fr !important;
    }

        .form-row.triple {
            grid-template-columns: 1fr 1fr !important;
        }
}


/* ──────────────────────────────────────────────────
   10. TOUCH TARGETS — Apple HIG: 44px minimum
   iOS won't zoom if input font-size >= 16px
────────────────────────────────────────────────── */
@media (max-width: 860px) {
    /* All tap targets minimum 44px */
    .abtn,
    .btn-primary,
    .btn-ghost,
    .btn-blue,
    .da,
    .sn,
    .snav-item,
    .nav-icon-btn,
    .m-nav-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Prevent iOS zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Larger form padding on touch devices */
    .form-input,
    .form-select,
    .fi, .fs, .ft,
    .li-desc-input,
    .li-num-input {
        padding: 0.72rem 0.9rem !important;
    }
}


/* ──────────────────────────────────────────────────
   11. NOTIFICATION DROPDOWN — full-width on mobile
────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .notif-dropdown,
    .np {
        width: calc(100vw - 2rem) !important;
        right: 1rem !important;
        left: 1rem !important;
    }

    .user-menu {
        width: calc(100vw - 2rem) !important;
        right: 1rem !important;
    }
}


/* ──────────────────────────────────────────────────
   12. SEARCH PAGE — horizontal scroll cards on mobile
────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* Pro cards become full-width list items */
    .pro-card {
        grid-template-columns: auto 1fr !important;
    }

    .pro-card-right {
        grid-column: 1 / -1 !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px solid #E2E6F0;
        padding-top: 0.65rem;
        margin-top: 0.25rem;
    }

    .diag-block {
        text-align: left !important;
    }

    /* Hide map panel as default on mobile */
    .map-panel {
        display: none !important;
    }

    .results-wrap {
        grid-template-columns: 1fr !important;
    }
}


/* ──────────────────────────────────────────────────
   13. WEEK SCHEDULE (TechDashboard) — 4-col on mobile
────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .week-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
        /* Hide weekend columns on smallest screens */
        .week-grid > .day-col:nth-child(6),
        .week-grid > .day-col:nth-child(7) {
            display: none;
        }
}

/* ──────────────────────────────────────────────────
   14. HERO LANDING PAGE — stack on mobile
────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.6rem) !important;
        letter-spacing: -1px !important;
    }

    .hero-stats {
        flex-wrap: wrap !important;
        gap: 1rem 1.5rem !important;
    }

    .stat-divider {
        display: none !important;
    }

    .hiw-steps {
        grid-template-columns: 1fr !important;
    }

        .hiw-steps::before {
            display: none !important;
        }

    .cta-grid {
        grid-template-columns: 1fr !important;
    }

    .escrow-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-top {
        grid-template-columns: 1fr !important;
    }

    /* Featured Pros — single column on phones */
    .pros-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 641px) and (max-width: 960px) {
    /* Featured Pros — two columns on tablets */
    .pros-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* ──────────────────────────────────────────────────
   15. SAFE AREA — iPhone notch + home indicator
────────────────────────────────────────────────── */
.site-nav {
    padding-top: env(safe-area-inset-top);
}

.mobile-tab-bar {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom));
}

.mobile-pay-bar {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    bottom: calc(60px + env(safe-area-inset-bottom));
}

.profile-mobile-cta {
    bottom: calc(60px + env(safe-area-inset-bottom));
}


/* ──────────────────────────────────────────────────
   16. OVERLAY — closes dropdowns on mobile tap
────────────────────────────────────────────────── */
.site-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: transparent;
}

    .site-overlay.open {
        display: block;
    }
/* ──────────────────────────────────────────────────
   HAMBURGER BUTTON
────────────────────────────────────────────────── */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 0 9px;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

    .nav-hamburger span {
        display: block;
        height: 2px;
        background: var(--ink);
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease;
        transform-origin: center;
    }

    /* Animate to X when open */
    .nav-hamburger.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-hamburger.open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .nav-hamburger.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-hamburger:hover {
        border-color: var(--blue);
    }

/* ──────────────────────────────────────────────────
   MOBILE NAV DRAWER
────────────────────────────────────────────────── */
.mobile-nav-drawer {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem 1.5rem;
    z-index: 199;
    gap: 0.15rem;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

    .mobile-nav-drawer.open {
        transform: translateY(0);
        opacity: 1;
    }

    .mobile-nav-drawer a {
        display: block;
        padding: 0.75rem 0.85rem;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--body);
        border-radius: 10px;
        text-decoration: none;
        transition: background 0.15s, color 0.15s;
    }

        .mobile-nav-drawer a:hover {
            background: var(--off);
            color: var(--ink);
        }

.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.mobile-nav-signin {
    font-weight: 700 !important;
    color: var(--ink) !important;
}

.mobile-nav-cta {
    background: var(--blue) !important;
    color: var(--white) !important;
    font-weight: 700 !important;
    text-align: center;
    margin-top: 0.25rem;
}

    .mobile-nav-cta:hover {
        background: var(--blue2) !important;
    }

@media (max-width: 860px) {
    .nav-hamburger {
        display: flex;
    }

    .mobile-only {
        display: flex !important;
    }

    .mobile-nav-drawer {
        display: flex;
    }
}