/* Services page — mobile & touch optimizations */

body.services-page {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

/* ─── Header ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .mobile-menu-btn {
        display: none !important;
    }

    body.services-page .mc-services-header {
        grid-template-columns: auto 1fr auto !important;
        gap: 10px;
    }

    body.services-page .mc-services-header-center {
        justify-self: end;
    }

    /* Hide empty nav column; keep Submit Activity Log when shown */
    body.services-page .mc-services-header .nav:not(:has(#submit-activity-log-nav[style*="display: block"])):not(:has(#submit-activity-log-nav[style*="display:block"])) {
        display: none;
    }

    body.services-page .header_for_main .container_for_main.mc-services-header {
        padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    }

    body.services-page #submit-activity-log-nav .btn-reporting {
        font-size: 0.8rem;
        padding: 8px 10px;
        white-space: nowrap;
    }
}

/* ─── Layout & sections ──────────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    body.services-page section {
        padding: 48px 0;
    }

    body.services-page.mc-is-logged-in section {
        padding: 28px 0 40px;
    }

    body.services-page #solutions.solutions-section {
        padding-top: 72px;
    }

    body.services-page .section-header {
        margin-bottom: 1.25rem;
    }

    body.services-page .section-header h2 {
        font-size: clamp(1.35rem, 5.5vw, 1.75rem);
        line-height: 1.25;
        text-wrap: balance;
    }

    body.services-page .section-subtitle {
        font-size: 0.92rem;
        line-height: 1.5;
        padding: 0 4px;
    }
}

/* ─── Service cards ──────────────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .sp-service-title {
        min-height: auto;
    }

    body.services-page .sp-service-subtitle {
        min-height: auto;
    }

    body.services-page .action-btn.select-plan.shared-access {
        font-size: 0.88rem;
        white-space: normal;
        text-align: center;
        line-height: 1.35;
        hyphens: auto;
    }

    body.services-page .sp-books-link {
        padding: 14px 12px;
        font-size: 0.9rem;
    }
}

/* ─── Verified partner tools ─────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .mc-shop-section-sub {
        font-size: 0.9rem;
        padding: 0 2px;
    }

    body.services-page .mc-shop-featured {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }

    body.services-page .mc-shop-card h3 {
        font-size: 1.05rem;
    }

    body.services-page .mc-shop-card p {
        font-size: 0.88rem;
    }
}

/* ─── Testimonials ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .testimonials-section {
        padding: 44px 0;
    }

    body.services-page .testimonials-peek-card {
        margin-left: 0;
        margin-right: 0;
        padding: 18px 16px;
    }

    body.services-page .testimonials-peek-card .testimonial-content p {
        font-size: 0.95rem;
        line-height: 1.55;
    }

    body.services-page .testimonials-toggle {
        width: 100%;
        min-height: 48px;
        flex-wrap: wrap;
        text-align: center;
        padding: 12px 16px;
    }

    body.services-page .testimonial-card {
        margin: 10px 0;
        padding: 22px 16px;
    }

    body.services-page .testimonial-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    body.services-page .slider-controls {
        gap: 8px;
        margin-top: 20px;
        padding: 0 4px;
    }

    body.services-page .slider-prev,
    body.services-page .slider-next {
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    body.services-page .slider-dots {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    body.services-page .slider-dots .dot {
        width: 10px;
        height: 10px;
        padding: 10px;
        background-clip: content-box;
        box-sizing: content-box;
    }
}

/* ─── Sarah Chen success story ───────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .success-story-section {
        padding: 44px 0;
    }

    body.services-page .story-container {
        border-radius: 16px;
    }

    body.services-page .story-quote {
        font-size: 1rem;
        padding: 0 2px;
    }

    body.services-page .phase-solution {
        font-size: 0.82rem;
        max-width: 100%;
        line-height: 1.35;
        word-break: break-word;
    }

    body.services-page .phase-description {
        font-size: 0.9rem;
    }

    body.services-page .story-journey-toggle {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
    }

    body.services-page .journey-phase {
        padding: 22px 16px;
    }
}

@media (max-width: 380px) {
    body.services-page .story-stats--compact .stat-label {
        font-size: 0.78rem;
    }

    body.services-page .story-stats--compact .story-stat-number {
        font-size: 1.35rem;
    }
}

/* ─── Footer ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .footer {
        padding: 44px 0 calc(20px + env(safe-area-inset-bottom, 0px));
    }

    body.services-page .footer-grid {
        gap: 24px;
        margin-bottom: 28px;
    }

    body.services-page .footer-about .logo img {
        height: 34px !important;
    }

    body.services-page .social-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    body.services-page .social-links a {
        width: 40px;
        height: 40px;
    }

    body.services-page .footer-bottom p {
        font-size: 0.85rem;
    }
}

/* ─── Floating controls ──────────────────────────────────────── */
@media (max-width: 768px) {
    body.services-page .back-to-top {
        bottom: max(16px, env(safe-area-inset-bottom, 16px));
        right: max(16px, env(safe-area-inset-right, 16px));
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* ─── Modals (auth, checkout, success) ───────────────────────── */
@media (max-width: 640px) {
    body.services-page #loginModal.modal,
    body.services-page #signupModal.modal,
    body.services-page #purchase-modal.modal,
    body.services-page #success-modal.modal {
        padding: 0;
        align-items: flex-end;
    }

    body.services-page #loginModal .modal-content,
    body.services-page #signupModal .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 92dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    body.services-page #purchase-modal .purchase-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 92dvh;
    }

    body.services-page #success-modal .success-modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    }
}

/* ─── Profile menu ───────────────────────────────────────────── */
@media (max-width: 480px) {
    body.services-page .user-menu.open .profile-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: 100%;
        border-radius: 16px 16px 0 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.18);
        z-index: 1003;
    }

    body.services-page .profile-dropdown-menu a,
    body.services-page .profile-dropdown-menu button.logout-btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* ─── Touch devices ──────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    body.services-page .mc-shop-card:hover,
    body.services-page .sp-service-card:hover,
    body.services-page .journey-phase:hover {
        transform: none;
    }

    body.services-page .mc-shop-cta,
    body.services-page .action-btn.select-plan,
    body.services-page .mc-services-login-btn,
    body.services-page .mc-services-user-btn {
        touch-action: manipulation;
    }
}
