/* Custom Features by Mayantha — v2.0.0 */

/* ── Base select wrapper ─────────────────────────────────────────────────── */
.mayantha-filter-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.mayantha-filter-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: block;
    background-color: #ffffff;
    color: #111111;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 36px 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease;
}

.mayantha-filter-select:focus {
    outline: none;
    border-color: #aaaaaa;
}

/* Custom arrow */
.mayantha-filter-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #aaaaaa;
    pointer-events: none;
}

/* ── Price Range (From / Up to) ──────────────────────────────────────────── */
.mayantha-price-range-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.mayantha-price-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mayantha-price-label {
    display: block;
    font-size: 13px;
    color: #888888;
    font-weight: 400;
}

/* ── Sort widget ─────────────────────────────────────────────────────────── */
.mayantha-sort-widget {
    position: relative;
    display: inline-block;
}

.mayantha-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
    color: #111111;
    font-size: 14px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.15s;
}

.mayantha-sort-trigger:hover {
    border-color: #aaaaaa;
}

.mayantha-sort-icon {
    font-size: 16px;
    color: #e74c3c; /* red up/down arrows, matching screenshot */
    line-height: 1;
}

.mayantha-sort-label {
    color: #666666;
}

.mayantha-sort-chevron {
    font-size: 12px;
    color: #aaaaaa;
    margin-left: 4px;
    transition: transform 0.2s;
}

.mayantha-sort-dropdown.open ~ .mayantha-sort-trigger .mayantha-sort-chevron,
.mayantha-sort-trigger.open .mayantha-sort-chevron {
    transform: rotate(180deg);
}

.mayantha-sort-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    z-index: 9999;
    overflow: hidden;
}

.mayantha-sort-dropdown.open {
    display: block;
}

.mayantha-sort-option {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 14px;
    color: #666666;
    transition: background 0.1s;
}

.mayantha-sort-option:hover {
    background: #f5f5f5;
    color: #111111;
}

.mayantha-sort-option.active {
    color: #111111;
    font-weight: 600;
}

/* ── Taxonomy Tabs (button group) ────────────────────────────────────────── */
.mayantha-tax-tabs-widget {
    display: inline-flex;
    flex-wrap: wrap;
}

.mayantha-tax-tab {
    padding: 10px 20px;
    cursor: pointer;
    background: #ffffff;
    color: #888888;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    /* Remove gap between buttons */
    margin-right: -1px;
}

.mayantha-tax-tab:first-child {
    border-radius: 4px 0 0 4px; /* overridden by Elementor border radius control */
}

.mayantha-tax-tab:last-child {
    border-radius: 0 4px 4px 0; /* overridden by Elementor border radius control */
    margin-right: 0;
}

.mayantha-tax-tab:only-child {
    border-radius: 4px; /* overridden by Elementor border radius control */
}

.mayantha-tax-tab.active {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
    position: relative;
    z-index: 1;
}

.mayantha-tax-tab:hover:not(.active) {
    background: #f5f5f5;
    color: #333333;
}

/* ── WhatsApp Button ─────────────────────────────────────────────────────── */
.mayantha-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #25D366;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
    box-sizing: border-box;
}

.mayantha-wa-btn:hover {
    opacity: 0.88;
    color: #ffffff;
    text-decoration: none;
}

.mayantha-wa-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mayantha-wa-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ── ACF Badge ───────────────────────────────────────────────────────────── */
.mayantha-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-left: 3px solid transparent;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    width: 100%;
    box-sizing: border-box;
}

.mayantha-badge--yes {
    background-color: #f0faf5;
    border-left-color: #1a6e3c;
    color: #1a6e3c;
}

.mayantha-badge--no {
    background-color: #fffbeb;
    border-left-color: #b45309;
    color: #b45309;
}

.mayantha-badge-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mayantha-badge-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ── Results count ───────────────────────────────────────────────────────── */
.mayantha-results-count {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.mayantha-count-number {
    font-weight: 700;
}

/* ── Reset button ────────────────────────────────────────────────────────── */
.mayantha-filter-reset {
    display: block;
}

.mayantha-reset-btn {
    display: block;
    width: 100%;
    cursor: pointer;
    padding: 10px 20px;
    background-color: #111111;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    transition: opacity 0.15s;
}

.mayantha-reset-btn:hover {
    opacity: 0.85;
}
