/* Custom Dropdown Styling */
.sls-custom-dropdown {
    position: relative; /* Changed from absolute to relative for header flow */
    display: inline-block;
    vertical-align: middle;
    margin-right: 15px; /* Spacing from cart */
    font-family: inherit;
    font-size: 13px;
    color: #333;
    z-index: 1000;
}

/* Fallback if JS fails to move it */
.sls-fallback-position {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
}

.sls-selected {
    background-color: transparent; /* Cleaner in header */
    border: 1px solid transparent; 
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-width: auto;
}

.sls-selected:hover {
    background-color: rgba(0,0,0,0.03);
}

.sls-flag img {
    width: 20px;
    height: auto;
    border-radius: 2px;
    display: block;
}

.sls-name {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    color: inherit;
}

.sls-arrow {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

.sls-dropdown-list {
    position: absolute;
    top: 100%;
    right: -10px; /* Align slightly right */
    width: 140px;
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 8px 0 0 0;
    padding: 5px 0;
    display: none;
    z-index: 100001;
    text-align: left;
}

/* Add bridge to prevent menu from closing when moving mouse over the gap */
.sls-dropdown-list::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

/* Add bridge to prevent menu from closing when moving mouse over the gap */
.sls-dropdown-list::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

/* Show on hover of container */
.sls-custom-dropdown:hover .sls-dropdown-list {
    display: block;
}

.sls-dropdown-list li {
    margin: 0;
    padding: 0;
}

.sls-dropdown-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.sls-dropdown-list a:hover {
    background-color: #f5f5f5;
}

.sls-dropdown-list .sls-flag img {
    width: 18px;
}

.sls-dropdown-list .sls-name {
    text-transform: none; /* Full name shouldn't be forced upper only if short */
    font-size: 14px;
}

/* Mobile-specific positioning */
.sls-mobile-position {
    margin-right: 10px;
    margin-left: 0;
}

@media (max-width: 921px) {
    .sls-custom-dropdown {
        margin-right: 10px;
    }
    
    .sls-selected {
        padding: 4px 6px;
    }
    
    .sls-flag img {
        width: 18px;
    }
    
    .sls-name {
        font-size: 12px;
    }
}
