/* ============================================
   BookMe — Mobile.css
   Comprehensive mobile-first responsive fixes
   Include AFTER style.css and dashboard.css
   ============================================ */

/* ---- GLOBAL TOUCH TARGETS ---- */
/* All interactive elements must be ≥ 44px tall on mobile */
@media (max-width: 768px) {
    button, .btn, a.btn, input[type="submit"],
    input[type="button"], select, .slot-btn,
    .service-option, .nav-item, .filter-btn {
        min-height: 44px;
    }

    /* Bigger tap area for calendar days */
    .cal-day {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        cursor: pointer;
    }

    /* Form inputs bigger on mobile */
    .form-control { font-size: 16px !important; } /* prevents iOS zoom on focus */
    select.form-control { font-size: 16px !important; }
}

/* ============================================
   LANDING PAGE — Mobile
   ============================================ */
@media (max-width: 768px) {
    .landing-nav {
        padding: 0 16px;
        height: 58px;
    }
    .nav-brand { font-size: 20px; }
    .nav-links { gap: 10px; }
    .nav-links a:not(.btn) { display: none; } /* hide text links, keep buttons */
    .nav-links .btn-outline { display: none; } /* hide login, show only signup */
    .nav-links .btn-primary { padding: 8px 16px; font-size: 13px; }

    .hero {
        padding: 48px 16px 40px;
        text-align: center;
    }
    .hero h1 {
        font-size: 34px !important;
        letter-spacing: -1px;
        margin-bottom: 16px;
    }
    .hero p {
        font-size: 15px !important;
        margin-bottom: 24px;
    }
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .hero-actions .btn {
        justify-content: center;
        font-size: 15px;
        padding: 14px 20px;
    }

    /* Hero mockup — single column on mobile */
    .hero-mockup-wrap {
        grid-template-columns: 1fr !important;
        padding: 14px !important;
        gap: 12px !important;
        border-radius: 14px;
    }
    .mock-whatsapp-card { display: none !important; }
    .mock-wa-pill { display: flex !important; }
    .mock-booking-head { padding: 16px !important; }
    .mock-booking-body { padding: 12px !important; }

    /* Sections */
    .section { padding: 52px 16px; }
    .section-title { font-size: 26px !important; letter-spacing: -0.5px; }
    .section-subtitle { font-size: 14px !important; }
    .features-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .steps-grid { grid-template-columns: 1fr 1fr !important; gap: 24px; }
    .pricing-grid { grid-template-columns: 1fr !important; }

    /* Trusted by strip */
    .trusted-strip { gap: 16px !important; flex-wrap: wrap; justify-content: center; }
    .trusted-strip span { font-size: 18px !important; }

    /* Footer */
    .site-footer { padding: 28px 16px; }

    /* CTA section */
    .cta-section { padding: 52px 16px; }
    .cta-section h2 { font-size: 26px !important; }
    .cta-section .btn { width: 100%; max-width: 320px; }
}

/* ============================================
   DASHBOARD — Mobile sidebar & layout
   ============================================ */
@media (max-width: 900px) {
    /* Sidebar hidden by default, shown when .open */
    .sidebar {
        transform: translateX(-100%);
        width: 260px !important;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    /* Main content full width */
    .main-content { margin-left: 0 !important; }
    .menu-toggle  { display: block !important; }

    /* Top bar */
    .topbar { padding: 0 14px; height: 54px; }
    .topbar-title { font-size: 15px; }
    .topbar-actions .btn { font-size: 12px; padding: 6px 12px; }

    /* Content wrapper */
    .content-wrapper { padding: 14px !important; }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card { padding: 14px 16px !important; }
    .stat-value { font-size: 22px !important; }
    .stat-label { font-size: 11px !important; }
    .stat-icon  { font-size: 22px !important; }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
        margin-bottom: 16px;
    }
    .page-header-title { font-size: 19px !important; }

    /* Tables — scrollable */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }
    thead th { font-size: 10px; padding: 8px 10px; }
    tbody td  { font-size: 13px; padding: 10px; }

    /* Flash messages */
    .flash { margin: 10px 0 !important; }

    /* Store link box */
    .link-share-box { flex-wrap: wrap; gap: 8px; }
    .link-share-url { font-size: 11px; }
}

/* ============================================
   AUTH PAGES — Login / Register
   ============================================ */
@media (max-width: 640px) {
    .auth-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 30px;
    }
    .auth-card {
        padding: 24px 18px !important;
        border-radius: 16px !important;
    }
    .auth-logo-icon { font-size: 40px !important; }
    .auth-logo-name { font-size: 24px !important; }
    .auth-title     { font-size: 20px !important; }
    .form-row       { grid-template-columns: 1fr !important; }
    .btn-lg         { padding: 13px 20px !important; font-size: 15px !important; }
}

/* ============================================
   BOOKING PAGE — Customer facing
   ============================================ */
