/**
 * Apex27 Property Search Form
 * Responsive layout with mobile-first approach
 */

/* Wrapper */
.apex27-search-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Form - Mobile First */
.apex27-search-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 100%;
}

/* Section */
.apex27-search-section {
    width: 100%;
}

/* Market Buttons Container - Always inline */
.apex27-search-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
}

/* Market Button - custom styling */
.apex27-market-btn {
    width: auto;
    box-sizing: border-box;
    background-color: var(--secondary);
    border: 1px solid var(--secondary);
    color: #fff;
    text-transform: uppercase;
    font-weight: 400;
    border-radius: var(--radius);
    font-size: 13px;
    padding: 0.2rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.apex27-market-btn:hover {
    opacity: 0.9;
}

/* Active/selected state */
.apex27-market-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Filters Container - Mobile: Stack vertically */
.apex27-search-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

/* Filter Field */
.apex27-search-field {
    width: 100%;
}

/* Submit wrapper */
.apex27-search-submit {
    width: 100%;
}

/* Select Dropdown */
.apex27-select {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #ddd;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 3rem;
    box-sizing: border-box;
}

/* Submit Button - uses theme class */
.apex27-search-form .btn--primary {
    width: 100%;
    box-sizing: border-box;
}

/* Responsive: Small Tablet (600px+) */
@media (min-width: 600px) {
    /* Filters: keep stacked on small tablet */
    .apex27-search-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Responsive: Tablet (768px+) */
@media (min-width: 768px) {
    .apex27-search-form {
        gap: 1.5rem;
    }

    .apex27-select {
        padding: 1rem;
    }
}

/* Responsive: Desktop (1024px+) */
@media (min-width: 1024px) {
    .apex27-search-form {
        gap: 1.75rem;
    }

    /* Filters and submit: grid layout - 2fr 2fr 1fr */
    .apex27-search-filters {
        display: grid;
        grid-template-columns: 2fr 2fr 1fr;
        gap: 1.25rem;
        align-items: stretch;
    }

    .apex27-search-field {
        min-width: 0;
    }

    .apex27-search-submit {
        min-width: 0;
    }

    .apex27-search-form .btn--primary {
        height: 100%;
        width: 100%;
    }
}

/* Responsive: Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .apex27-search-form {
        gap: 2rem;
    }
}
