/* Базові стилі для віджету вибору локації */
.dsp-location-widget-wrapper {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.dsp-location-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    background-color: #3C4048;
    padding: 10px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.dsp-location-selector:hover {
    background-color: #484d56;
}

.dsp-location-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.dsp-location-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.4;
}

.dsp-location-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.dsp-location-arrow.active {
    transform: rotate(180deg);
}

/* Випадаючий блок */
.dsp-location-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
}

.dsp-location-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dsp-location-dropdown-content {
    padding: 20px;
}

.dsp-location-step {
    margin-bottom: 16px;
}

.dsp-location-step:last-of-type {
    margin-bottom: 0;
}

.dsp-location-step label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

.dsp-location-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

.dsp-location-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.dsp-location-field:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.dsp-location-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.dsp-location-apply,
.dsp-location-cancel {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.dsp-location-apply {
    background-color: #007bff;
    color: #ffffff;
}

.dsp-location-apply:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.dsp-location-apply:active {
    transform: translateY(0);
}

.dsp-location-cancel {
    background-color: #f5f5f5;
    color: #333333;
}

.dsp-location-cancel:hover {
    background-color: #e0e0e0;
}

.dsp-location-cancel:active {
    transform: translateY(0);
}

/* Адаптивність для планшетів */
@media (max-width: 1024px) {
    .dsp-location-dropdown {
        min-width: 280px;
        max-width: 350px;
    }

    .dsp-location-dropdown-content {
        padding: 16px;
    }

    .dsp-location-step {
        margin-bottom: 14px;
    }
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .dsp-location-selector {
        padding: 8px 12px;
        gap: 6px;
    }

    .dsp-location-icon {
        width: 18px;
        height: 18px;
    }

    .dsp-location-text {
        font-size: 13px;
    }

    .dsp-location-arrow {
        width: 14px;
        height: 14px;
    }

    .dsp-location-dropdown {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%);
        margin-top: 0;
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .dsp-location-dropdown.active {
        transform: translate(-50%, -50%);
    }

    .dsp-location-dropdown-content {
        padding: 20px;
    }

    .dsp-location-field {
        padding: 12px;
        font-size: 16px; /* Збільшуємо для кращої читабельності на мобільних */
    }

    .dsp-location-apply,
    .dsp-location-cancel {
        padding: 12px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .dsp-location-selector {
        padding: 6px 10px;
    }

    .dsp-location-text {
        font-size: 12px;
    }

    .dsp-location-dropdown {
        width: 95%;
        max-height: 85vh;
    }

    .dsp-location-dropdown-content {
        padding: 16px;
    }
}

/* Додатковий оверлей для мобільних версій */
@media (max-width: 768px) {
    .dsp-location-dropdown.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