@media (max-width: 640px) {

    /* Business header */
    .booking-header { padding: 24px 16px 20px; }
    .booking-business-name { font-size: 22px !important; }
    .booking-business-logo { width: 64px !important; height: 64px !important; }
    .booking-business-avatar { width: 64px !important; height: 64px !important; font-size: 26px !important; }

    /* Container */
    .booking-container {
        max-width: 100% !important;
        margin: -16px 0 24px !important;
        padding: 0 12px !important;
    }

    /* Step tabs */
    .booking-steps { border-radius: 10px; overflow: hidden; }
    .booking-step-tab {
        font-size: 10px !important;
        padding: 10px 4px !important;
        letter-spacing: 0;
    }

    /* Cards */
    .card-header { padding: 14px 16px; }
    .card-title  { font-size: 14px; }
    .card-body   { padding: 16px; }

    /* Service grid — full width cards on mobile */
    .service-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    .service-option {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px !important;
    }
    .service-option-img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 10px !important;
        object-fit: cover;
        flex-shrink: 0;
        margin: 0 !important;
        max-width: none !important;
    }
    .service-option-has-img { overflow: visible !important; }
    .service-option-name { font-size: 15px !important; font-weight: 700; }
    .service-option-meta { font-size: 12px; }
    .service-option-price { font-size: 14px !important; margin-top: 3px; }

    /* Calendar */
    .mini-calendar { padding: 0; }
    .cal-header { padding: 0 4px; margin-bottom: 14px; }
    .cal-month  { font-size: 16px !important; font-weight: 700; }
    .cal-nav    { width: 36px !important; height: 36px !important; font-size: 18px !important; }

    .cal-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }
    .cal-day-name {
        font-size: 10px !important;
        padding: 4px 0 !important;
        font-weight: 700;
    }
    .cal-day {
        aspect-ratio: 1;
        width: 100%;
        height: auto !important;
        min-height: 40px;
        font-size: 13px !important;
        border-radius: 8px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.15s;
    }
    .cal-day:active { transform: scale(0.92); }
    .cal-day.selected { background: var(--teal) !important; color: white !important; }
    .cal-day.today { border: 2px solid var(--teal) !important; font-weight: 800; }
    .cal-day.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

    /* Time slots — bigger on mobile */
    .slots-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .slot-btn {
        padding: 12px 6px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        min-height: 46px;
        transition: all 0.15s;
    }
    .slot-btn:active { transform: scale(0.94); }
    .slot-btn.selected {
        background: var(--teal) !important;
        color: white !important;
        border-color: var(--teal) !important;
        box-shadow: 0 3px 10px rgba(0,150,136,0.3);
    }
    .no-slots {
        padding: 24px 12px !important;
        font-size: 14px !important;
    }

    /* Booking summary */
    .booking-summary { padding: 14px !important; }
    .booking-summary-row { font-size: 13px; }
    .booking-summary-label { color: var(--text-medium); }
    .booking-summary-value { font-weight: 700; }

    /* Confirmation screen */
    .confirm-screen { padding: 24px 16px; }
    .confirm-icon  { font-size: 52px; }
    .confirm-title { font-size: 20px; }

    /* Navigation buttons in booking flow */
    #step2 > .card ~ div,
    #step3 > .card .card-body > div:last-child {
        gap: 10px;
    }
    .btn-whatsapp { font-size: 14px !important; padding: 13px 18px !important; }

    /* Powered by */
    .booking-container > div:last-child { margin-top: 20px; font-size: 11px; }
}

/* ============================================
   SERVICES PAGE — Dashboard
   ============================================ */
@media (max-width: 640px) {
    .service-cards-grid {
        grid-template-columns: 1fr !important;
    }
    .service-item-card {
        flex-direction: row !important;
        align-items: center;
    }
    .service-item-img-wrap {
        width: 90px !important;
        height: 90px !important;
        flex-shrink: 0;
        border-radius: var(--radius) 0 0 var(--radius) !important;
    }
    .service-item-img-placeholder {
        width: 90px !important;
        height: 90px !important;
        border-radius: var(--radius) 0 0 var(--radius) !important;
        font-size: 28px !important;
    }
    .service-item-card > div:last-child { flex: 1; }

    /* Add service form */
    .service-img-upload-wrap { flex-direction: column; }
    .service-img-preview { max-width: 100% !important; height: 160px !important; }
}

/* ============================================
   AVAILABILITY PAGE
   ============================================ */
@media (max-width: 640px) {
    .avail-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
        padding: 14px !important;
    }
    .avail-day { width: 100% !important; font-size: 15px; }
    .avail-times {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .avail-times .form-control {
        flex: 1;
        min-width: 130px;
    }
    .avail-times span { align-self: center; }
}

/* ============================================
   BOOKINGS PAGE — Dashboard
   ============================================ */
@media (max-width: 640px) {
    .booking-filters {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .booking-filters::-webkit-scrollbar { display: none; }
    .filter-btn {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 12px;
        flex-shrink: 0;
    }

    /* Booking table — stack on mobile */
    .bookings-table thead { display: none; }
    .bookings-table tbody tr {
        display: block;
        background: white;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 14px;
        margin-bottom: 10px;
    }
    .bookings-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0 !important;
        border: none !important;
        font-size: 13px;
    }
    .bookings-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .actions-cell {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }
}

