/* Location SEO Manager - Frontend Selector Widget */

.lsm-selector-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
}

/* Position variants — controlled by PHP body class or JS */
.lsm-position-bottom-left .lsm-selector-widget,
body[data-lsm-position="bottom-left"] .lsm-selector-widget {
    left: 20px;
    right: auto;
}

body[data-lsm-position="top-right"] .lsm-selector-widget {
    top: 20px;
    bottom: auto;
    right: 20px;
}

body[data-lsm-position="top-left"] .lsm-selector-widget {
    top: 20px;
    bottom: auto;
    left: 20px;
    right: auto;
}

/* Toggle Button */
.lsm-selector-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #1d2327;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    line-height: 1;
}

.lsm-selector-toggle:hover {
    background: #2c3338;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.lsm-selector-toggle svg {
    flex-shrink: 0;
}

.lsm-chevron {
    transition: transform 0.2s ease;
}

.lsm-selector-toggle[aria-expanded="true"] .lsm-chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.lsm-selector-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-height: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: lsmSlideUp 0.2s ease;
}

@keyframes lsmSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lsm-dropdown-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.lsm-dropdown-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 6px 0;
}

.lsm-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.lsm-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.lsm-dropdown-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Location Items */
.lsm-location-item {
    display: block;
    padding: 10px 16px;
    color: #1d2327;
    text-decoration: none;
    transition: background 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.lsm-location-item:hover {
    background: #f0f0f1;
    color: #1d2327;
    text-decoration: none;
}

.lsm-location-item.lsm-active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.lsm-location-item.lsm-active::before {
    content: "✓ ";
}

/* Country Group */
.lsm-country-group {
    border-bottom: 1px solid #f0f0f1;
}

.lsm-country-group:last-child {
    border-bottom: none;
}

.lsm-country-header {
    display: flex;
    align-items: center;
}

.lsm-country-header .lsm-country-link {
    flex: 1;
    font-weight: 500;
}

.lsm-expand-btn {
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #646970;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lsm-expand-btn:hover {
    color: #1d2327;
}

.lsm-expand-btn.lsm-expanded svg {
    transform: rotate(180deg);
}

/* City Items */
.lsm-city-item {
    padding-left: 32px;
    font-size: 13px;
    color: #50575e;
}

.lsm-city-item:hover {
    color: #1d2327;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .lsm-selector-widget {
        bottom: 12px;
        right: 12px;
    }

    .lsm-selector-dropdown {
        width: calc(100vw - 24px);
        right: 0;
        max-height: 60vh;
    }

    .lsm-selector-toggle {
        padding: 8px 14px;
        font-size: 13px;
    }
}