.cf7-authyo-country-dropdown-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: flex;
    align-items: center;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    padding: 0 5px 0 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Fix for CF7 autop injecting <p> tags with margins */
p:has(> .cf7-authyo-country-dropdown-wrapper) {
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide empty P and BR tags injected by CF7 inside the flex container */
.cf7-authyo-country-dropdown-wrapper~br,
.cf7-authyo-country-dropdown-wrapper~p:empty,
p:empty:has(+ .cf7-authyo-country-dropdown-wrapper) {
    display: none !important;
}

.cf7-authyo-country-dropdown-wrapper:hover {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.cf7-authyo-country-search {
    border: none !important;
    background: transparent !important;
    padding: 10px 5px 10px 0 !important;
    font-size: 14px !important;
    flex: 1 !important;
    min-width: 0 !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
}

.cf7-authyo-country-code-display {
    display: none;
    font-size: 12px;
    margin-right: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    color: #2271b1;
    background: #eef7fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.cf7-authyo-country-code-display:not(:empty) {
    display: inline-block;
}

.cf7-authyo-dropdown-arrow {
    font-size: 9px;
    color: #646970;
    pointer-events: none;
    margin-right: 5px;
    flex-shrink: 0;
}

.cf7-authyo-country-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 5px;
}

.cf7-authyo-country-item {
    padding: 5px 5px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.cf7-authyo-country-item:hover,
.cf7-authyo-country-item.active {
    background: #f0f6fc;
}

.cf7-authyo-country-flag {
    margin-right: 5px;
    font-size: 15px;
}

.cf7-authyo-country-name {
    flex: 1;
}

.cf7-authyo-country-item-dial {
    color: #646970;
    font-size: 12px;
    margin-left: 10px;
}





.cf7-authyo-country-dropdown-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: flex;
    align-items: center;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    padding: 0 5px 0 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Fix for CF7 autop injecting <p> tags with margins */
p:has(> .cf7-authyo-country-dropdown-wrapper) {
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide empty P and BR tags injected by CF7 inside the flex container */
.cf7-authyo-country-dropdown-wrapper~br,
.cf7-authyo-country-dropdown-wrapper~p:empty,
p:empty:has(+ .cf7-authyo-country-dropdown-wrapper) {
    display: none !important;
}

.cf7-authyo-country-dropdown-wrapper:hover {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.cf7-authyo-country-search {
    border: none !important;
    background: transparent !important;
    padding: 10px 5px 10px 0 !important;
    font-size: 14px !important;
    flex: 1 !important;
    min-width: 0 !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
}

.cf7-authyo-country-code-display {
    display: none;
    font-size: 12px;
    margin-right: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    color: #2271b1;
    background: #eef7fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.cf7-authyo-country-code-display:not(:empty) {
    display: inline-block;
}

.cf7-authyo-dropdown-arrow {
    font-size: 9px;
    color: #646970;
    pointer-events: none;
    margin-right: 5px;
    flex-shrink: 0;
}

.cf7-authyo-country-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 5px;
}

.cf7-authyo-country-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.cf7-authyo-country-item:hover,
.cf7-authyo-country-item.active {
    background: #f0f6fc;
}

.cf7-authyo-country-flag {
    margin-right: 12px;
    font-size: 18px;
}

.cf7-authyo-country-name {
    flex: 1;
}

.cf7-authyo-country-item-dial {
    color: #646970;
    font-size: 12px;
    margin-left: 10px;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .cf7-authyo-country-dropdown-wrapper {
        min-width: 120px;
        /* Ensure enough space for current country flag/code */
    }

    .cf7-authyo-country-item {
        padding: 12px 15px;
        /* Better touch target */
    }
}

@media screen and (max-width: 480px) {
    .cf7-authyo-country-search {
        font-size: 16px !important;
        /* Keep 16px to prevent iOS zoom */
    }

    .cf7-authyo-country-item {
        font-size: 13px;
        /* Reduced from 14px */
        padding: 10px 12px;
        /* More compact */
    }

    .cf7-authyo-country-flag {
        font-size: 14px;
        /* Reduced from 16px */
        font-weight: normal;
        margin-right: 10px;
    }

    .cf7-authyo-country-item-dial {
        font-size: 11px;
    }

    .cf7-authyo-country-list {
        max-height: 200px;
        /* Slightly shorter on mobile to keep keyboard space */
    }

    /* If inside a flex container (like the recommended phone layout) */
    [style*="display: flex"]>.cf7-authyo-country-dropdown-wrapper {
        flex: 0 0 auto !important;
        width: 105px;
        /* Slightly narrower */
    }
}