/* ============================================
   PROFILE PAGE — Dashboard
   ============================================ */
@media (max-width: 640px) {
    .profile-pic-wrap { margin-bottom: 16px; }
    .profile-pic, .profile-pic-placeholder {
        width: 80px !important;
        height: 80px !important;
        font-size: 28px !important;
    }
}

/* ============================================
   QR CODE PAGE
   ============================================ */
@media (max-width: 640px) {
    .qr-container { padding: 20px 16px; }
    .qr-img { width: 200px !important; height: 200px !important; }
    .qr-actions { flex-direction: column; gap: 10px; }
    .qr-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================
   UNIVERSAL MOBILE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    /* Remove hover effects on mobile (avoid sticky hover on touch) */
    .feature-card:hover,
    .pricing-card:hover,
    .stat-card:hover,
    .service-item-card:hover { transform: none !important; box-shadow: inherit !important; }

    /* Wider modals / overlays */
    .modal { margin: 0 !important; border-radius: 0 !important; height: 100vh; }

    /* Scrollable horizontal containers */
    .overflow-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .overflow-mobile::-webkit-scrollbar { display: none; }

    /* Full-width buttons on mobile */
    .btn-mobile-full { width: 100%; justify-content: center; }

    /* Font size base */
    body { font-size: 15px; }

    /* Card padding reduction */
    .card-body { padding: 16px !important; }
    .card-header { padding: 14px 16px !important; }

    /* Flash messages */
    .flash { font-size: 13px; }
    .flash-close { font-size: 20px; }

    /* Empty states */
    .empty-state { padding: 40px 16px; }
    .empty-icon  { font-size: 44px; }
    .empty-title { font-size: 16px; }

    /* Badges */
    .badge { font-size: 10px; padding: 2px 8px; }

    /* Toggle switches — bigger touch area */
    .toggle-switch { width: 48px; height: 26px; }
    .toggle-slider::before { width: 20px; height: 20px; }
    input:checked + .toggle-slider::before { transform: translateX(22px); }
}

/* ============================================
   PWA INSTALL BANNER
   ============================================ */
.pwa-install-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pwa-install-banner.visible { transform: translateY(0); }
.pwa-banner-icon { font-size: 36px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-title { font-weight: 800; font-size: 14px; color: var(--text-dark); margin-bottom: 2px; }
.pwa-banner-sub   { font-size: 12px; color: var(--text-medium); }
.pwa-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pwa-install-btn { background: var(--teal); color: white; border: none; padding: 9px 16px; border-radius: 100px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; transition: all 0.2s; white-space: nowrap; }
.pwa-install-btn:hover { background: var(--teal-dark); }
.pwa-dismiss-btn { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 20px; padding: 4px; }

/* PWA notification permission prompt */
.notif-prompt {
    position: fixed;
    top: 70px; right: 16px;
    background: var(--text-dark);
    color: white;
    border-radius: var(--radius);
    padding: 16px 18px;
    width: 300px;
    z-index: 9998;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transform: translateX(130%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notif-prompt.visible { transform: translateX(0); }
.notif-prompt-icon  { font-size: 28px; margin-bottom: 10px; display: block; }
.notif-prompt-title { font-weight: 800; font-size: 15px; margin-bottom: 5px; }
.notif-prompt-sub   { font-size: 12px; color: rgba(255,255,255,0.65); margin-bottom: 14px; line-height: 1.6; }
.notif-prompt-btns  { display: flex; gap: 8px; }
.notif-allow-btn { background: var(--teal); color: white; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; flex: 1; font-family: inherit; }
.notif-later-btn { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); border: none; padding: 9px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit; }

@media (max-width: 400px) {
    .notif-prompt { right: 8px; left: 8px; width: auto; }
    .pwa-install-banner { padding: 14px 14px; gap: 10px; }
    .pwa-banner-actions { flex-direction: column; gap: 6px; }
}

/* ============================================
   QR CODE — Dynamic clickable QR
   ============================================ */
.qr-page { min-height: 100vh; background: linear-gradient(160deg, var(--teal-xlight), white); display: flex; align-items: center; justify-content: center; padding: 24px; }
.qr-card { background: white; border-radius: var(--radius-lg); padding: 40px 36px; text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.1); max-width: 400px; width: 100%; }
.qr-logo { font-size: 48px; margin-bottom: 8px; display: block; }
.qr-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.qr-biz { font-size: 14px; color: var(--text-medium); margin-bottom: 24px; }
.qr-code-img { width: 220px; height: 220px; display: block; margin: 0 auto 20px; border-radius: 12px; border: 4px solid var(--teal); padding: 4px; }
.qr-url { font-size: 12px; color: var(--text-light); word-break: break-all; margin-bottom: 20px; }
.qr-download-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; background: var(--teal); color: white; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; text-decoration: none; transition: all 0.2s; }
.qr-download-btn:hover { background: var(--teal-dark); }
