/* ============================
   LISTING PAGE TWEAKS
   ============================ */

.sd-results-search-strip {
    background: #f9fafb;
    padding: 1.25rem 0;              /* ✅ equal top/bottom spacing */
    border-bottom: 1px solid #e5e7eb;
}

.sd-listing-body {
    background: #f9fafb;
}

/* ✅ Make header links visible on white header */
.sd-page-header .sd-nav-link-dark{
    color: rgba(15,23,42,.88);
    opacity: 1;
}
.sd-page-header .sd-nav-link-dark:hover{
    color: rgba(15,23,42,1);
    text-decoration: none;
}

/* Inline search card on listing (compact) */
.sd-search-wrapper--listing{
    margin-top: 0;                   /* ✅ no extra top gap */
    display: flex;
    justify-content: center;
}

.sd-search-card--compact{
    width: 100%;
    max-width: 1100px;
    background: #fff;
    border-radius: 16px;
    padding: 18px 18px 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* Make sure the grid can shrink (prevents overflow) */
.sd-search-card--compact .sd-search-form-row{
    width: 100%;
}

/* Price column – left aligned, nicer look on mobile and desktop */
.sd-price-col {
    align-items: flex-start;
    text-align: left;
}

/* Make CTA fill width on very small screens */
@media (max-width: 575.98px) {
    .sd-price-col .btn {
        width: 100%;
    }
}

/* ============================
   SEARCH FORM GRID (LISTING)
   ============================ */

/* Labels smaller, consistent */
.sd-search-card--compact .sd-field-label{
    font-size: 11px;
    letter-spacing: .04em;
    opacity: .85;
    margin-bottom: 6px;
    display: block;
    white-space: nowrap;
}

/* Inputs */
.sd-search-card--compact .sd-field-input,
.sd-search-card--compact .sd-field-display{
    height: 42px;
    border-radius: 999px;
    padding: 10px 14px;
    width: 100%;
}

/* ✅ critical: allow grid children to shrink */
.sd-search-card--compact .sd-field{
    min-width: 0;
}

/* ✅ Desktop grid: never overflow */
.sd-search-card--compact .sd-search-form-row{
    display: grid;
    grid-template-columns:
        minmax(220px, 2.2fr)    /* City */
        minmax(140px, 1fr)      /* Check-in */
        minmax(140px, 1fr)      /* Check-out */
        minmax(140px, 1.2fr)    /* Guests */
        minmax(140px, 1fr)      /* Budget */
        minmax(150px, 180px);   /* Search */
    gap: 14px;
    align-items: end;
    margin-top: 12px;
}

/* ✅ Rooms & Guests and Budget visible text max 16 chars */
.sd-ellip-16{
    display: inline-block;
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Display buttons should not wrap */
.sd-search-card--compact .sd-field-display{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search button */
.sd-search-card--compact .sd-btn-search-inline{
    width: 100%;
    height: 42px;
    border-radius: 999px;
    padding: 0 18px;
    white-space: nowrap;
}

/* Tighten on smaller desktops */
@media (max-width: 1200px){
    .sd-search-card--compact .sd-search-form-row{
        grid-template-columns:
            minmax(200px, 2fr)
            minmax(130px, .95fr)
            minmax(130px, .95fr)
            minmax(135px, 1.15fr)
            minmax(130px, 1fr)
            minmax(140px, 160px);
        gap: 10px;
    }
}

/* ============================
   MOBILE SEARCH COLLAPSE
   ============================ */

@media (max-width: 767.98px) {
    #sdListingSearchPanel.sd-search-collapsed {
        display: none;
    }

    .sd-mobile-search-toggle {
        border-radius: 999px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        padding: 0.6rem 0.9rem;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
        font-size: 0.875rem;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
    }

    .sd-mobile-search-line-main {
        font-weight: 600;
        font-size: 0.9rem;
    }

    .sd-mobile-search-line-sub {
        margin-top: 2px;
    }
}

/* ✅ Mobile grid: city full, then 2 cols, button full */
@media (max-width: 576px){
    .sd-search-card--compact{
        padding: 14px;
    }

    .sd-search-card--compact .sd-search-form-row{
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sd-search-card--compact .sd-field-city{ grid-column: 1 / -1; }
    .sd-search-card--compact .sd-field-submit{ grid-column: 1 / -1; }
}
