/* ================================================================
   mobile.css — Premium small-device layer for Pro & POS pages
   Loaded AFTER pro.css / pos.css. Everything here is ≤768px only,
   so desktop layouts are untouched.
   - Feature cards  → compact tap-to-expand rows
   - Pricing cards  → swipeable snap carousel with dots
   - Testimonials   → swipeable snap carousel
================================================================ */

.m-dots { display: none; }

@media (max-width: 768px) {

    /* ─── Section rhythm ─── */
    .features-header, .pricing-header, .steps-header, .testimonials-header { margin-bottom: 32px; }
    .section-subtitle { font-size: 0.96rem; }
    .features-header .section-subtitle, .pricing-header .section-subtitle,
    .steps-header .section-subtitle, .testimonials-header .section-subtitle { margin-left: auto; margin-right: auto; }

    /* ─── Feature cards: tap-to-expand ─── */
    .features-grid { grid-template-columns: 1fr; gap: 10px; }
    .feature-card {
        display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px; align-items: center;
        padding: 14px 14px 14px 14px; border-radius: 16px; cursor: pointer;
        background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.04);
        -webkit-tap-highlight-color: transparent; user-select: none;
    }
    .feature-card::before { display: none; }
    .feature-card:hover { transform: none; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.04); }
    .feature-card .feature-icon { width: 44px; height: 44px; margin: 0; border-radius: 13px; font-size: 1.15rem; }
    .feature-card .feature-icon { grid-column: 1; grid-row: 1; }
    .feature-card h3 { grid-column: 2; grid-row: 1; font-size: 0.95rem; margin: 0; line-height: 1.3; }
    .feature-card::after {
        content: ''; grid-column: 3; grid-row: 1; width: 28px; height: 28px; border-radius: 50%;
        background: var(--primary-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
        border: 1px solid var(--border); transition: transform .35s cubic-bezier(.4,0,.2,1), background-color .25s;
    }
    .feature-card p {
        grid-column: 1 / -1; grid-row: 2; font-size: 0.86rem; line-height: 1.65;
        max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
        transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .3s, margin-top .3s;
    }
    .feature-card.open { border-color: var(--primary-light); background: linear-gradient(180deg, #fff, var(--primary-50)); box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 12px 28px rgba(15,23,42,.08); }
    .feature-card.open::after { transform: rotate(180deg); background-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); border-color: var(--primary); }
    .feature-card.open p { max-height: 260px; opacity: 1; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

    /* ─── Pricing: swipeable carousel ─── */
    .pricing-grid {
        display: flex; grid-template-columns: none; max-width: none; gap: 14px;
        overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
        margin: 0 -20px; padding: 22px 20px 14px; scroll-padding: 0 20px; scrollbar-width: none;
    }
    .pricing-grid::-webkit-scrollbar { display: none; }
    .pricing-grid .pricing-card,
    .pricing-grid .pricing-card:last-child {
        flex: 0 0 82%; max-width: 330px; margin: 0; grid-column: auto; scroll-snap-align: center;
        padding: 28px 22px; border-radius: 22px;
    }
    .pricing-card:hover { transform: none; }
    .pricing-card .price-amount { font-size: 2.4rem; }
    .pricing-card .price-note { margin-bottom: 20px; }
    .pricing-card .features-list { margin-bottom: 24px; }
    .pricing-card .features-list li { padding: 7px 0; font-size: 0.86rem; }
    .pricing-card.featured { box-shadow: 0 10px 34px rgba(var(--primary-rgb), .22); }

    .m-dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 6px; }
    .m-dots button {
        width: 8px; height: 8px; padding: 0; border: 0; border-radius: 8px; background: #cbd5e1; cursor: pointer;
        transition: width .3s, background .3s;
    }
    .m-dots button.active { width: 24px; background: var(--primary); }

    /* ─── Testimonials: swipeable ─── */
    .testimonials-grid {
        display: flex; grid-template-columns: none; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
        margin: 0 -20px; padding: 6px 20px 14px; scroll-padding: 0 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .testimonials-grid::-webkit-scrollbar { display: none; }
    .testimonial-card { flex: 0 0 86%; max-width: 340px; scroll-snap-align: center; padding: 24px 20px; }
    .testimonial-card:hover { transform: none; }

    /* ─── Misc polish ─── */
    .modules-visual { padding: 22px 18px; border-radius: 20px; }
    .report-bar { gap: 10px; }
    .report-bar .label { width: 78px; font-size: 0.74rem; }
    .report-bar .value { width: 48px; font-size: 0.74rem; }
    .module-item { padding: 16px 16px; gap: 14px; }
    .module-item .icon { width: 42px; height: 42px; }
    .keyboard-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .kbd { min-width: 0; padding: 12px 6px; }
    .migration-visual { padding: 28px 18px; }
    .migration-target { padding: 14px 20px; font-size: 1rem; }
    .step-card p { max-width: 300px; }
    .compare-toggle { margin-bottom: 24px; }
}

@media (max-width: 380px) {
    .pricing-grid .pricing-card, .pricing-grid .pricing-card:last-child { flex-basis: 88%; }
    .testimonial-card { flex-basis: 90%; }
}

@media (prefers-reduced-motion: reduce) {
    .feature-card p, .feature-card::after, .m-dots button { transition: none !important; }
}

/* container gutter is 16px on phones (see common.css) — keep carousels flush to it */
@media (max-width: 480px) {
    .pricing-grid, .testimonials-grid { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
}
