.cpb-a14831d9-wrapper {
    position: relative;
    display: inline-block;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cpb-a14831d9-wrapper.is-loaded {
    opacity: 1 !important;
    visibility: visible !important;
}

.cpb-a14831d9-main-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
}

.cpb-a14831d9-icon-wrapper {
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
}

.cpb-a14831d9-call-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.cpb-a14831d9-flag {
    width: 24px;
    height: auto;
    object-fit: contain;
    display: block;
}

.cpb-a14831d9-country-name {
    font-weight: bold;
    margin-right: 5px;
    white-space: nowrap;
}

.cpb-a14831d9-phone-text-desktop {
    white-space: nowrap;
}

.cpb-a14831d9-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: max-content;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 9999; /* Increased z-index to ensure it sits on top */
    border-radius: 4px;
    overflow: hidden;
}

.cpb-a14831d9-dropdown.is-open {
    display: block;
}

.cpb-a14831d9-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.cpb-a14831d9-dropdown-item:hover {
    background-color: #f5f5f5;
}

/* Mobile Styles */
@media screen and (max-width: 1024px) {
    .cpb-a14831d9-wrapper {
        /* Ensure wrapper doesn't take full width unnecessarily */
        display: inline-flex;
    }

    /* COMPACT MODE STYLES (Hide text initially) */
    .cpb-a14831d9-mobile-mode-compact .cpb-a14831d9-phone-text-desktop,
    .cpb-a14831d9-mobile-mode-compact .cpb-a14831d9-country-name {
        display: none; /* Hide text initially on mobile */
    }
    
    .cpb-a14831d9-mobile-mode-compact .cpb-a14831d9-main-btn {
        padding: 10px; /* Smaller padding for compact view */
        justify-content: center;
        /* Remove explicit width so it shrinks to content */
        width: auto !important;
    }
    
    /* When expanded on mobile (Compact Mode only) */
    .cpb-a14831d9-mobile-mode-compact.is-expanded .cpb-a14831d9-phone-text-desktop,
    .cpb-a14831d9-mobile-mode-compact.is-expanded .cpb-a14831d9-country-name {
        display: inline-block;
        animation: fadeIn 0.3s ease forwards;
    }

    /* FULL BUTTON MODE STYLES */
    /* (Text remains visible, use default padding) */
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .cpb-a14831d9-dropdown {
        /* KEY FIX: Absolute positioning on mobile prevents layout shift */
        position: absolute; 
        top: calc(100% + 5px); /* Just below the button */
        left: 0;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        max-height: 0;
        opacity: 0;
        transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
        display: block; 
        width: max-content; /* Don't force full width */
        min-width: 100%; /* At least as wide as button */
        z-index: 9999;
    }
    
    .cpb-a14831d9-dropdown.is-open {
        max-height: 500px; 
        opacity: 1;
        margin-top: 0;
    }
    
    .cpb-a14831d9-dropdown-item {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
    }
    
    .cpb-a14831d9-dropdown-item:last-child {
        border-bottom: none;
    }
    
    .cpb-a14831d9-dropdown-item .cpb-a14831d9-country-name {
        display: inline-block; /* Show country name in dropdown */
    }
}

@media screen and (min-width: 1025px) {
    .cpb-a14831d9-wrapper:hover .cpb-a14831d9-dropdown {
        display: block;
    }
}
