/* =====================================================
   MOBILE COMPACT LAYOUT (phones, 767px and below)
   Approved design: two-column homepage cards and compact calculator pages.
   Loaded after site.css and currency-selector.css; only overrides spacing, sizing and
   typography of existing classes. Tablet and desktop (768px and up) are not affected.
   ===================================================== */
@media (max-width: 767.98px) {

    /* ---------- Header: logo, name and currency on row 1; search and menu on row 2 ---------- */
    .navbar-brand {
        font-size: 0.95rem;
    }

        .navbar-brand .header-logo {
            height: 28px !important;
        }

    /* ---------- Homepage: two compact cards per row ---------- */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .category-card {
        padding: 1rem 0.6rem;
        min-height: 0;
        border-radius: 10px;
    }

    /* site.css pulls the icon up 15px and scales it 1.2x; inside the card's overflow:hidden
       that clipped the top of the icon. No negative margin here, so the icon stays whole. */
    .category-icon {
        font-size: 1.9rem;
        margin-top: 0.15rem;
        margin-bottom: 0.6rem;
    }

    .category-name {
        font-size: 0.95rem;
        line-height: 1.25;
        margin-bottom: 0.4rem;
    }

    .category-description {
        font-size: 0.75rem;
        line-height: 1.5;
        margin-bottom: 0;
    }

    /* ---------- Calculator pages: compact intro, input, result and guide cards ---------- */
    .calculator-intro,
    .calculator-guide {
        padding: 14px 16px;
    }

        .calculator-intro .calculator-header {
            gap: 10px;
            margin-bottom: 10px;
            padding-bottom: 10px;
        }

        .calculator-intro .calculator-header-icon {
            font-size: 1.5rem;
        }

        .calculator-intro .calculator-header h2 {
            font-size: 1.15rem;
            line-height: 1.25;
        }

        .calculator-intro .calculator-description {
            font-size: 0.9rem;
            line-height: 1.6;
        }

    .calculator-container {
        padding-top: 0.75rem;
        gap: 0.75rem;
    }

    .calculator-input-section,
    .calculator-result-section {
        padding: 1rem;
    }

        .calculator-input-section .calculator-header {
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
        }

            .calculator-input-section .calculator-header h2 {
                font-size: 1.35rem;
            }

    .calculator-page-content .form-group {
        margin-bottom: 1rem;
    }

    .calculator-page-content .form-label {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    /* Fields stay at 16px so iPhone Safari does not zoom in on focus. */
    .calculator-page-content .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 16px;
    }

    .calculator-page-content .form-select {
        padding: 0.5rem 2.5rem 0.5rem 0.75rem;
        font-size: 16px;
    }

    .calculate-button {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .results-header {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    .result-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .result-value {
        font-size: 1.6rem;
    }

    .result-details {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .calculator-guide {
        font-size: 0.9rem;
        line-height: 1.6;
    }

        .calculator-guide .calculator-header {
            gap: 10px;
            margin-bottom: 10px;
            padding-bottom: 10px;
        }

            .calculator-guide .calculator-header h2 {
                font-size: 1.15rem;
            }

        .calculator-guide h3 {
            font-size: 1rem;
        }

        .calculator-guide .guide-formula {
            font-size: 0.95rem;
            padding: 10px 12px;
        }
}
