/* Mobile Banner Height Fix & Text */
@media (max-width: 768px) {
    .carousel-item img {
        height: 200px !important;
        object-fit: cover;
    }

    .carousel-caption h2 {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    .carousel-caption p {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .carousel-caption {
        padding: 0.5rem !important;
        bottom: 1rem !important;
    }
}

/* Header Search Toggle Logic */
#nav-search-form.d-flex {
    display: flex !important;
    align-items: center;
}

/* Ensure container collapse works smoothly and is hidden correctly */
#header-search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
}

#header-search-bar:not(.show) {
    display: none;
}

/* Small Mobile Fixes (iPhone SE / 320px) */
@media (max-width: 380px) {
    .navbar .container {
        flex-wrap: nowrap !important;
        /* Force single line */
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar-brand {
        font-size: 1.1rem !important;
        margin-right: auto !important;
        /* Push icons to right */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }

    .d-lg-none .btn-link,
    .d-lg-none .text-reset {
        margin-right: 0.25rem !important;
        /* Override me-2/me-3 */
        padding: 5px !important;
    }
}