/* Mobile layout fixes - 4 December 2026.
   Loaded last on every page. Delete this file and its <link> to undo. */

/* Grid and form children may shrink to the screen. Without this, a long
   dropdown option or email address widened its column past the right edge,
   where it was cut off (html and body hide sideways overflow). */
.bl-contact-grid > *, .bl-form-row > *,
.form-wrapper > *, .booking-form > *, .form-row > *,
.contact-cards-grid > *, .map-form-grid > * { min-width: 0; }

.bl-form-group input, .bl-form-group select, .bl-form-group textarea,
.form-group input, .form-group select, .form-group textarea {
    max-width: 100%; min-width: 0; box-sizing: border-box;
}
.info-item > * { min-width: 0; }
.contact-card-text a, .info-text a, .footer-contact a, .footer-contact li { overflow-wrap: anywhere; }

/* Service and area cards: a 300px minimum did not fit a 320px phone. */
.svc-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.hub-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

@media (max-width: 480px) {
    .contact-card { padding: 32px 18px; }
    .contact-card-text { font-size: 15px; }
    .form-wrapper { padding: 28px 18px; }

    /* Readable text: buttons had shrunk to 10px and labels to 11px. */
    .btn, .btn-text, a.portfolio-view { font-size: 12px; }
    .bl-form-group label, .form-group label { font-size: 12px; }
    .filter-btn { font-size: 11px; }

    /* Footer links were 16px tall, too small to tap reliably. */
    .footer-menu a, .footer-bottom-links a, .bl-footer-links a { display: inline-block; padding: 5px 0; }
}

/* ── Call & WhatsApp: fixed bar along the bottom on phones and tablets ──
   Replaces the floating circles (.floating-btns) and pills (.bl-float),
   which covered form fields and text while scrolling. Desktop is unchanged. */
@media (max-width: 768px) {
    .floating-btns, .bl-float {
        position: fixed; top: auto; left: 0; right: 0; bottom: 0;
        display: flex; flex-direction: row; gap: 10px;
        padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
        background: rgba(12, 12, 12, 0.94);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255, 255, 255, 0.10);
        z-index: 9999;
    }
    .floating-btn, .bl-float-btn {
        flex: 1 1 0; min-width: 0;
        width: auto; height: 48px; padding: 0 12px;
        border: 0; border-radius: 12px;
        display: flex; align-items: center; justify-content: center; gap: 8px;
        color: #fff; text-decoration: none;
        box-shadow: none;
    }
    .floating-btn:hover, .bl-float-btn:hover { transform: none; box-shadow: none; }
    .floating-btn:active, .bl-float-btn:active { transform: scale(0.97); }
    .floating-btn-call, .bl-float-call { background: #FF6B35; }
    .floating-btn-whatsapp, .bl-float-wa { background: #25D366; }
    .floating-btn svg, .bl-float-btn svg { width: 20px; height: 20px; fill: #fff; flex-shrink: 0; }
    .floating-btn-label, .bl-float-btn span {
        position: static; display: inline; opacity: 1;
        background: none; padding: 0; border-radius: 0;
        color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
        white-space: nowrap; pointer-events: none;
    }

    /* Keep the end of every page clear of the bar */
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

    /* Back-to-top sits just above the bar, on the right */
    .back-to-top, .bl-totop {
        left: auto; right: 16px;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        width: 44px; height: 44px;
    }

    /* Hide the bar while the full-screen menu is open (it has its own Call/WhatsApp) */
    html.mnav-locked .floating-btns,
    html.mnav-locked .bl-float,
    html.mnav-locked .bl-totop { opacity: 0; pointer-events: none; }
}
