/* PolyLang Language Switcher Styles */

.polylang-switcher-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 12px 0;
    background: #f5f5f5;
    border-radius: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.polylang-nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 8px;
}

.polylang-switcher-container {
    flex: 1;
    min-width: 0; /* Important: allows flex item to shrink below content size */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-behavior: smooth;
    position: relative;
}

.polylang-switcher-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.polylang-switcher-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 16px;
    gap: 24px;
    align-items: center;
    width: max-content; /* Allow list to be wider than container */
}

.polylang-lang-item {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.polylang-lang-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 400;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.polylang-lang-link:hover {
    color: #333;
    background: #e0e0e0;
}

.polylang-lang-item.current-lang .polylang-lang-link {
    color: #2271b1;
    font-weight: 600;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.polylang-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.polylang-lang-name {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.polylang-nav-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.polylang-nav-btn:hover:not(:disabled) {
    background: #e0e0e0;
    color: #333;
}

.polylang-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.polylang-nav-btn:disabled {
    cursor: default;
    opacity: 0.3;
}

/* nav buttons are grouped on the left via .polylang-nav-group */

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .polylang-switcher-wrapper {
        padding: 8px 0;
    }
    
    .polylang-switcher-list {
        gap: 16px;
        padding: 0 12px;
    }
    
    .polylang-lang-link {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .polylang-nav-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
}

/* For very small screens */
@media screen and (max-width: 480px) {
    .polylang-switcher-list {
        gap: 12px;
        padding: 0 8px;
    }
    
    .polylang-lang-link {
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* Alternative compact style */
.polylang-switcher-wrapper.compact {
    background: transparent;
    padding: 4px 0;
}

.polylang-switcher-wrapper.compact .polylang-switcher-list {
    padding: 0 8px;
    gap: 12px;
}

.polylang-switcher-wrapper.compact .polylang-lang-link {
    padding: 4px 8px;
    font-size: 13px;
}

/* Clean white style */
.polylang-switcher-wrapper.white-style {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.polylang-switcher-wrapper.white-style .polylang-lang-item.current-lang .polylang-lang-link {
    background: #f0f0f0;
}

/* Boxed container support */
.site-wrapper .polylang-switcher-wrapper,
.container .polylang-switcher-wrapper,
.boxed-layout .polylang-switcher-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* Ensure parent containers don't cause overflow */
.polylang-error {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
}