.country {
    padding: 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #f9fafb;
    font-family: 'Inter', sans-serif;
}

.country-container {
    position: relative; /* Оставим relative для общего контейнера */
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: visible; /* Позволяет дропдауну выходить за границы */
}

.option {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.dropdown-wrapper {
    position: relative; /* Важно: этот элемент является позиционирующим контекстом для dropdown-container */
    width: 100%;
}

.dropdown-btn {
    padding: 14px 18px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background-color: #fff;
    color: #333;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box; /* Убедимся, что padding и border учитываются в ширине */
}

.dropdown-btn::after {
    content: "▼";
    font-size: 12px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    transition: transform 0.3s ease; /* Добавляем анимацию для стрелки */
}

.dropdown-btn.active::after {
    transform: translateY(-50%) rotate(180deg); /* Поворот стрелки при активном состоянии */
}

.dropdown-btn.active {
    border-color: #3498db;
}

.dropdown-container {
  display: none;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 92px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: absolute;
  width: 92%;
  z-index: 9999;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
  scrollbar-width: thin;
}

.dropdown-container::-webkit-scrollbar {
  width: 6px;
}

.dropdown-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 6px;
}

.dropdown-container::-webkit-scrollbar-track {
  background: transparent;
}

.search-input {
  padding: 10px 14px;
  margin: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.drop {
  padding: 12px 18px;
  font-size: 15px;
  color: #2c3e50;
  cursor: pointer;
  transition: background-color 0.2s;
}

.drop:hover,
.drop.selected {
  background-color: #f0f0f0;
}

.drop-input {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}


@media (max-width: 1024px) {
    .country-container {
        max-width: 90%;
        padding: 28px;
        gap: 20px;
    }

    .option {
        font-size: 18px;
    }

    .dropdown-btn {
        padding: 12px 16px;
        font-size: 15px;
    }

    .dropdown-container {
        margin-top: 80px;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .country-container {
        padding: 24px;
        border-radius: 16px;
    }

    .option {
        font-size: 17px;
    }

    .dropdown-btn {
        font-size: 14px;
        padding: 11px 14px;
    }

    .dropdown-container {
        margin-top: 75px;
        width: 100%;
    }

    .drop {
        font-size: 14px;
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .country-container {
        padding: 20px;
    }

    .option {
        font-size: 16px;
    }

    .dropdown-btn {
        font-size: 13px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .dropdown-container {
        margin-top: 70px;
        width: 100%;
    }

    .drop {
        font-size: 13px;
        padding: 10px 12px;
    }
}
