/* ── MatMetriq Google Material 3 Style Combobox ── */

.mmq-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 580px) {
    .mmq-form-row {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }
}

.g-country-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* Outlined Input Field */
.g-country-field {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 42px;
}

.g-country-field:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: #1a2029;
}

.g-country-field.is-active,
.g-country-field:focus-within {
    border-color: #ff8533;
    box-shadow: 0 0 0 3px rgba(255, 133, 51, 0.18);
    background: #161b22;
}

/* Icon / Flag Badge */
.g-country-flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    margin-right: 8px;
    flex-shrink: 0;
    user-select: none;
    width: 20px;
    height: 20px;
}

.g-country-flag-badge svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Text Input */
.g-country-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f0f6fc;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 0;
    min-width: 0;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g-country-input::placeholder {
    color: #8b949e;
    font-family: inherit;
}

.g-country-field.is-active .g-country-input {
    cursor: text;
}

/* Action Icons (Clear / Chevron) */
.g-country-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    flex-shrink: 0;
}

.g-country-clear-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #8b949e;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.g-country-clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.g-country-chevron {
    width: 14px;
    height: 14px;
    fill: #8b949e;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    flex-shrink: 0;
}

.g-country-field.is-active .g-country-chevron {
    transform: rotate(180deg);
    fill: #ff8533;
}

/* ── Popover Dropdown Panel ── */
.g-country-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-width: 100%;
    background: #111622;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 133, 51, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    padding: 6px;
    display: none;
    flex-direction: column;
    max-height: 280px;
    box-sizing: border-box;
    animation: gFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.g-country-popover.is-open {
    display: flex;
}

@keyframes gFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Quick Suggestion Chips Header */
.g-country-quick-section {
    padding: 2px 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

.g-country-quick-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.g-country-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.g-country-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    font-size: 0.75rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.g-country-chip:hover {
    background: rgba(255, 133, 51, 0.15);
    border-color: rgba(255, 133, 51, 0.4);
    color: #ff8533;
    transform: translateY(-1px);
}

/* Country List Options */
.g-country-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: 220px;
    padding: 2px 0;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 133, 51, 0.4) transparent;
}

.g-country-list::-webkit-scrollbar {
    width: 5px;
}
.g-country-list::-webkit-scrollbar-thumb {
    background: rgba(255, 133, 51, 0.4);
    border-radius: 4px;
}

.g-country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
}

.g-country-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

.g-country-item-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.g-country-item-flag svg {
    display: block;
    width: 14px;
    height: 14px;
}

.g-country-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.g-country-item-name mark {
    background: rgba(255, 133, 51, 0.35);
    color: #ffffff;
    border-radius: 2px;
    padding: 0 2px;
}

.g-country-item-code {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-left: 6px;
}

.g-country-item:hover,
.g-country-item.is-focused {
    background: rgba(255, 133, 51, 0.15);
    color: #ff8533;
}

.g-country-item.is-selected {
    background: rgba(255, 133, 51, 0.22);
    color: #ff8533;
    font-weight: 700;
}

.g-country-no-results {
    padding: 14px 10px;
    text-align: center;
    color: #8b949e;
    font-size: 0.82rem;
}
