/* =========================================================================
   PROplus - phone & tablet fixes. Loaded AFTER app.css (layouts/app + guest).
   Kept in its own file so app.css can change independently.
   ========================================================================= */

/* ---------- Project form: products card ----------
   The desktop sidebar is sticky with a top offset. The offset used to be an inline style, and on
   phones/tablets (where the card is not sticky but .card is position:relative) it pushed the card
   76px down over the submit button. Offset now applies only where the card is sticky (lg+). */
@media (min-width: 992px) {
    .products-card { top: calc(var(--topbar-h) + 1rem); }
}

/* ---------- Everything below: phones and small tablets ---------- */
@media (max-width: 991.98px) {
    /* Product list: no scroll box inside the page (nested scrolling is awkward with a thumb) */
    .products-scroll { max-height: none !important; overflow: visible !important; }
}

@media (max-width: 767.98px) {
    /* --- No sideways page scroll: wide tables scroll inside their card ---
       app.css sets ".card > .table-responsive { overflow: visible }" so row menus aren't clipped;
       row menus now position themselves "fixed" (components/actions), so scrolling is safe here. */
    .card > .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* --- iPhone zooms into any field with text under 16px when it is tapped --- */
    .form-control, .form-select, .form-control-sm, .form-select-sm,
    .input-group-text, .login-lang .lang-select { font-size: 16px; }

    /* --- Bigger tap targets (about 44px) --- */
    .topbar > .btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .topbar .dropdown-toggle { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .topbar .dropdown-toggle .bi { font-size: 1.25rem; }   /* icon-only menus on phones */
    .topbar .ms-auto { gap: .75rem !important; min-width: 0; }
    .topbar .dropdown { min-width: 0; }
    .topbar .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }

    /* checkboxes / radios (not toggle switches) */
    .form-check:not(.form-switch) { padding-left: 1.9em; min-height: 2.25rem; }
    .form-check:not(.form-switch) .form-check-input { width: 1.35em; height: 1.35em; margin-left: -1.9em; margin-top: .15em; }
    .form-check-label { padding: .2rem 0; }
    .product-pick .form-check-input { width: 1.35em; height: 1.35em; }

    .product-pick { min-height: 40px; }
    .accordion-button { min-height: 48px; }
    .password-toggle { width: 40px; height: 40px; right: 2px; }
    .login-lang .lang-select { min-height: 44px; }
    /* inline-flex so the label stays vertically centred when min-height grows the box (links styled as
       buttons kept their text at the top - misaligned "Uredi" / "Upravljaj fotografijama", 2026-11-19) */
    .btn-sm { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }

    /* --- Project page: action buttons. Edit + photos share the first row, delete gets its own full row
       (before, "Izbriši" was pushed right with ms-auto and wrapped alone to the far right). --- */
    .project-actions > .btn { flex: 1 1 0; }
    .project-actions > .project-actions-delete { flex: 1 1 100%; margin-left: 0 !important; }
    .project-actions > .project-actions-delete .btn { width: 100%; }

    /* links that stand alone on a line get a taller hit area */
    .login-split a:not(.btn), .stat-card a.small { display: inline-block; padding: .4rem 0; }

    /* --- Spacing --- */
    .card-body { padding: 1rem; }
    .card-header { padding: .75rem 1rem; }

    /* --- Photo picker: tall, easy-to-tap native file input --- */
    .photo-input { min-height: 48px; padding-top: .7rem; padding-bottom: .7rem; }

    /* --- Project form: remove (x) buttons in the "selected products" list --- */
    .pick-remove { min-width: 44px; min-height: 44px; }
}

/* Alpine: hide x-cloak'ed parts until Alpine has started */
[x-cloak] { display: none !important; }