/* Card tables (responsive-tables.js) wrap each cell's content in .pp-val: on bigger screens it changes nothing */
.pp-val { display: contents; }

/* assets/css/pigapay-mobile.css - Phone fixes for every page (public site, merchant dashboard, admin).
 * Linked last in <head> by includes/brand_head.php, so it wins over each page's own styles. Only phones
 * (600px and narrower) are touched: buttons big enough for a finger, text large enough to read, nothing wider
 * than the screen. Tablets and computers look exactly as before. */

@media (max-width: 600px) {

    /* ── Nothing wider than the screen (cards in grids, table boxes) ── */
    .main-content .table-container,
    .main-content .as-card {
        max-width: 100%;
        box-sizing: border-box;
    }
    .as-grid > *, .as-try > *, .stats-grid > *, .charts-grid > *, .chart-grid > *, .tables-grid > * {
        min-width: 0;
    }

    /* ── Buttons a finger can hit (about 38-42px) ── */
    button, .btn, a.btn, [role="button"], input[type="submit"], input[type="button"], select {
        min-height: 38px;
    }
    button, .btn, a.btn {
        min-width: 38px;
    }
    /* Slider dots and the floating buttons keep their own size */
    button.dot, .dot, .pfab button, .pfab-btn, .slider-dots button {
        min-width: 0;
        min-height: 0;
    }
    /* Menu and close buttons of the dashboards */
    .hamburger, .mobile-sidebar .close-btn, .close-btn {
        min-width: 42px;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* ── Side menus: room to tap outside them, the close button at the top right beside the logo, links start high ── */
    .mobile-sidebar, .sidebar-nav {
        width: min(280px, 84vw) !important;
        padding: 0.9rem 1.2rem 1.5rem !important;
        box-sizing: border-box;
    }
    .mobile-sidebar:not(.open) {
        left: -320px !important;
    }
    .mobile-sidebar .close-btn, .sidebar-nav .close-btn {
        position: absolute;
        top: 0.45rem;
        right: 0.45rem;
        width: 42px;
        margin: 0;
        padding: 0;
    }
    .mobile-sidebar .logo-side, .sidebar-nav .logo-side {
        margin: 0 0 0.9rem;
        padding: 0.35rem 3rem 0.35rem 0;
        min-height: 34px;
    }
    /* ── Boxes to type in: below 16px an iPhone zooms the whole page when one is tapped (code boxes keep their big digits) ── */
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.otp-input):not(.tf-code):not(.otp-inputs input), select, textarea {
        font-size: 16px !important;
    }
    /* Buttons inside table rows (view, approve, copy, delete...) */
    table td button, table td .btn, table td a.btn, .action-buttons > button, .action-buttons > a {
        min-width: 38px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Show/hide password eye inside the password box */
    .form-group .toggle-password, .toggle-password {
        min-width: 40px;
        min-height: 40px;
        right: 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Open/close of questions (FAQ, Support), copy buttons on code, tabs and filters */
    .toggle-btn, .copy-code, .g-copy {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ── Text large enough to read (labels, badges and notes were 8.8-10.4px) ── */
    small, .stat-label, .stat-sub, .stat-change, .status-badge, .badge, .bar-label, .bar-value, .trend-up, .trend-down,
    .status-item, .ref-small, .status-subtext, .method-tag, .method-count, .integration-tag, .integration-status,
    .feature-tag, .status-webhook, #webhookStatusText, th, .popular-badge, span.method, .version-tag, .support-tag,
    .plan-badge, .plan-status, .fee-tag {
        font-size: 12px !important;
    }
    /* Small notes sized in the page itself (style="font-size: 0.6rem") */
    [style*="font-size: 0.5"], [style*="font-size:0.5"], [style*="font-size: 0.6"], [style*="font-size:0.6"] {
        font-size: 12px !important;
    }
    /* ── Tables as cards: each row a card, each value with its column name (assets/js/responsive-tables.js) ── */
    .main-content table.pp-cards,
    .main .table-container table.pp-cards {
        min-width: 0 !important;
        width: 100% !important;
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }
    table.pp-cards thead {
        display: none;
    }
    table.pp-cards tbody,
    table.pp-cards tr,
    table.pp-cards td {
        display: block;
        width: 100%;
    }
    table.pp-cards tr {
        background: #ffffff;
        border: 1px solid #e4eef8;
        border-radius: 14px;
        padding: 0.35rem 0.85rem;
        margin: 0 0 0.75rem;
        box-shadow: 0 4px 14px rgba(8, 36, 51, 0.05);
    }
    table.pp-cards tr:hover {
        transform: none;
    }
    table.pp-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.8rem;
        padding: 0.5rem 0 !important;
        border: none !important;
        border-bottom: 1px dashed #e4eef8 !important;
        text-align: right;
        white-space: normal !important;
        min-width: 0;
        overflow-wrap: anywhere;
    }
    table.pp-cards td:last-child {
        border-bottom: none !important;
    }
    table.pp-cards .pp-val {
        display: block;
        min-width: 0;
        text-align: right;
    }
    /* Lines inside a value stay one under the other, aligned right */
    table.pp-cards .pp-val > div, table.pp-cards .pp-val > small, table.pp-cards .pp-val > .merchant-info {
        justify-content: flex-end;
    }
    table.pp-cards td::before {
        content: attr(data-label);
        flex-shrink: 0;
        max-width: 42%;
        text-align: left;
        font-size: 12px;
        font-weight: 600;
        color: #6a8aa0;
    }
    table.pp-cards td[data-label=""]::before,
    table.pp-cards td.pp-full::before {
        content: none;
    }
    table.pp-cards td[data-label=""],
    table.pp-cards td.pp-full {
        justify-content: center;
        text-align: center;
    }
    /* The boxes that scrolled sideways no longer need to */
    .table-scroll:has(> table.pp-cards),
    .table-wrapper:has(> table.pp-cards),
    .table-responsive:has(> table.pp-cards) {
        overflow-x: visible;
    }
    body.dark-mode table.pp-cards tr {
        background: #0f1f30;
        border-color: #1a3348;
        box-shadow: none;
    }
    body.dark-mode table.pp-cards td {
        border-bottom-color: #1a3348 !important;
    }
    body.dark-mode table.pp-cards td::before {
        color: #8fb0c8;
    }

    /* Code inside sentences (not code blocks) */
    :not(pre) > code {
        font-size: max(12px, 0.85em) !important;
    }
}
